How A* works?👇 This tiny mathematical addition changes the entire search.
How A* works?👇
This tiny mathematical addition changes the entire search.
Dijkstra calculates only the distance already travelled:
f(n) = g(n)
A* adds an estimate of the distance still remaining:
f(n) = g(n) + h(n)
That small addition gives the algorithm a sense of direction.
Instead of searching the map almost equally in every direction, A* focuses on paths that appear closer to the destination.
Less exploration. Faster search. Same shortest path with the right heuristic.
One tiny formula can completely change how an algorithm thinks.
✨ Follow for daily CS animations that make complex ideas simple.
#viralreels #fyp #followme #algorithms #google
Comments
Comments from the original post on Instagram
No comments yet
