Interactive browser-based route-search visualizer for Breadth-First Search, Dijkstra, A* and bidirectional Dijkstra.
It uses synthetic road networks to make search behavior visible. It is an educational simulator and does not reproduce Google Maps' proprietary routing system.
Official live version
https://clearhowguide.com/en/tools/route-algorithm-explorer/
Full guide
https://clearhowguide.com/en/science/how-google-maps-finds-fastest-route/
Use the same graph, start point, destination and edge costs, then compare how different algorithms search.
You can:
- choose start and destination nodes;
- switch between City Grid, Highway Network, River & Bridges and BFS Trap;
- run Breadth-First Search, Dijkstra, A* or bidirectional search;
- animate the search frontier;
- pause, resume, step and reset;
- inspect nodes explored, maximum frontier, path edges, path cost and coverage;
- race all four algorithms on the same graph;
- add traffic by changing edge weights;
- block roads;
- randomize and reset traffic;
- inspect algorithm internals in Advanced mode;
- share reproducible experiments through URL parameters;
- generate embeddable experiments;
- export results as SVG or PNG;
- compare many routes with the Benchmark Lab.
- The BFS Trap β fewest edges does not necessarily mean lowest weighted cost.
- Dijkstra's Expanding Wave β watch uninformed weighted search spread.
- A Gets a Compass* β see how an admissible heuristic can focus the search.
- Meet in the Middle β compare two weighted frontiers searching from both ends.
- Traffic Changes the Winner β change edge costs and watch the preferred path move.
The explorer emphasizes search work, not device-dependent browser timing:
- Nodes explored
- Maximum frontier
- Path edges
- Path cost
- Search coverage
- Local computation time (diagnostic only)
Nodes explored means nodes removed from the frontier and expanded by the algorithm.
Minimizes the number of edges. On weighted road networks this can differ from the minimum-cost path.
Expands the unsettled node with the lowest accumulated non-negative path cost.
Uses:
f(n) = g(n) + h(n)
The explorer uses an admissible straight-line lower-bound heuristic.
The interface calls this Bidirectional Search. Internally, weighted graphs use bidirectional Dijkstra.
See ALGORITHMS.md for methodology details.
The standalone explorer can run reproducible route samples and compare Dijkstra, A* and bidirectional Dijkstra.
Results describe this synthetic network and this implementation. They are not universal performance benchmarks and are not Google Maps benchmarks.
See BENCHMARKING.md.
Experiment state can be encoded in the URL, including:
- map preset;
- seed;
- start;
- destination;
- algorithm;
- UI mode;
- traffic overrides;
- blocked roads.
This makes a specific experiment shareable and reproducible.
The official hosted embed is designed for articles, lessons, blogs and course material.
See EMBEDDING.md.
The explorer runs route-search calculations locally in the browser.
The project does not require an account, database, Google Maps API, geocoding service or routing backend.
See PRIVACY.md.
The UI is designed to avoid communicating state through color alone and supports reduced-motion preferences.
See ACCESSIBILITY.md.
algorithms/
β
graph + priority queue + runner
β
render / share / export / benchmark
β
app.ts
β
RouteAlgorithmExplorer.astro
β
standalone / embed / ClearHowGuide article
Requirements:
- Node.js 22+
- npm
Install:
npm installDevelopment:
npm run devOpen:
http://localhost:4321/en/tools/route-algorithm-explorer/
Algorithm tests:
npm testExpected result:
Route Explorer algorithm tests passed: 121 cases.
Production build:
npm run buildroute-algorithm-explorer/
βββ .github/
βββ examples/
βββ scripts/
β βββ test-route-explorer.mjs
βββ src/
β βββ components/
β β βββ RouteAlgorithmExplorer.astro
β βββ lib/
β β βββ route-explorer/
β β βββ algorithms/
β β βββ app.ts
β β βββ benchmark.ts
β β βββ export.ts
β β βββ graph.ts
β β βββ presets.ts
β β βββ priorityQueue.ts
β β βββ render.ts
β β βββ runner.ts
β β βββ share.ts
β β βββ types.ts
β βββ pages/
βββ ACCESSIBILITY.md
βββ ALGORITHMS.md
βββ BENCHMARKING.md
βββ CHANGELOG.md
βββ CITATION.cff
βββ CODE_OF_CONDUCT.md
βββ CONTRIBUTING.md
βββ EMBEDDING.md
βββ LICENSE
βββ PRIVACY.md
βββ SECURITY.md
βββ SUPPORT.md
βββ THIRD_PARTY_LICENSES.md
- Synthetic graphs are educational abstractions, not real road maps.
- The tool does not reconstruct or claim to know Google Maps' proprietary routing implementation.
- Browser timing varies by device, browser and current workload.
- BFS minimizes edge count, not weighted travel cost.
- Benchmark results are implementation- and graph-specific.
- Traffic values are synthetic unless explicitly set by the user.
Contributions are welcome. See CONTRIBUTING.md and CODE_OF_CONDUCT.md.
Please report security issues responsibly. See SECURITY.md.
See SUPPORT.md.
Citation metadata is available in CITATION.cff.
ClearHowGuide Route Algorithm Explorer is released under the MIT License.
See LICENSE.
ClearHowGuide:
https://clearhowguide.com/en/tools/route-algorithm-explorer/
Article:
https://clearhowguide.com/en/science/how-google-maps-finds-fastest-route/