A lightweight, high-performance pathfinding visualizer built with Svelte 5, TypeScript, and Vite.
- 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.
| Algorithm | Type | Shortest Path Guarantee? | Description |
|---|---|---|---|
| A* Search | Weighted | Yes | Uses heuristics ( |
| 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 ( |
-
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.
-
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.
-
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.
# Using Bun (Recommended)
bun install
bun dev
# Or using npm
npm install
npm run devOpen http://localhost:5173 in your browser.
bun run build
# Or
npm run build