LIVE DEMO

Hourglass: exact shortest paths from both ends

Watch Dijkstra, A*, bidirectional search and Hourglass find the same route on the same map, see how Hourglass tilts the map and drops the sorting, race all four at one operation per tick, then run it in Galactus DB on real UK roads.

Hourglass: exact shortest paths from both ends: Watch Dijkstra, A*, bidirectional search and Hourglass find the same route on the same map, see how Hourglass tilts the map and drops the sorting, race all four at one operation per tick, then run it in Galactus DB on real UK roads.

This interactive demo needs WebGL. Read about it.

Hourglass: exact shortest paths from both endsOpen the full demo →

What you are looking at

Hourglass is an exact point-to-point shortest-path algorithm by Ian Knowles. From version 1.6.2 it is built into Galactus DB as gdb.shortestPath.hourglass. Eight chapters build it up one idea at a time, then race it against the classics.

Operation counts use the competition harness's rules: queue pushes and pops, edges scanned, distance updates, heuristic evaluations and empty-bucket sweeps.

Things to try

Learn more