How sksm-goyal/pathfinding-visualizer works
Pathfinding Visualizer is an interactive C++/SFML application for editing a grid and watching Dijkstra or A* search explore it and display a route. Its runtime is concentrated in src/main.cpp: the event loop handles user input, the search implementations update their respective exploration and path state, and the drawing loop renders that state. The excerpt shows each algorithm calling its path-reconstruction function and rendering from the path arrays. Some event-loop lines are omitted, so algorithm-button dispatch is not asserted.
Main entry points: main.cpp Input and grid editing
Components 9
Grid interaction
- Input and grid editing
src/main.cpp - Grid state
src/main.cpp
Pathfinding
- Dijkstra search
src/main.cpp - Dijkstra path reconstruction
src/main.cpp - A* search
src/main.cpp - A* path reconstruction
src/main.cpp
Visualization
- Grid and path renderer
src/main.cpp - SFML window
Other components
- User
Connections 6
- User → Input and grid editing: edits grid
src/main.cpp - Input and grid editing → Grid state: updates cells
src/main.cpp - Dijkstra search → Dijkstra path reconstruction: calls
src/main.cpp - A* search → A* path reconstruction: calls
src/main.cpp - Grid state → Grid and path renderer: draws cells
src/main.cpp - Grid and path renderer → SFML window: draws frame
src/main.cpp