0% found this document useful (0 votes)
2 views19 pages

A Algorithm

The document discusses the A* Algorithm, a popular pathfinding and graph traversal technique used in various applications like games and mapping. It outlines the algorithm's working mechanism, including the use of OPEN and CLOSED lists, and provides a problem example involving an 8-puzzle. The conclusion emphasizes that while A* is effective, it does not always guarantee the shortest path due to its reliance on heuristics.

Uploaded by

sanguthapa2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views19 pages

A Algorithm

The document discusses the A* Algorithm, a popular pathfinding and graph traversal technique used in various applications like games and mapping. It outlines the algorithm's working mechanism, including the use of OPEN and CLOSED lists, and provides a problem example involving an 8-puzzle. The conclusion emphasizes that while A* is effective, it does not always guarantee the shortest path due to its reliance on heuristics.

Uploaded by

sanguthapa2009
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Program : MCA

SUBJECT CODE: MCA-302


SUBJECT NAME:ARTIFICIAL INTELLIGENCE

TOPIC: A* Algorithm
Outlines
• Prerequisite
• A* Algorithm
• Working
• Algorithm
• Conclusion

IT504
2
Outlines
• Exercise
• Student Effective Learning Outcomes
• References

IT504
2
Prerequisite of topic

The basic knowledge of

•Basic knowledge of algorithm.

•Knowledge about informed search.

IT504 4
A* Algorithm-

A* Algorithm is one of the best and popular techniques used


for path finding and graph traversals.

A lot of games and web-based maps use this algorithm for


finding the shortest path efficiently.

It is essentially a best first search algorithm.

5
IT504 SELO: 1,2 Reference No.: R1, R2
Working-

• A* Algorithm works as-

It maintains a tree of paths originating at the start node.

It extends those paths one edge at a time.

It continues until its termination criterion is satisfied.

6
IT504 SELO: 1,2 Reference No.: R1, R2
functions

A* Algorithm extends the path that minimizes the


following function-
f(n) = g(n) + h(n)
Here,
‘n’ is the last node on the path
g(n) is the cost of the path from start node to node ‘n’
h(n) is a heuristic function that estimates cost of the cheapest
path from node ‘n’ to the goal node

7
IT504 SELO: 1,2 Reference No.: R1, R2
Algorithm-

The implementation of A* Algorithm involves maintaining two


lists- OPEN and CLOSED.
OPEN contains those nodes that have been evaluated by the
heuristic function but have not been expanded into successors
yet.
CLOSED contains those nodes that have already been visited.

The algorithm is as follows-


Step-01:
Define a list OPEN.
Initially, OPEN consists solely of a single node, the start node
S.
8
IT504 SELO: 1,2 Reference No.: R1, R2
CTD….
Step-02:

If the list is empty, return failure and exit.

Step-03:

Remove node n with the smallest value of f(n) from OPEN and
move it to list CLOSED.
If node n is a goal state, return success and exit.

Step-04:

Expand node n. 9
IT504 SELO: 1,2 Reference No.: R1, R2
CTD….
Step-05:

If any successor to n is the goal node, return success and the


solution by tracing the path from goal node to S.
Otherwise, go to Step-06.
Step-06:
For each successor node,
Apply the evaluation function f to the node.
If the node has not been in either list, add it to OPEN.
Step-07:

Go back to Step-02.
10
IT504 SELO: 1,2 Reference No.: R1, R2
Problem-01:

Given an initial state of a 8-puzzle problem and final state to be


reached-

Find the most cost-effective path to reach the final state from
initial state using A* Algorithm.
Consider g(n) = Depth of node and h(n) = Number of misplaced
tiles.
11
IT504 SELO: 1,2 Reference No.: R1, R2
EXAMPLE

12
IT504 SELO: 1,2 Reference No.: R1, R2
EXAMPLE

13
IT504 SELO: 1,2 Reference No.: R1, R2
Ctd….

14
IT504 SELO: 1,2 Reference No.: R1, R2
CONCLUSION

It is important to note that-

A* Algorithm is one of the best path finding algorithms.

But it does not produce the shortest path always.

This is because it heavily depends on heuristics.

15
IT504 SELO: 1,2 Reference No.: R1, R2
Learning Outcomes
1.Ability to solve problems through application of
theoretical and practical concept.
2. Students learned about the intelligent algorithms.
3.Advantage A* algorithm over best first sarch.

IT504 16
Student Effective Learning Outcomes
1. Ability to solve problems through application of theoretical and
practical concept.
2. Life long learning ability.
3.Application of concepts of topic & it’s taxonomical
applications.
4. Ability to be a life long self learner.
5. Ability to understand subject related concepts clearly along
with contemporary issues.

IT504 17
References
BOOKS:
1 .Rich E and Knight K, “Artificial Intelligence”, TMH, New Delhi.
2 .Nelsson N.J., “Principles of Artificial Intelligence”, Springer
Verlag,Berlin
3.Artificial Intelligence and Expert System, Gopal Krishna , Janakirama

IT504 18
IT504 19

You might also like