And or Graph
And or Graph
Madhuri Gupta
Assistant Professor
Department of Computer Science & Engineering
Recap of the last class on A * Algorithm
It's designed to find the shortest path between a starting node and a goal node in
a graph or a grid, while considering both the actual cost to reach a node and an
estimate of the remaining cost to reach the goal.
Efficiency of Greedy
Completeness and Best-First Search by
optimality of Dijkstra's considering both the
algorithm actual cost and the
estimated remaining cost.
• Solving various path finding
problems.
• Finding routes on maps
• Navigating robots and
A* :A Steps to • Planning trajectories.
Powerful
Algorithm
A* is Highly Effective and Efficient
The choice of heuristic can significantly impact its A well-designed heuristic can guide the algorithm
performance. toward the goal more accurately and help reduce the
number of nodes that need to be expanded.
• the A* search algorithm is a
versatile and widely used
technique for finding optimal
paths in graphs and grids.
• It's a fundamental concept in
Summary computer science and is applied
in numerous real-world scenarios
where efficient pathfinding is
essential.
AND-OR graph concept
Best-first search is what the AO* algorithm does.
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.
ii. Compute the cost of each iv. Mark CURRENT as v. If CURRENT has been
iii. Mark the best path out
of the arcs emerging from SOLVED if all of the nodes labeled SOLVED or its cost
of CURRENT by marking the So add all of the ancestors
CURRENT. Assign minimum connected to it through was just changed,
arc that had the minimum of CURRENT to S.
cost of its successors as its new labeled arc have been propagate its new cost back
cost in step ii
h. labeled SOLVED up through the graph.
• The evaluation function in AO* looks
like this:
f(n) = g(n) + h(n)
f(n) = Actual cost + Estimated cost
Working of here,
AO* f(n) = The actual cost of
traversal.
algorithm 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
So, by calculation
A⇢B path is chosen
AND = 8 which is the
minimum path, i.e
f(A⇢B)
Step 2
f(B⇢f) = 1 + 9 = 10
Step 2
f(A⇢B) = g(B) + updated h(B)= So we need to calculate it
1 + 8= 9 again.
Step 3
Step 3
f(C⇢H+I) = 1 + 0 + 1 + 0 ……
We traverse the arc from A and discover the unexpanded nodes B and C.
If we going to find a solution along this path, we will have to expand both B and C
eventually, so let’s choose to explore B first.
This generates two new arcs, the ones to G and to H. Propagating their f’ values
backward, we update f’ of B to 6(since that is the best we think we can do, which
we can achieve by going through G).
This requires updating the cost of the AND arc B-C to 12(6+4+2). After doing that,
the arc to D is again the better path from A, so we record that as the current best
path and either node E or node F will chosen for expansion at step 4.
STEP4:
EXAMPLE: 3
Solution Steps
Solution Steps
Real-Life Vehicle Routing Portfolio
Applications of Problem Optimization
AO* algorithm
• In both examples, the AO* algorithm can be
Real-Life Applic used to find the optimal solution that
ations of AO* balances multiple conflicting objectives, such
as minimizing distance and time in the
algorithm vehicle routing problem, or maximizing
returns and minimizing risks in the portfolio
optimization problem.
• The algorithm starts with an initial solution
and iteratively improves it by exploring
Summary alternative solutions and keeping the best
solution that satisfies both objectives
• A Constraint Satisfaction Problem (CSP) is
a computational problem in the field of
Upcoming Artificial Intelligence that involves finding
a solution that satisfies a set of constraints
Lecture or conditions.
Constraint
Satisfaction • It is a formal framework used to model
Problem (CSP) and solve problems where the goal is to
find values for a set of variables that meet
specified constraints.
• Components
• Variables
• Domains
• Constraints
• Objective
Brief •
•
Example
Solving Approaches
overview of • Backtracking
• Constraint Propagation
• Local Search
CSPs Applications
Challenges
• Constraint Satisfaction
Problems provide a formal
framework for modeling and
solving problems involving
variables, domains, and
constraints. They are used to
summary address a wide range of
real-world challenges across
different domains, where
finding a solution that adheres
to specified conditions is
critical.
•Thank You