Skip to content

Nec0ti/Pathfinding-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pathfinding Visualizer

A web-based interactive tool for visualizing various pathfinding algorithms in action. This project provides a hands-on way to understand how algorithms like A*, Dijkstra's, and Breadth-First Search find the shortest path between two points.

Features

  • Algorithm Selection: Choose from A*, Dijkstra's Algorithm, and Breadth-First Search to compare their performance.
  • Interactive Grid: Create walls by clicking and dragging on the grid to simulate obstacles.
  • Start/End Nodes: Visualize the path from a defined start node to an end node.
  • Clear Visualization: Easily see how each algorithm explores the grid to find the optimal path.
  • Customizable Grid Size: Adjust the grid size to create more complex scenarios.
  • Dark/Light Theme: Toggle between a dark and light theme for comfortable viewing.
  • Wall Creation/Erasal: Left-click to create walls, right-click to erase them.
  • Responsive Design: Works well on various screen sizes.

Technologies Used

  • HTML
  • CSS
  • JavaScript

How to Use

  1. Open the website: https://nec0ti.github.io/Pathfinding-Algorithm/
  2. Create Walls: Click and drag on the grid to create walls that represent obstacles.
  3. Select an Algorithm: Choose an algorithm from the dropdown menu.
  4. Run the Algorithm: Click the "Run" button to visualize the pathfinding process.
  5. Reset the Grid: Click the "Reset" button to clear the grid and start over.
  6. Change Grid Size: Input the new desired grid size into the text field and it will automatically change the grid size.
  7. Toggle Themes: Click the "Toggle Theme" button to change between dark and light themes.

Implemented Algorithms

  • A* Search: A popular pathfinding algorithm that uses a heuristic to estimate the cost to the end node.
  • Dijkstra's Algorithm: Finds the shortest path from one node to all other nodes in the grid.
  • Breadth-First Search (BFS): Explores the grid level by level, guaranteeing the shortest path in an unweighted graph.

Future Enhancements

  • More Algorithms: Implement additional pathfinding algorithms like Greedy Best-First Search and Jump Point Search.
  • Animation Control: Add controls for adjusting the animation speed of the pathfinding process.
  • Heuristic Selection: Allow users to choose different heuristic functions for A*.
  • Weight Visualization: Add support for weighted graphs and visualize the cost of traversing each node.
  • Mobile Optimization: Improve the app's responsiveness and usability on mobile devices.

Contributing

Contributions are welcome! If you have ideas for new features, bug fixes, or improvements, please feel free to submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.