Presentation is loading. Please wait.

Presentation is loading. Please wait.

Search Techniques CS480/580 Fall 2009. Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:

Similar presentations


Presentation on theme: "Search Techniques CS480/580 Fall 2009. Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:"— Presentation transcript:

1 Search Techniques CS480/580 Fall 2009

2 Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs: – Nodes, edges, directed/undirected graph, acyclic graph

3 Search techniques for Trees Exhaustive search – Breadth-first search: Use a queue to implement Search nodes each level at a time – Depth-first search: Use a stack to implement Search nodes path at a time

4 Searching Graph Apply the same two techniques But to eliminate infinite looping, mark a node when it is already visited. This way it won’t be explored repeatedly.

5 Heuristic Search When the search space is very large (millions of nodes), it is not feasible to search the entire space; Instead we use a heuristic search that directs the search based on some heuristics – Evaluation function to rank the nodes to determine the order of search---which is most likely to succeed

6 Heuristic 1: Hill Climbing http://www.devarticles.com/c/a/Java/AIBased-Problem-Solving/4/ First decide on an evaluation function for each node---this depends on the specific application – E.g., In airline routing, if the task is to find a route that can take a passenger from airport X to airport Y, there could be several possible sequence of hops that need to be considered. – Suppose there is no direct path from X-Y, but there are 4 hubs H1, H2, H3, H4, that X has flights to, then we need to determine which is the next hub we want to explore. We need a basis for the decision. – Suppose we consider the distance between X and a hub as the evaluation function so the further a hub takes a passenger away from X, then the closer it is to the destination Y. So evaluation criteria is: choose an alternate that is farthest from X. – This may or may not always result in optimal solution. – Local maxima, local minima---problems – Look at the airline routing in the above reference

7 Best First Search Similar to BFS and DFS, it is exhaustive. The difference is that the next node to search is based on an evaluation function---in other words whenever we need to choose the next node to search pick the one with the best node value Calls for a priority queue instead of a stack or a FCFS queue Refer to Fig. 4.8 – Discussion in class

8 Least-cost search Always choose the one that costs less in the next step---that is we always choose the node that can be reached with minimal cost from the current location. For example http://www.devarticles.com/c/a/Java/AIBased-Problem-Solving/4/

9 A* Algorithm Variant of best first search Assumes: Estimated cost < Actual cost Admissible heuristic function: h(n) ≤ h * (n) where h * (n) is the true cost to the nearest goal.---never overestimate costs Guarantees optimal solution provided admissible heuristics is used ---minimum cost solution --- distance is a cost, travel time is a cost, etc. Here, evaluation function has two parts: cost of getting from start to the Current node; cost of going from current node to goal node or target node. f(Node) = g(Node) + h(Node) Refer to the following slidesslides

10 Using Search Techniques in problem Solving Puzzle solving, planning, routing, etc. In the case of a board puzzle, each node represents current state of the puzzle; goal node represents the desired board position


Download ppt "Search Techniques CS480/580 Fall 2009. Introduction Trees: – Root, parent, child, sibling, leaf node, node, edge – Single path from root to any node Graphs:"

Similar presentations


Ads by Google