AO Algorithm - Artificial Intelligence: AND-OR Graph
AO Algorithm - Artificial Intelligence: AND-OR Graph
Best-first search is what the AO* algorithm does. The AO* method divides any
given difficult problem into a smaller group of problems that are then
resolved using the AND-OR graph concept. AND OR graphs are specialized graphs
that are used in problems that can be divided into smaller problems. The AND side of
the graph represents a set of tasks that must be completed to achieve the main goal,
while the OR side of the graph represents different methods for accomplishing the
same main goal.
AND-OR Graph
In the above figure, the buying of a car may be broken down into smaller problems
or tasks that can be accomplished to achieve the main goal in the above figure, which
is an example of a simple AND-OR graph. The other task is to either steal a car that
will help us accomplish the main goal or use your own money to purchase a car that
will accomplish the main goal. The AND symbol is used to indicate the AND part of
the graphs, which refers to the need that all subproblems containing the AND to be
resolved before the preceding node or issue may be finished.
The start state and the target state are already known in the
knowledge-based search strategy known as the AO* algorithm, and the best path is
identified by heuristics. The informed search technique considerably reduces the
algorithm’s time complexity. The AO* algorithm is far more effective in searching
AND-OR trees than the A* algorithm.
Working of AO* algorithm:
The evaluation function in AO* looks like this:
f(n) = g(n) + h(n)
f(n) = Actual cost + Estimated cost
here,
f(n) = The actual cost of traversal.
g(n) = the cost from the initial node to the current node.
h(n) = estimated cost from the current node to the goal state.
Difference between the A* Algorithm and AO* algorithm
A* algorithm and AO* algorithm both works on the best first search.
They are both informed search and works on given heuristics values.
A* always gives the optimal solution but AO* doesn’t guarantee to give the
optimal solution.
Once AO* got a solution doesn’t explore all possible paths but A* explores all
paths.
When compared to the A* algorithm, the AO* algorithm uses less memory.
opposite to the A* algorithm, the AO* algorithm cannot go into an endless loop.
Example:
AO* Algorithm – Question tree
Here in the above example below the Node which is given is the heuristic value
i.e h(n). Edge length is considered as 1.
Step 1
AO* Algorithm (Step-1)
Step 3
f(C⇢H+I) is selected as the path with the lowest cost and the
heuristic is also left unchanged
because it matches the actual cost. Paths H & I are solved because the
heuristic for those paths is 0,
but Path A⇢D needs to be calculated because it has an AND.
as we can see that path f(A⇢C+D) is get solved and this tree has
become a solved tree now.
In simple words, the main flow of this algorithm is that we have to
find firstly level 1st heuristic
value and then level 2nd and after that update the values with going
upward means towards the root node.
In the above tree diagram, we have updated all the values.