An interactive web app that brings path-finding algorithms to life
Build walls, add weights, adjust speed – then watch BFS, Dijkstra & A* explore in real time.
| Category | Highlights |
|---|---|
| Core Algorithms | • Breadth-First Search (BFS) · Unweighted • Dijkstra’s Algorithm · Weighted • A* Search · Heuristic-guided |
| Interactive Grid | • Drag-and-drop start/end nodes • Click-and-drag walls • Weighted cells (1-10) • Adjustable speed (10-200 ms) |
| Visual Experience | • Real-time exploration • Smooth Tailwind animations • Color-coded states (visited, path, walls) |
| Technical Extras | • Responsive design • Custom min-heap priority queue • Optimized renders & memory cleanup |
| Tech | Purpose | Notes |
|---|---|---|
| ⚛️ React & Hooks | UI & state | useState, useRef, useCallback |
| ⚡ Vite | Build tool | Instant dev server, lightning builds |
| 🎨 Tailwind CSS | Styling | Utility-first, fully responsive |
| 📝 ES6 JavaScript | Logic | Modern syntax & async/await |
| 📊 Custom PQ | Data structure | O(log N) operations for Dijkstra & A* |
| Algorithm | Time | Space | Best Use |
|---|---|---|---|
| BFS | O(V + E) | O(V) | Unweighted graphs |
| Dijkstra | O((V + E) log V) | O(V) | Weighted graphs |
| A* | O((V + E) log V) | O(V) | Weighted with heuristic |
- Node 14+
- npm or yarn
Setup Steps
- Node.js (version 14 or higher)
- npm or yarn package manager
- Clone the repository
git clone https://github.com/yaswanth230755/ShortestPathVisualizer.git
cd ShortestPathVisualizer
- Install dependencies
npm install
- Start the development server
npm run dev
- Open in browser
http://localhost:5173/
- 🟢 Start Node – drag to reposition
- 🔴 End Node – drag to reposition
- ⬛ Walls – click/drag to draw or erase
- 🎚️ Speed – slide between 10 – 200 ms
- Enable Weighted checkbox
- Set weight (1-10)
- Click Draw Weights, then paint cells (🟠)
- Pick algorithm (BFS / Dijkstra / A*)
- Build walls & weights
- Click Start and watch:
- 🟦 Visited nodes
- 🟡 Shortest path
- Click Reset anytime
BFS
- Type: Unweighted
- Guarantee: Shortest path
- Strategy: Level-by-level exploration
- Complexity: O(V + E)
Dijkstra
- Type: Weighted (non-negative)
- Guarantee: Shortest path
- Strategy: Expand closest unvisited node via priority queue
- Complexity: O((V + E) log V)
A* Search
- Type: Weighted + Heuristic
- Guarantee: Optimal with admissible heuristic
- Strategy: f = g + h (actual + Manhattan estimate)
- Complexity: O((V + E) log V)
ShortestPathVisualizer/
├─ public/
│ └─ index.html
├─ src/
│ ├─ App.jsx # Main component
│ ├─ main.jsx # Entry point
│ └─ index.css # Tailwind & global styles
├─ package.json # Scripts & deps
├─ vite.config.js # Vite setup
└─ tailwind.config.js # Tailwind setup
└── README.md
| Command | Purpose |
|---|---|
npm run dev |
Launch dev server |
npm run build |
Production build |
npm run preview |
Preview build locally |
npm run lint |
ESLint analysis |
- Priority Queue: Custom min-heap for O(log N) insert/delete
- Smart Rendering: Updates only affected grid cells
- Memory Safety: Cancels async loops on reset
- Responsive UI: Tailwind + flex/grid for any screen
- Fork ➜
git checkout -b feature/YourFeature - Develop & commit ➜
git commit -m "Add feature" - Push ➜
git push origin feature/YourFeature - Open Pull Request – we’ll review ASAP!
Please follow code style, add comments, and update docs/tests.
Released under the MIT License. See LICENSE for details.
| GitHub | @yaswanth230755 |
| Adimulam Yaswanth Veera Nagesh | |
| adimulamyaswanthveeranagesh@gmail.com |
- Classic CS path-finding lectures & articles
- React & Tailwind community for awesome tools
- All OSS contributors who inspire continuous learning
⭐ Star this repo if it helped you!
“The best way to understand algorithms is to see them in action.”
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Adimulam Yaswanth Veera Nagesh
- GitHub: @yaswanth230755
- Inspired by pathfinding algorithm visualizations
- Built with modern web technologies for optimal performance
- Special thanks to the open-source community
⭐ Star this repository if you found it helpful!