Skip to content

About

Interactive web app for visualization of path finding algorihtm and Maze Generation Algorithms

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Interactive Pathfinding Algorithm Visualizer 🚀

A lightweight, high-performance pathfinding visualizer built with Svelte 5, TypeScript, and Vite.

Bundle Size Framework TypeScript


⚡ Why Svelte 5 + TypeScript?

  • Near-zero runtime overhead: Compiles directly into targeted imperative DOM updates without the heavy reconciliation diffing of a Virtual DOM.
  • 60 FPS CSS Keyframe Animations: Uses GPU-accelerated keyframe transforms for visited node ripples and shortest path glowing traces.
  • Instant Real-Time Recalculation: Once a path is calculated, dragging the Start or Target node live-recomputes the path in <1ms without re-animating.

🧠 Algorithms Included

Algorithm Type Shortest Path Guarantee? Description
A* Search Weighted Yes Uses heuristics ($f = g + h$) and Manhattan distance to guide search directly towards the target. Fastest optimal algorithm.
Dijkstra's Algorithm Weighted Yes The foundational shortest-path algorithm; explores radially by edge cost.
Breadth-First Search (BFS) Unweighted Yes (on unweighted) Explores level-by-level equally in all 4 cardinal directions.
Depth-First Search (DFS) Unweighted No Dives deep along branches before backtracking. Produces long, meandering paths.
Greedy Best-First Search Weighted No Fast, aggressive heuristic search ($f = h$).

🛠️ Features & Interactive Controls

  1. Interactive Grid:

    • Drag & Drop: Click and drag the Start (Green) or Target (Red) nodes anywhere on the board.
    • Wall Tool: Click and drag across cells to build impassable obstacles.
    • Weight Tool: Place weighted terrain (Cost: 5) to see how A* and Dijkstra intelligently detour around high-cost terrain compared to unweighted BFS.
    • Eraser Tool / Right Click: Erase walls or weights on click or drag.
    • Real-time Pathing: When a search is complete, dragging either node recalculates the route live in real time.
  2. Maze & Pattern Generators:

    • Recursive Division Maze: Creates a classic maze chamber system.
    • Random Wall Maze: Configurable randomized obstacle density.
    • Weighted Swamp Pattern: Scatters mud/terrain tiles to showcase weighted cost differences.
    • Staircase Pattern: Diagonal stair walls.
  3. Speed & Controls:

    • Animation Speeds: Instant, Fast, Normal, and Slow.
    • Path Telemetry: Displays nodes visited, path length, total cost, compute time (in ms), and algorithm complexity badges.

🏃 Getting Started

Prerequisites

Installation & Development

# Using Bun (Recommended)
bun install
bun dev

# Or using npm
npm install
npm run dev

Open http://localhost:5173 in your browser.

Production Build

bun run build
# Or
npm run build

About

Interactive web app for visualization of path finding algorihtm and Maze Generation Algorithms

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages