CSE 4705 Artificial Intelligence Jinbo Bi Department of Computer Science & Engineering http://www.engr.uconn.edu/~jinbo
Search fundamentals Chapter 3.3
Useful concepts
Useful concepts After we formulate a problem, how do we find the solutions for it? Enumerate in some order all possible paths from the initial state Here: search through explicit tree generation ROOT = initial state Nodes and leafs generated through transition model In general, search generates a graph (same state through multiple paths), but we will just look at trees in lecture Treats different paths to the same node as distinct
Simple tree search example
Simple tree search example Determines search process
8-Puzzle: states and nodes
8-Puzzle: search tree
Uninformed search strategies
Uninformed search strategies
Uninformed search strategies
Breadth-first search
Breadth-first search
Breadth-first search (simplified)
Properties of breadth-first search
Exponential space/time complexity
Depth-first search
Depth-first search
Properties of depth-first search
Breadth-first vs depth-first search
Breadth-first vs depth-first search How can we get the best of both?
Depth-limited search: a building block
Iterative deepening search
Iterative deepening search
Iterative deepening search, example
Iterative deepening search, example
Iterative deepening search, example
Iterative deepening search, example
Properties of iterative deepening search
Iterative deepening search: time complexity
Summary of the algorithms
Bidirectional search: very brief review Two simultaneous searches from start and goal Motivation: Check whether the node belongs to the other frontier before expansion Space complexity is the most significant weakness Complete and optimal if both searches are breadth-first
Bidirectional search: very brief review The predecessor of each node can be efficiently computable Works well when actions are easily reversible
“Uniform cost” search Motivation: an example Romanian Holiday Problem All our search methods so far assume Step-cost = 1 This is not always true
“Uniform cost” search g(N): the path cost function If all moves equal in cost Cost = # of nodes in path – 1 g(n) = depth(n) Equivalent to what we have been assuming so far Assigning a (potentially) unique cost to each step N0, N1, N2, N3 are nodes visited on path p C(i,j): Cost of going from Ni to Nj g(N1) = C(0,1) + C(1,2) + C(2,3)
“Uniform cost” search
“Uniform cost” search Start Goal
“Uniform cost” search Example: Romania Holiday Problem Start S g(R) =80 2 F g(F) =99 R 1 is updated to 278 g(P) =177 P g(B) =310 3 4 B Goal g(B) =278 B 4 Goal
Summary of uninformed search C* is the cost of the optimal solution, and e is step cost
Informed search strategies
Informed search Part I (classical search) Informed = use problem-specific knowledge Best-first search and its variants A* - Optimal search using knowledge Proof of optimality of A* A* for maneuvering AI agents in games Heuristic functions Part II (beyond classical search, Chap 4) Local search and optimization Local search in continuous space Hill climbing, local bean search, …
Informed search Is Uniform cost search the best we can do?
A better idea
The straight-line distance from each city to Bucharest: Start Goal
A heuristic function
Breadth first for games, robots http://theory.stanford.edu/~amitp/GameProgramming/
An optimal informed search (A*)
Breadth first for a world with obstacles Pink: start node; Dark blue: goal Breadth-first search expands many nodes
Informed search (A*) in that world
Questions?