Skip to content

Yathu2007/React-Pathfinding-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

40 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitHub license GitHub issues GitHub pull requests GitHub forks GitHub Repo stars GitHub contributors

Overview

This project is an interactive web application that visualizes how classic pathfinding algorithms explore a grid to find the shortest path between two points.

The goal of this project is to build intuition around algorithm behavior (exploration order, optimality, and performance) using step-by-step animations

Preview

Pathfinding Algorithms

Algorithm Supports Weights Optimal Notes
BFS ❌ βœ… (unweighted only) Explores level-by-level
DFS ❌ ❌ Explores deeply, not guaranteed shortest path
Dijkstra βœ… βœ… Guarantees shortest path with non-negative weights
A* βœ… βœ… Uses heuristic to guide search and reduce exploration

Heuristic used for A*: Manhattan distance
$\left( h(n) = |x_n - x_\text{goal}| + |y_n - y_\text{goal}| \right)$

Mud cells introduce higher traversal costs, allowing Dijkstra and A* to demonstrate meaningful differences compared to BFS/DFS.

Features

  • Configurable start and end nodes
  • Interactive barriers
    • Walls (infinite cost)
    • Mud (higher traversal cost)
  • Weighted grid support
  • Automatic path reconstruction
  • Step-by-step animated visualization
  • Light / Dark mode

Installation Steps

  1. Clone the repository
git clone https://github.com/Yathu2007/React-Pathfinding-Visualizer.git
  1. Change the working directory
cd .\React-Pathfinding-Visualizer\
  1. Install dependencies
npm install
  1. Start the development server
npm start

The app will be available at http://localhost:3000

Built with