Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1.55 KB

README.md

File metadata and controls

40 lines (26 loc) · 1.55 KB

Dijkstra pathfinding visualiser

A small React and TypeScript project that animates a shortest-path search across a 20 × 20 grid. It provides a visual way to explore graph traversal and the relationship between algorithm state and a user interface.

Pathfinding visualisation

How it works

  1. The app generates random start and destination cells.
  2. Select GO! to animate the search across horizontal and vertical neighbours.
  3. Visited cells change appearance as the search progresses, followed by the reconstructed path.
  4. Select RESET to reload the grid with new endpoints.

The grid uses equal-cost steps. This is an early learning project, with no obstacle editor or weighted terrain.

Code map

File Responsibility
src/Algorithm.ts Distance updates, neighbour traversal, and path reconstruction
src/App.tsx Grid generation and controls
src/Cell.tsx Cell presentation
src/types.ts Grid, node, and cell-state types

Stack: React 17, TypeScript, styled-components, and Create React App.

Run locally

yarn install
yarn start

Open http://localhost:3000. Use yarn build to create a production build.

This repository retains its original dependency stack. Compatibility with current Node.js releases has not been revalidated as part of the documentation update.

Background

For an explanation of the algorithm, see Dijkstra's algorithm.