

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Traffic Tiles
incomplete
2: Traffic Grid
incomplete
3: A* Search Algorithm
incomplete
4: A* Code
incomplete
5: A* Search Review
incomplete
This lesson's interactive features are locked, please to keep using them
Click to play video
We built the TrafficGrid and (in the previous chapter) the PriorityQueue so that we can use them in our implementation of the A* search algorithm, an optimized extension of Dijkstra's algorithm.
The A* algorithm, pronounced "A-star," is one of the best and most popular techniques used in path-finding.
Unlike conventional traversal algorithms like Dijkstra's and Bellman-Ford, A* is a "smart" algorithm that differentiates itself through the use of heuristics.
Many video games and web-based maps use A* to find approximate shortest paths very efficiently.
Heuristics in computer science and artificial intelligence are "rules of thumb" used in algorithms to help them quickly find optimal solutions to complex problems.
With a good heuristic, A* can work efficiently while still guaranteeing 100% accuracy – but a bad heuristic could result in a suboptimal solution.