The AO* search algorithm is an informed search algorithm that combines best-first search with heuristic evaluation to find optimal solutions. It uses an AND-OR graph structure to represent decisions, alternative routes, and interdependencies. The algorithm traces paths in the graph, expands nodes, computes heuristic values, and propagates cost updates both forward and backward through the graph to maintain accurate path costs and select the optimal solution path. Backward propagation of cost changes is necessary to avoid pursuing non-optimal paths.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
262 views15 pages
Ao Search
The AO* search algorithm is an informed search algorithm that combines best-first search with heuristic evaluation to find optimal solutions. It uses an AND-OR graph structure to represent decisions, alternative routes, and interdependencies. The algorithm traces paths in the graph, expands nodes, computes heuristic values, and propagates cost updates both forward and backward through the graph to maintain accurate path costs and select the optimal solution path. Backward propagation of cost changes is necessary to avoid pursuing non-optimal paths.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15
AO* Search Algorithm
AO* SEARCH ALGORITHM
▪ AO* is an informed search algorithm used to find the
optimal solution by searching through a tree of possible solutions. ▪ It is a combination of best-first search and a heuristic evaluation. ▪ The algorithm utilizes both the structure of the problem and heuristic information. ▪ Based on divide and Conquer strategy in which a solution to a problem can be obtained by decomposing it into a smaller sub-problems. Each of these sub-problems can then be solved to get its sub solution. KEY CONCEPTS ▪ AND-NODES: ▪ Represent decisions or choices that have to be taken collectively. ▪ Typically, these are steps or sequences that have to occur together for a solution ▪ OR-NODES: ▪ Represent alternative routes or choices. ▪ These are different paths one can take to reach the desired goal. ▪ AO* search algorithm is based on AND-OR graph or AND-OR tree. AND-OR GRAPH ▪ One AND arc may point to any number of successor nodes, all of which must be solved in order for the arc to point to a solution. ▪ To find the solutions in an AND-OR graph, we need an algorithm similar to best-first search but with the ability to handle the AND arcs appropriately. ▪ If we apply the best first search, then looking at the lowest f’ value node c will be selected for further expansion AND-OR GRAPH ▪ Total Path cost through B is 5 and through C it will add the cost of D also that is 9(3+4+2). ▪ The choice of which node to expand next must depend not only on f' value of that node but also on whether that node is part of the current best path from the initial node. ▪ The most promising single node is G with an f value of 3. It is even part of the most promising arc G-H, with a total cost of 9. But that arc is not part of the current best path since to use it we must also use the arc I-J, with a cost of 27. The path from A, through B, to E and F is better, with a total cost of 18. We should not expand G next; we should examine either E or F. PROBLEM REDUCTION ALGORITHM FUTILITY In order to describe an algorithm for searching an AND-OR graph, we need to use a value that we call FUTILITY. If the estimated cost of a solution becomes greater than the value of FUTILITY, then we abandon the search. FUTILITY should be chosen to correspond to a threshold such that any solution with a cost above it is too expensive to be practical, even if it could ever be found. PROBLEM REDUCTION ALGORITHM ▪ Initialize the graph to the starting node. ▪ Loop until the starting node is labeled SOLVED or until its cost goes above FUTILITY: ▪ Traverse the graph, starting at the initial node and following the current best path, and accumulate the set of nodes that are on that path and have not yet been expanded or labeled as solved. ▪ Pick one of these unexpanded nodes and expand it. If there are no successors, assign FUTILITY as the value of this node. Otherwise, add its successors to the graph and for each of them compute f’ (use only h' and ignore g, for reasons we discuss below). If any node is 0, mark that node as SOLVED. ▪ Change the f' estimate of the newly expanded node to reflect the new information provided by its successors. Propagate this change backward through the graph. If any node contains a successor are whose descendants are all solved, label the node itself as SOLVED. At each node that is visited while going up the graph, decide which of its successor arcs is the most promising and mark it as part of the current best path. This may cause the current best path to change. This propagation of revised cost estimates back up the tree was not necessary in the best-first search algorithm because only unexpanded nodes were examined. But now expanded nodes must be reexamined so that the best current path can be selected. Thus it is important that their f' values be the best estimates available. OPERATION OF PROBLEM REDUCTION LIMITATIONS OF PROBLEM REDUCTION Longer path may be better: In the best-first search algorithm, the desired path from one node to another was always the one with the lowest cost. But this is not always the case when searching an AND-OR graph. LIMITATIONS OF PROBLEM REDUCTION It fails to take into account any interaction between subgoals. THE AO* ALGORITHM ▪ Problem reduction algorithm is the simplification of AO* algorithm ▪ It uses a GRAPH data structure ▪ Nodes in the graph point both down to its immediate successors and up to its immediate predecessors. ▪ Each node have associated with it an h' value, an estimate of the cost of a path from itself to a set of solution nodes. ▪ h’ will serve as the estimate of goodness of a node. ALGORITHM : AO* 1. Let GRAPH consist only of the node representing the initial state. (Call this node INIT.) Compute h(INIT). 2. Until INIT is labeled SOLVED or until INIT's h' value becomes greater than FUTILITY, repeat the following procedure: 1. Trace the labeled arcs from INIT and select for expansion one of the yet unexpanded nodes that occurs on this path. Call the selected node NODE. 2. Generate the successors of NODE. If there are none, then assign FUTILITY as the h value of NODE. This is equivalent to saying that NODE is not solvable. If there are successors, then for each one (called SUCCESSOR)that is not also an ancestor of NODE do the following: 1. Add SUCCESSOR to GRAPH. 2. If SUCCESSOR is a terminal node, label it SOLVED and assign it an h' value of 0. 3. If SUCCESSOR is not a terminal node, compute its h’ value. 3. Propagate the newly discovered information up the graph by doing the following: Let S be a set of nodes that have been labeled SOLVED or whose h' values have been changed and so need to have values propagated back to their parents. Initialize S to NODE. Until S is empty, repeat the, following procedure: ALGORITHM : AO* (i) If possible, select from S a node none of whose descendants in GRAPH occurs in s. If there is no such node, select any node from S. Call this node CURREN, and remove it from S. (ii) Compute the cost of each of the arcs emerging from CURRENT. The cost of each arc is equal to the sum of the h values of each of the nodes at the end of the arc plus whatever the cost of the arc itself is. Assign as CURRENT'S new h' value the minimum of the costs just computed for the arcs emerging from it. (iii) Mark the best path out of CURRENT by marking the arc that had the minimum cost as computed in the previous step. (iv) Mark CURRENT SOLVED if all of the nodes connected to it through the new labeled arc have been labeled SOLVED. (v) If CURRENT has been labeled SOLVED or if the cost of CURRENT was just changed, then its new status must be propagated back up the graph. So add all of the ancestors of CURRENT to S. AN UNNECESSARY BACKWARD PROPAGATION The path through C will always be better than the path through B, so work expended on the path through B is wasted. But if the cost of E is revised and that change is not propagated up through B as well as through C, B may appear to be better. For example, if, as a result of expanding node E, we update its cost to 10, then the cost of C will be updated to 11. If this is all that is done, then when A is examined, the path through B will have a cost of only 11 compared to12 for the path through C, and it will be labeled erroneously as the most promising path. In this example, the mistake might be detected at the next step, during which D will be expanded. If its cost changes and is propagated back to B, B's cost will be recomputed and the new cost of E will be used. Then the new cost of B will propagate back to A. At that point, the path through C will again be better. All that happened was that some time was wasted in expanding D. But if the node whose cost has changed is farther down in the search graph, the error may never be detected. A NECESSARY BACKWARD PROPAGATION
If the cost of G is revised and if it is not
immediately propagated back to E, then the change will never be recorded and a nonoptimal solution through B may be discovered.