An interactive web application that visualizes various pathfinding algorithms. Built with pure JavaScript, this project helps understand how different pathfinding algorithms work by providing a visual representation of their execution.
- Multiple pathfinding algorithms:
- A* (optimal path with heuristic)
- Dijkstra's Algorithm (optimal path)
- Breadth-First Search (optimal for unweighted graphs)
- Depth-First Search (not optimal but interesting to visualize)
- Interactive grid system
- Real-time visualization
- Wall/obstacle creation
- Adjustable start and end points
You can try the live demo by following the setup instructions below.
- Clone the repository:
git clone <your-repository-url>
cd pathfinding-visualizer- Install dependencies:
npm install- Start the server:
npm start- Open your browser and navigate to:
http://localhost:3000- Draw Walls: Click and drag on the grid to create walls/obstacles
- Set Start Point: Press CTRL/CMD + click to place the start node (green)
- Set End Point: Press SHIFT + click to place the end node (red)
- Choose Algorithm: Select an algorithm from the dropdown menu
- Visualize: Click the "Visualize" button to see the algorithm in action
- Clear Board: Use this button to remove all walls and reset nodes
- Clear Path: Use this button to keep walls but clear the visualization
- HTML5
- CSS3
- JavaScript (ES6+)
- Express.js (for serving the application)
Feel free to submit issues and enhancement requests!