390 likes | 699 Views
EA C461 Artificial Intelligence. To discuss?. Search StrategiesBest First Search Greedy Best First SearchA* SearchMemory Bounded Heuristic Search Heuristic FunctionsHeuristic AccuracyFinding appropriate heuristics. EA C461 Artificial Intelligence. Introduction. SearchHeuristic / InformedUse
E N D
1. EA C461 Artificial Intelligence Informed Search S.P.Vimal
BITS-Pilani
2. EA C461 Artificial Intelligence To discuss… Search Strategies
Best First Search
Greedy Best First Search
A* Search
Memory Bounded Heuristic Search
Heuristic Functions
Heuristic Accuracy
Finding appropriate heuristics
3. EA C461 Artificial Intelligence Introduction Search
Heuristic / Informed
Uses additional information about nodes (heuristics) that have not yet been explored to decide which nodes to examine next
Blind / Uninformed
Assumes no additional information about the problem
Heuristic function h (n) used in search provides an estimate of the distance from any given node to a goal node
4. EA C461 Artificial Intelligence Best First Search A node is selected for expansion based on an evaluation function f(n)
Choose the node which appears to be best while expanding
Best First Search algorithms differs in the evaluation function
Evaluation function incorporate the problem specific knowledge in the form of h(n)
h(n) ? heuristic function , a component of f(n)
? Estimated cost of cheapest path to the goal node
h(n) = 0, if n is the goal node
Greedy Best First Search, A* Search
5. EA C461 Artificial Intelligence Greedy best-first search Expands the node that is closest to the goal
Consider route finding problem in Romania
Use of hSLD, Straight Line Distance Heuristic
Evaluation function f(n) = h(n) (heuristic), estimate of cost from n to goal
For the problem of finding route from Arad to Burcharest…
6. EA C461 Artificial Intelligence
7. EA C461 Artificial Intelligence Greedy best-first search
8. EA C461 Artificial Intelligence Greedy best-first search
9. EA C461 Artificial Intelligence Greedy best-first search
10. EA C461 Artificial Intelligence Greedy best-first search
11. EA C461 Artificial Intelligence
12. EA C461 Artificial Intelligence Critics Minimizing f(n) is susceptible to false start
Same issues with DFS
Not optimal, Incomplete (may search an infinite path)
Performance depends problem and heuristic
O(bm) ? Worst case space needed
13. EA C461 Artificial Intelligence A* Search A better form of best-first search
f(n)=g(n) + h(n)
g(n) ?the cost to reach the node
h(n) ?the estimated cost of the cheapest path from n to the goal
f(n) ? the estimated cost of the cheapest solution through the node n
h(n) ? Admissible Heuristic / Consistent (in case of graph search)
14. EA C461 Artificial Intelligence A* search
15. EA C461 Artificial Intelligence A* search
16. EA C461 Artificial Intelligence A* search
17. EA C461 Artificial Intelligence A* search
18. EA C461 Artificial Intelligence A* search
19. EA C461 Artificial Intelligence A* search
20. EA C461 Artificial Intelligence A* Search : Admissible heuristics A heuristic h(n) is admissible if for every node n,
h(n) = h*(n), where h*(n) is the true cost to reach the goal state from n
An admissible heuristic never overestimates the cost to reach the goal, i.e., it is optimistic
Example: hSLD(n) (never overestimates the actual road distance)
Theorem: If h(n) is admissible, A* using TREE-SEARCH is optimal
21. EA C461 Artificial Intelligence A* Search : Optimality of A* (proof) Suppose some suboptimal goal G2 has been generated and is in the fringe. Let n be an unexpanded node in the fringe such that n is on a shortest path to an optimal goal G.
f(G2) = g(G2), since h(G2) = 0
g(G2) > g(G), since G2 is suboptimal
f(G) = g(G), since h(G) = 0
f(G2) > f(G), from above
22. EA C461 Artificial Intelligence A* Search: Repeated states Sub optimal solutions can be returned, if we discard the optimal path to a repeated node
Can be handled by keeping all nodes expanded in memory, and when repeated make a decision based on their costs
Make Sure, repeated nodes are costlier
Requires the heuristic to be consistent
23. EA C461 Artificial Intelligence A* Search : Consistent heuristics A heuristic is consistent if for every node n, every successor n' of n generated by any action a,
h(n) = c(n,a,n') + h(n')
If h is consistent, we have
f(n') = g(n') + h(n')
= g(n) + c(n,a,n') + h(n')
= g(n) + h(n)
= f(n)
i.e., f(n) is non-decreasing along any path.
Theorem: If h(n) is consistent, A* using GRAPH-SEARCH is optimal
24. EA C461 Artificial Intelligence A* Characteristics A* expands no nodes with f(n)>C*
These nodes are said to be pruned
This pruning still guarantees optimality
Expands nodes in the increasing order of costs
A* is optimally efficient
For a given heuristic, A* finds optimal solution with the fewest number of nodes expansion
Any algorithm that doesn’t expand nodes with f(n)<C* has the risk of missing an optimal solution
For most problems the number of nodes with costs lesser than C* is exponential
25. EA C461 Artificial Intelligence
26. EA C461 Artificial Intelligence Recursive best-first search Keeps track of the f-value of the best-alternative path available.
If current f-values exceeds this alternative f-value than backtrack to alternative path.
Upon backtracking change f-value to best f-value of its children.
Re-expansion of this result is thus still possible.
27. EA C461 Artificial Intelligence Recursive best-first search, ex.
28. EA C461 Artificial Intelligence Recursive best-first search, ex.
29. EA C461 Artificial Intelligence Recursive best-first search, ex.
30. EA C461 Artificial Intelligence RBFS evaluation RBFS is a bit more efficient than IDA*
Still excessive node generation (mind changes)
Like A*, optimal if h(n) is admissible
Space complexity is O(bd).
IDA* retains only one single number (the current f-cost limit)
Time complexity difficult to characterize
Depends on accuracy if h(n) and how often best path changes.
IDA* en RBFS suffer from too little memory.
31. EA C461 Artificial Intelligence (simplified) memory-bounded A* Use all available memory.
I.e. expand best leafs until available memory is full
When full, SMA* drops worst leaf node (highest f-value)
Like RFBS backup forgotten node to its parent
What if all leafs have the same f-value?
Same node could be selected for expansion and deletion.
SMA* solves this by expanding newest best leaf and deleting oldest worst leaf.
SMA* is complete if solution is reachable, optimal if optimal solution is reachable.
32. EA C461 Artificial Intelligence Heuristic functions E.g for the 8-puzzle
Avg. solution cost is about 22 steps (branching factor +/- 3)
Exhaustive search to depth 22: 3.1 x 1010 states.
A good heuristic function can reduce the search process.
33. EA C461 Artificial Intelligence Heuristic functions E.g for the 8-puzzle knows two commonly used heuristics
h1 = the number of misplaced tiles
h1(s)=8
h2 = the sum of the distances of the tiles from their goal positions (manhattan distance).
h2(s)=3+1+2+2+2+3+3+2=18
34. EA C461 Artificial Intelligence Heuristic quality Effective branching factor b*
Is the branching factor that a uniform tree of depth d would have in order to contain N+1 nodes.
Measure is fairly constant for sufficiently hard problems.
Can thus provide a good guide to the heuristic’s overall usefulness.
A good value of b* is 1.
35. EA C461 Artificial Intelligence Heuristic quality and dominance 1200 random problems with solution lengths from 2 to 24.
If h2(n) >= h1(n) for all n (both admissible)
then h2 dominates h1 and is better for search
36. EA C461 Artificial Intelligence Inventing admissible heuristics Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem:
Relaxed 8-puzzle for h1 : a tile can move anywhere
As a result, h1(n) gives the shortest solution
Relaxed 8-puzzle for h2 : a tile can move to any adjacent square.
As a result, h2(n) gives the shortest solution.
The optimal solution cost of a relaxed problem is no greater than the optimal solution cost of the real problem.
ABSolver found a usefull heuristic for the rubic cube.
37. EA C461 Artificial Intelligence Inventing admissible heuristics Admissible heuristics can also be derived from the solution cost of a subproblem of a given problem.
This cost is a lower bound on the cost of the real problem.
Pattern databases store the exact solution to for every possible subproblem instance.
The complete heuristic is constructed using the patterns in the DB
38. EA C461 Artificial Intelligence Inventing admissible heuristics Another way to find an admissible heuristic is through learning from experience:
Experience = solving lots of 8-puzzles
An inductive learning algorithm can be used to predict costs for other states that arise during search.
39. EA C461 Artificial Intelligence Reference :
Chapter 4.1, 4.2