Professional Documents
Culture Documents
AI Final PDF
AI Final PDF
Presented By Group 19
Krishna Kumar(IT2018/122)
Kishan Raj(IT2018/025)
Aavriti Dutta(IT2018/101)
HEURISTIC SEARCH
A* search is the most commonly known form of best-first search.It uses heuristic function
h(n), and the cost to reach the node n from the start state ie. g(n).This search algorithm
expands less search tree and provides optimal result faster. And it is also worth mentioning
that many games and web-based maps use this algorithm to find the shortest path very
efficiently.
It is formulated in terms of weighted graphs: starting from a specific starting node of a
graph, it aims to find a path to the given goal node having the smallest cost (least distance
travelled, shortest time, etc.) It does this by maintaining a tree of path originating at the
start node and extending those paths one edge at a time until the goal node is reached.
At each point in the search space, only those nodes are expanded which have the lowest
value of f(n), and the algorithm terminates when the goal node is found.
Function of A* Search Algorithm
f(n) = g(n) + h(n)
g(n) : the exact cost of moving from the Starting node to the current
node. Basically, it is the sum of all the cells that have been visited since
leaving the first cell.
f(n): estimated cost of the cheapest solution ie. Sum of the values of g(n)
and h(n).
How A* Search Algorithm works?
Let us understand the process of A* search algorithm with the help of an example
Initialization: f(S)=0+5=5
Iteration 4 will give the final result, as S→A→C→G it provides the optimal
path with cost 6.
Tree
Advantages of A* search algorithm:-
i. It does not always produce the shortest path as it is mostly based on heuristic
and approximation.
ii. A* algorithm has some complexity issues as we have to explore every nodes
to find the optimal path.
iii. The algorithm is complete only if the branching factor is finite and every action
has fixed cost.
Points to be remembered:-
i. A* algorithm returns the path which occurred first, and it does not
search for all remaining paths.
ii. The efficiency of A* algorithm depends on the quality of heuristic.
iii. A* algorithm expands all nodes which satisfy the condition f(n).
iv. It is not practical for various large scale problems because there is
memory requirement as it keeps all generated nodes in the
memory.
v. Time Complexity: The time complexity of A* search algorithm
depends on heuristic function, and the number of nodes expanded
is exponential to the depth of solution “d”.So the time complexity is
O(b^d), where “b” is the branching factor.
vi. Space Complexity: The space complexity of A* search algorithm
is O(b^d).
Conclusion:-
A* is a mighty algorithm in Artificial Intelligence with a wide
range of usage. However, it is only as good as its heuristic
function( which can be highly variable considering the nature
of a problem).
A* is the most popular choice for pathfinding because it’s
reasonably flexible.
It has found applications in many software systems, from
Machine Learning and search Optimization to game
development where characters navigate through complex
terrain and obstacles to reach the player.
THANK YOU