Lecture 2-State Space Search Flashcards
Why use State Space?
-Many AI problems can be expressed in terms of going from an initial state to a goal state
Brute force search vs heuristic search
Brute force search:
-generate and search all possibilities but INEFFICIENT
Heuristic search:
-only try the possibilities that you think are more likely to lead to good solutions
What is State Space represented by?
1.Inital state
2.Set of operations : responsible for transition between states
3.Goal test function: applied to a state to determine if it is a goal state
4.Path cost function: assigns a cost to a path to tell if a path is preferable to another
What is search space?
-The set of all states that can be reached from the initial state by any sequence of action
What is search algorithm?
-How the search space is visited
What can prevent termination?
-Cycles in graph representation(blind search without cycle check may never terminate)
What is uninformed search?
-We systematically explore the alternatives
-BRUTE FORCE SEARCH
-breadth-first, depth-first,depth-limited,iterative deepening,uniform cost
Depth-first vs breadth-first
Determine order for examining states:
-Depth-first: visit successors before siblings
-Breadth-first: visit siblings before successors, level-by-level
DFS vs BFS
-Only differ in the way they order nodes in the OPEN LIST
BFS :
-optimal (will always find shortest path)
-high memory
DFS:
-not optimal
-less memory
*BOTH IMPRACTICAL IN REAL APPLICATIONS BCUZ SEARCH SPACE TOO LARGE
What is DFS?
-Uses a stack –> nodes are added on the TOP of the list(LIFO)
What is BFS?
-Uses a queue –> nodes are added at the END of the list (FIFO)
What is Depth-limited search(DLS)?
-Compromise for DFS : DFS +depth cutoff k
What are the 3 possible outcomes of DLS?
-Solution
-Failure(no solution)
-Cutoff(no solution within cutoff)
What is Iterative Deepening?
-Compromise between BFS and DFS : DFS + a max depth before going to next level
-Needs little memory
-Finds shortest path
When is iterative deepening preferred?
When there is a large search space and the depth of the solution is unknown.
What is uniform cost search?
-Uses a priority queue sorted using the cost from the root to node n
-Guarantees to find the lowest cost solution path
What is informed search?
-We try to choose smartly
-HEURISTIC SEARCH
-best-first,…
What is heuristic search(2)?
-A technique that improves the efficiency of search
-Focus on paths most promising
What is the heuristic function h(n)?
-Estimate of the lowest cost from node n to the goal.
What is the heuristic function g(n)?
-Cost of current path from start to node n
What is the heuristic function f(n)?
-Estimate of the lowest cost of the solution path(from start to goal passing through n)
What are the 2 types of hill climbing?
1.General hill climbing
2.Steepest ascent hill climbing
What is general hill climbing strategy(2)?
-As soon as you find a position that is better than the current one, take it.
-Does not maintain a list of next nodes to visit(open list)
What is steepest ascent hill climbing(1)?
-Pick the best position out of all the next possible moves
What are the 2 problems with hill climbing?
1.Foothills(local maxima)
2.Plateau
What are foothills(local maxima)(3)?
-Reached a local maximum, not the global maximum
-A state that is better than all its neighbors but not better than some other states farther away.
-All moves appear to make things worse
What is plateau(2)?
-A flat area of search space in which the next states have the same value.
-Not possible to determine best direction in which to move by making local comparisons.
What are 2 solutions to hill-climbing problems?
1.Random-restart hill-climbing
2.Keep going even if the best successor has the same value as the current node (could lead to infinite loop on plateau)
Why not to use hill-climbing?
-One move is selected and all others are forgotten
Solution: use open as a priority queue AKA BEST-FIRST SEARCH
What is best-first search(3)?
-Insert nodes in OPEN list so that the nodes are sorted in ascending h(n)
-Always choose the next node to visit to be the one with the best h(n) – regardless of where it is in the search space
-It is an exhaustive search–> will eventually try all possible paths
How to design heuristics(3)?
-Heuristic evaluation functions are highly dependent on the search domain
-The more INFORMED , the BETTER on the SEARCH PERFORMANCE
-Bad heuristics lead to frequent backtracking
What are the 3 criteria in evaluating heuristics?
1.Admissibility
2.Monotonicity
3.Informedness
What is admissibility(3)?
-Admissible if it never overestimates the cost of reaching the goal
-Guarantees to find lowest cost SOLUTION PATH to the goals if it exists
-Does not guarantee to find the lowest cost SEARCH PATH
What is monotonicity(2)?
-Monotonic if it always finds the optimal path to each state the 1st time it is encountered
-Guarantees to find lowest COST PATH to each state n encountered in the search
What is informedness?
-More informed heuristics search smaller space to find the solution path
Why not use heuristics?
-Might be wrong, so search could continue down a wrong path
Solution: maintain depth/cost count (give preference to shorter/least expensive paths
Why was A* search created?
-To help Shakey the robot navigate a room of obstacles
What is the modified function f in A* search?
f(n) = g(n) + h(n)
-f(n) estimate of total cost along path through n
- g(n) actual cost of path from start to node n
- h(n) estimate of cost to reach goal from node n
What do you need in all search strategies?
1.Open list–> the frontier:
-lists generated nodes not yet expanded
-order of nodes controls order of search
2.Closed list–>the explored set
-stores all the nodes that have already been visited TO AVOID CYCLES
In data structures, what does each node in the lists contain?
-State representation
-Parent-node
-Children
-Bookkeeping