An interactive web application built with React and Vite to visualize various pathfinding algorithms. This tool helps in understanding how algorithms explore a graph to find a path between two points.

Features

  • Interactive Grid: Draw walls and add weights to the grid to create complex mazes and terrains.
  • Multiple Algorithms:
    • Dijkstra's Algorithm: The father of pathfinding algorithms; guarantees the shortest path.
    • Breadth-First Search (BFS): A great algorithm; guarantees the shortest path in unweighted graphs.
    • Depth-First Search (DFS): A bad algorithm for pathfinding; does not guarantee the shortest path.
  • Real-time Visualization: Watch the algorithms explore the grid in real-time.
  • Responsive Design: Works on desktop and mobile devices.

Usage Guide

  1. Select an Algorithm: Choose between Dijkstra, BFS, or DFS from the dropdown menu in the navbar.
  2. Draw Walls/Weights:
    • Click "Add Walls" to draw obstacles that the algorithms cannot pass through.
    • Click "Add Weight" to add "heavy" nodes (cost of 5) that algorithms like Dijkstra will try to avoid if a cheaper path exists.
  3. Move Nodes: Click "Set Start" or "Set Target" in the navbar, then click on any cell in the grid to move the start or end points.
  4. Run: Click the Run button to start the visualization.
  5. Reset: Click Reset to clear the board and reset the start/target nodes to their default positions.