Interactive visualizations of classic pathfinding and sorting algorithms — built to show the algorithms running, not just describe them. Every algorithm (and the binary-heap priority queue behind Dijkstra/A*) is implemented from scratch in TypeScript, unit-tested, and then animated in a Next.js UI.
Live demo: deploy in one click to Vercel (see below) — or run locally.
Pathfinding (draw walls, generate a maze, watch the search expand toward the goal):
| Algorithm | Data structure | Finds shortest path? |
|---|---|---|
| Breadth-First Search | queue | yes (unweighted) |
| Depth-First Search | stack | no |
| Dijkstra | binary-heap priority queue | yes (weighted) |
| A* | binary-heap + Manhattan heuristic | yes (weighted), guided |
Sorting (animated bars with live comparison/swap counts): bubble, insertion, selection, quicksort, merge sort, heap sort.
The interesting code is the tested algorithm core under src/lib/, independent of
React:
heap.ts— a from-scratch binary min-heap (array-backed complete tree).pathfinding.ts— BFS/DFS share a frontier driver; Dijkstra and A* share a uniform-cost driver that differs only by heuristic (() => 0vs Manhattan).sorting.ts— six sorts instrumented to emit animation frames + operation counts.maze.ts— recursive-backtracker maze generation (randomized DFS).
These are verified by src/lib/__tests__ and run in CI:
BFS finds the shortest path · Dijkstra & A* agree with BFS on optimal length · A* routes around weighted cells · every sort matches
[...a].sort()and never mutates its input · the generated maze is fully connected (BFS reaches every open cell) · the heap pops in sorted order.
| Algorithm | Time | Space |
|---|---|---|
| BFS / DFS | O(V + E) | O(V) |
| Dijkstra (binary heap) | O((V + E) log V) | O(V) |
| A* | O((V + E) log V), fewer expansions with a good heuristic | O(V) |
| Bubble / Insertion / Selection | O(n²) | O(1) |
| Quicksort | O(n log n) avg, O(n²) worst | O(log n) |
| Merge sort | O(n log n) | O(n) |
| Heap sort | O(n log n) | O(1) |
npm install
npm test # vitest — the algorithm test suite
npm run dev # http://localhost:3000
npm run build # production build (typecheck + compile)Import the repo at vercel.com/new — it auto-detects Next.js, needs no env vars, and gives you a live URL. (No backend, no secrets, nothing to abuse.)
TypeScript · Next.js (App Router) · Vitest. No algorithm libraries — the point is the from-scratch implementations.