Note
Under Development
As the name suggests, this is a visualization webpage for a selected few pathfinding algorithms. Feel free to contribute if you find any bugs or want to add a new feature. You might also add your favorite algorithm if it's not already included :)
- Interactive Grid: Click and drag to set start/end points, walls, and weighted nodes.
- Multiple Algorithms: Visualize A*, Dijkstra's, BFS, DFS, Greedy Best-First Search, and Bidirectional Search.
- Customization:
- Obstacle Density: Adjust the percentage of obstacles in the grid.
- Visualization Speed: Control the speed of the algorithm's visualization.
- Weighted Nodes: Assign different weights to nodes to influence path cost.
- Grid Manipulation:
- Random Obstacles: Generate a random distribution of walls.
- Maze Generation: Create mazes using Recursive Backtracking.
- Import/Export: Save and load grid configurations.
Check out the live demo here.
A popular pathfinding and graph traversal algorithm known for its performance and accuracy. It uses heuristics to efficiently navigate through the grid.
Finds the shortest path between nodes in a graph, which may represent, for example, road networks. It explores all possible paths to determine the shortest one.
Explores the neighbor nodes first before moving to the next level neighbors. Ideal for finding the shortest path in unweighted graphs.
Explores as far as possible along each branch before backtracking. Useful for scenarios where all possible paths need to be explored.
Selects the path that appears to lead most directly to the goal, using a heuristic to prioritize nodes.
Simultaneously searches forward from the start node and backward from the end node, meeting in the middle to find the shortest path.
-
Clone the Repository
git clone https://github.com/basith-ahmed/search-algo-visualizer.git cd search-algo-visualizer
-
Install Dependencies
Using npm:
npm install
-
Run the Development Server
Using npm:
npm run dev
-
Select Draw Mode:
- Start Node: Click the flag icon to set the starting point.
- End Node: Click the target icon to set the endpoint.
- Walls: Click the pencil icon to draw walls on the grid.
- Weights: Click the info icon to assign weights to nodes.
- Erase: Click the eraser icon to remove elements from the grid.
-
Interact with the Grid:
- Click and Drag: Click on a node and drag to continuously add/remove elements based on the selected draw mode.
-
Control Panel:
- Algorithm Selection: Choose the desired algorithm from the dropdown menu.
- Run/Pause: Start or pause the visualization.
- Reset Grid: Clear the grid and reset all settings.
- Random Obstacles: Generate random walls based on the obstacle density slider.
- Generate Maze: Create a maze using Recursive Backtracking.
- Sliders:
- Obstacle Density: Adjust the percentage of walls in the grid.
- Visualization Speed: Control how fast the algorithm visualizes.
- Weight Value: Set the weight for weighted nodes.
-
Import/Export:
- Export: Save the current grid configuration as a JSON file.
- Import: Load a previously saved grid configuration.
Contributions are welcome! Whether it's reporting bugs, suggesting features, or submitting pull requests, your input is appreciated.
This project is licensed under the MIT License.
Feel free to reach out or open an issue if you have any questions or suggestions!
Happy Pathfinding! 🚀