This project is a web-based interactive tool to visualize various graph traversal and pathfinding algorithms. Users can draw their own mazes, select start and end points, and see how algorithms like Dijkstra's, A*, Breadth-First Search (BFS), and Depth-First Search (DFS) explore the graph to find the shortest path.
( you can download video it from the assets folder in this repository.)
- Interactive Grid: Draw and erase walls to create custom mazes.
- Algorithm Selection: Choose from a variety of classic graph algorithms:
- Dijkstra's Algorithm
- A* Search
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Step-by-Step Visualization: Watch the algorithm's exploration process unfold in real-time.
- Path Highlighting: The final shortest path is highlighted on the grid.
- Controls: Easily clear the maze, reset the markers, and start the visualization.
To get a local copy up and running, follow these simple steps.
- Node.js installed on your machine.
- Clone the repo:
git clone https://github.com/abhipdgupta/garph-algo-visualizer.git
- Navigate to the project directory:
cd garph-algo-visualizer - Install NPM packages:
npm install
-
Start the development server:
npm run dev
This command will watch for changes in the TypeScript files and recompile them.
-
Build for production:
npm run build
This command compiles the TypeScript code into JavaScript. The output will be in the
distfolder. For deploying to GitHub Pages, ensure that thedistfolder is pushed to your repository. -
Open the application: Open the
index.htmlfile in your web browser to use the visualizer. -
How to use the visualizer:
- Click "Draw Maze" to start creating walls on the grid by clicking and dragging.
- Click "Choose Marker" to set the start (green) and end (red) points.
- Select an algorithm from the dropdown menu.
- Click "Start Algorithm" to begin the visualization.
- Use "Clear Maze" to remove the walls or "Reset" to clear everything.
- HTML5 Canvas: For rendering the grid and animations.
- TypeScript: For the core application logic.
- Node.js: For the development environment.
