Shortest Path Algorithms
Overview
The Shortest Path Algorithms visualizer demonstrates three fundamental pathfinding algorithms: Dijkstra’s algorithm, A* search, and Bellman-Ford. Create weighted graphs and watch as each algorithm finds the optimal path from source to destination. See how Dijkstra guarantees the shortest path with non-negative weights, how A* uses heuristics to search more efficiently, and how Bellman-Ford handles negative edge weights. Perfect for understanding the trade-offs between different pathfinding approaches.
Tips
- Dijkstra’s algorithm is optimal for graphs with non-negative edge weights
- A* uses a heuristic (estimated distance to goal) to guide the search more efficiently
- Bellman-Ford can handle negative edge weights and detect negative cycles
- Watch how Dijkstra and A* expand from the source, while Bellman-Ford processes all edges
- Edge weights represent distance, cost, or time between nodes
- The visualization highlights the shortest path in green once found
- Compare algorithm performance: A* typically explores fewer nodes than Dijkstra
- Try graphs with negative weights to see where only Bellman-Ford works correctly