140 likes | 263 Views
Artificial Intelligence. Informed Search Methods. Chapter 4. Review. Last week, we talked about: Uninformed search strategies Can find solutions to problems by generating new states Testing them against the goal.
E N D
Artificial Intelligence Informed Search Methods Chapter 4
Review Last week, we talked about: • Uninformed search strategies • Can find solutions to problems by generating new states • Testing them against the goal. • uses no information that may be available about the structureof the tree or availability of goals, or any other information that may help optimise the search. • Inefficient in most case This week: • Informed search strategies: • Uses problem-specific knowledge • makes use of available informationmaking the search more efficient.
Outline of this Chapter • Best-first search • Greedy best-first search • A* search • Example of Heuristics
Informed search • Usually more efficient than blind search • It is also called a Heuristic search • A heuristic is a rule or method that almost alwaysimproves the decision process. • Sometimes state space is too large to search thoroughly • it is possible to introduce a scoring function, or evaluation function, that estimates which nodes seem promising • focus on paths that consist of promising nodes
Definition of a Heuristic Function • heuristic search- we explore the node that is most likely to be nearest to a goal state. To do this we use a heuristic function which tells us how close we are to a goal state , not how cheap the solution is so far. • A heuristic function is normally denoted h(n): • h(n) = estimated cost of the cheapest path from node n to a goal node.
Best-First Search (BestFS) • Type of Informed/Heuristic search • Uses an evaluation function on all successor nodes • Node with the lowest evaluation is expanded first (evaluation measures distance to the goal). • A combination of depth first (DFS) and breadth first search (BFS). • keep track of all other nodes at same level (like breadth-first) & does not get trapped in dead ends • follow single, most promising path down through tree (like depth-first) solution can be found without computing all nodes. • Special cases: • greedy best-first search • A* search
Greedy best-first search • This is one of the simplest BestFS strategy • It tries to get to the goal as it can at each step, without worrying about whether this will be best in the long run. (see next slide for an example). • Greedy best-first search expands the node that appears to be closest to the goal state first lead to a solution quickly. • The cost of reaching the goal from a state can be estimated using h(n) but cannot be determined exactly. • e.g. Route-finding problem (RFD) • A good heuristic function of RFP is SLD( Straight Line Distance). That is, • hSLD(n) = straight-line distance from n to the goal
Map of Romania with road distance in Km, & SLD to Bucharest We will see next the progress of GBFS using hSLD to find a path from A to B
Greedy best-first search Example Solution found without expanding a node that is not on the solution path search cost is minimal. Sol ={Arad, Sibiu, Fagaras, Bucharest} But the Best Sol ={Arad, Sibiu, Rimnicu Vilcea, Pitesti, Bucharest}
Properties of greedy best-first search • It is not optimal- e.g. the path it founds via Sibiu & Fagaras to Bucharest is 32 km longer than path through Rimnicu Vilcea & Pitesti. • It is not complete- solution may never be found, It is possible to get stuck in an infinite loop (consider being in Iasi and trying to get to Fagaras) • The heuristic suggests that Neamt be expanded 1st because it is closest to Fagaras, but is a dead end. • Search will oscillate between Iasi Neamt Iasi Neamt • Time complexity is O(bm); where m is the depth of the search tree • SpaceO(bm) keeps all nodes in memory
A* search • Idea: avoid expanding paths that are already expensive. • Greedy search minimizes the estimated cost to the goal, h(n) cuts the search cost but it is not optimal & complete. • UCS minimizes the costs of the path, g(n); it is optimal & complete but can be very inefficient. • To get the advantages of both strategies -- A* Search combinesthe 2 evaluation functions by summing them: f(n) = g(n) + h (n) g(n) = gives the path cost from the start node to node n h(n) = estimated cost from n to goal f(n) = estimated cost of the cheapest solution through n.
A* search Example (Progress of A*tree search for Bucharest) The h values are the straight-line distances to Bucharest taken from Slide 8