An interactive web application that visualizes various pathfinding algorithms in action. Built with Next.js, TypeScript, and Tailwind CSS.
- Multiple Algorithms: Visualize different pathfinding algorithms:
- Dijkstra's Algorithm
- A* Search
- Breadth First Search (BFS)
- Depth First Search (DFS)
- Interactive Grid:
- Click to place start and end points
- Draw walls by clicking or dragging
- Adjustable grid size
- Real-time Visualization:
- Watch algorithms explore the grid
- Adjust visualization speed
- See execution time
- Responsive Design:
- Works on desktop and mobile devices
- Dark/Light mode support
- PWA support for installation
- Educational:
- Detailed algorithm explanations
- Time and space complexity information
- Use cases and comparisons
- Node.js 18.0.0 or later
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/pathfinding-visualizer.git
cd pathfinding-visualizer- Install dependencies:
npm install
# or
yarn install- Run the development server:
npm run dev
# or
yarn dev- Open http://localhost:3000 in your browser.
- Place Start/End: Click on empty cells to place start (green) and end (red) points
- Create Walls: Click or drag to create/remove walls
- Clear Grid: Use the "Clear Grid" button or press
Ctrl/Cmd + C - Clear Path: Use the "Clear Path" button or press
Ctrl/Cmd + P - Start/Stop: Click the "Start" button or press
Space - Change Theme: Use the theme toggle button or press
Ctrl/Cmd + D
Choose from four different algorithms:
- Dijkstra's Algorithm: Guarantees the shortest path, works with weighted graphs
- A Search*: More efficient than Dijkstra's, uses heuristic function
- Breadth First Search: Guarantees shortest path in unweighted graphs
- Depth First Search: Memory efficient, explores deep paths
- Open in Safari
- Tap the Share button
- Select "Add to Home Screen"
- Tap "Add" to install
- Open in Chrome/Edge
- Tap the install button in the address bar
- Or use the "Install App" button in the welcome modal
- Next.js - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- PWA - Progressive Web App support
pathfinding-visualizer/
├── public/
│ ├── icons/ # PWA icons
│ ├── manifest.json # PWA manifest
│ └── sw.js # Service worker
├── src/
│ ├── app/
│ │ ├── algorithms.ts # Algorithm implementations
│ │ ├── page.tsx # Main application
│ │ ├── types.ts # TypeScript types
│ │ └── theme-provider.tsx # Theme management
│ └── styles/
└── README.md
Contributions are welcome! Please feel free to submit a Pull Request.
- 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.
- Inspired by various pathfinding visualizers
- Icons and assets from Heroicons
- Color schemes inspired by Tailwind CSS