An AI system that models city roads as a weighted graph — nodes as locations, edges as roads with travel costs. Graph search algorithms explore this structure to find the fastest, cheapest route.
Explores all neighbours level by level. Guarantees shortest path in unweighted graphs by visiting every possible node at each depth before going deeper.
Dives deep into one branch before backtracking. Memory-efficient and useful for maze-solving, but doesn't guarantee the shortest or cheapest path.
Expands the lowest-cost node first using a priority queue. Always finds the optimal path in weighted graphs — the gold standard for real road networks.
Combines actual cost + heuristic estimate. The fastest optimal pathfinder — intelligently guided toward the goal, skipping irrelevant branches entirely.
Always moves to the node that looks closest to the goal using heuristic alone. Very fast but may miss the globally optimal path in complex networks.
Drag to rotate · Scroll to zoom · Click "Animate" to watch the algorithm traverse the graph in 3D space
Watch the algorithm animate node-by-node on the 2D graph canvas
| Algorithm | Optimal? | Complete? | Time | Space | Best For |
|---|---|---|---|---|---|
| BFS | Yes* | Yes | O(V+E) | O(V) | Unweighted graphs |
| DFS | No | Yes | O(V+E) | O(V) | Exploring all paths |
| UCS | Yes | Yes | O((V+E)logV) | O(V) | Weighted graphs |
| A★ | Yes | Yes | O(E) | O(V) | Fastest optimal routing |
| Greedy | No | No | O(E logV) | O(V) | Quick approximate |
* BFS optimal only for unweighted graphs.
Optimized multi-stop city routing
Fleet routing for warehouses
Shortest pickup-to-dropoff paths
Real-time GPS turn-by-turn
Fastest ambulance routing
Last-mile delivery optimization