This Pathfinding Visualizer was developed for Cal Poly SLO’s CSC 349: Design and Analysis of Algorithms course while I was a Teaching Assistant. I created it to help students better understand how algorithms like Dijkstra’s, A*, and Breadth-First Search (BFS) work in a more visual and interactive way. The tool lets users place obstacles, adjust speed, and watch the algorithms explore and find optimal paths in real time, making complex concepts easier to grasp through dynamic visualization.
- Dijkstra's Algorithm - Guarantees shortest path, explores uniformly
- A-star Algorithm - Optimal and efficient, uses heuristics
- Greedy Best First Search - Fast but doesn't guarantee shortest path
- Bidirectional Greedy Search - Searches from both start and goal
- Breadth First Search - Explores layer by layer
- Depth First Search - Explores deeply before backtracking
- Random Walk - Random exploration (educational purposes)
- Random Maze - Randomly placed walls
- Recursive Division Maze - Creates chambers with passages
- Vertical Division Maze - Vertical walls with random gaps
- Horizontal Division Maze - Horizontal walls with random gaps
- Right-Click: Set start position (first click), then goal position (second click), then clear both (third click)
- Left-Click + Drag: Draw walls
- Run Button: Start the visualization
- Pause Button: Pause the visualization
- Reset Button: Clear the grid completely
- Generate Maze: Create a maze pattern
- Speed Slider: Adjust animation speed (lower = faster)
- Java JDK 19 or higher installed
# Clone the repository
git clone https://github.com/tarjmecwan/pathfinding-visualizer.git
cd pathfinding-visualizer
# Compile
javac -d bin -sourcepath src/main/java src/main/java/com/pathfinding/visualizer/app/App.java
# Run
java -cp bin com.pathfinding.visualizer.app.Appjava -jar PathfindingVisualizer.jar| Algorithm | Guarantees Shortest Path | Speed | Use Case |
|---|---|---|---|
| Dijkstra's | Yes | Medium | Weighted graphs, guaranteed shortest |
| A* | Yes | Fast | Best overall, uses heuristics |
| Greedy BFS | No | Very Fast | Quick solutions, not optimal |
| BFS | Yes (unweighted) | Medium | Unweighted graphs |
| DFS | No | Fast | Exploring all paths |
| Bidirectional | Yes | Fast | Large graphs |
- Java 19
- Swing (GUI)
- MVC Architecture Pattern
- Strategy Pattern (for algorithms)
