Compact Routing Explorer

Thorup-Zwick, stretch 3, name-dependent

Each node stores a routing table of only about √n log n entries, not the full n. Routing uses only those tables and the target's label, yet the path taken is never more than 3× the true shortest path. Pick a source and a target below and watch the route build hop by hop.

Click a node to set the source
Group A (landmark) Cluster of source Source Target Routed path Shortest path
Vertices
-
n
Group A
-
landmarks, ~√n
Avg table size
-
entries / node
Stretch
-
routed / shortest

How it works. A random set A of landmarks is sampled, each node with probability 1/√n. Every node knows its nearest landmark (its centroid) and keeps a routing-table entry for every landmark and for every node in its cluster (the nodes closer to it than to their own landmark). A target's label carries its centroid and the first hop out of it. If the target is a landmark or sits in the source's cluster, the route goes straight there; otherwise it detours through the target's landmark. That single detour is what bounds the stretch at 3.