Field guide · single-source shortest paths · C-HD (Vals AI, Sept 2026)

Reading the bound with your hands

O( n + m + m·log(2 + m⁄(n+1)) + m⅓·(n·log(n+2))⅔ )

TL;DR. This is the runtime bound for C-HD, a directed shortest-path algorithm that ten Claude Opus 5.5 agents designed and proved in Lean (Vals AI writeup). n is vertices, m is edges. The bound is linear time, plus a penalty that grows with density, plus a cube-root blend of m and n log n. It only holds in a certified range, m ≤ n·⌊⌊log₂n⌋¾⌋; outside that, C-HD hands off to Bellman–Ford. Drag things below to see where each term takes over, where C-HD actually wins, and how far out its headline advantage kicks in.

01

Anatomy of the bound

Pick a graph size and an average degree (edges per vertex, so m = n·d). The bar splits the predicted operation count into its three terms. Hover a term in the formula or the bar to link them.

m = edges · density m/n² = · total ≈ ops

n + m
Read the graph once. Every algorithm pays this.
m·log(2+m/(n+1))
Per-edge cost that grows with average degree. Near-constant when sparse.
m⅓(n log n)⅔
Weighted geometric mean of m and n log n. Sits between them.
Leaderboard at this (n, m) · constants = 1
Algorithm≈ ops× C-HD

Ratios under 1 beat C-HD. Outside the certified range C-HD runs Bellman–Ford, and the table charges it that. BFS only applies to unweighted graphs; it's the floor, not a competitor.

02

Growth race

The y-axis is overhead over linear time: predicted ops ÷ (n + m). A flat line at 1 would be perfect. Everything here is the textbook formula with constants set to 1, so read the shapes and crossings, not the absolute heights.

The headline claim, checked

The writeup's showcase regime is m ≈ n·log¾n, right at the certified edge. There, C-HD's leading term is n·log11/12n versus Dijkstra's n·log n, and the proof is a real asymptotic win. But the whole formula also carries m·log(m/n), which only shrinks relative to the leading term very slowly. Here's the same comparison with every term kept and constants set to 1.

or scroll the zoom-out ↓
Overhead factor versus graph size for shortest-path algorithms
03

The exponent race, 1959 → C-HD

Every bound here fits one picture. Give the graph an average degree of d = logα n, so α = 0 is road-network sparse and α = 1 is where m reaches n log n. Divide each running time by n and what's left is log n raised to some power. That exponent is the y-axis. Lower is faster, and the flat line at 1 is the sorting barrier: the n log n cost of emitting vertices in sorted order. It held for 40 years.

Timeline of shortest-path milestones
Exponent of log n per vertex versus density exponent alpha
Record holder at each density
Which algorithm holds the best bound at each density
Hover the chart to read every bound at one density.
Scope: directed graphs, non-negative real weights, comparisons and additions only, deterministic. That's the setting C-HD and the Duan et al. papers work in. Gray notes on the timeline are landmarks from neighboring settings (integer weights, undirected graphs, randomization) that don't compete on this chart. The y-axis ignores log log factors, and C-HD's line is solid where its Lean proof covers it (α ≤ ¾) and dashed where only its paper argues it. Bellman–Ford and array-based Dijkstra are polynomial per vertex, so they sit off the top.
04

Zoom out to 1054,000

How big does a graph have to get before C-HD's full formula beats Dijkstra's on its own showcase profile? Scroll. Each frame is ten, a hundred, then a thousand times more zeros than the one inside it, because the horizontal scale here is doubly logarithmic. The gauge tracks both comparisons as you go: leading terms only, and every term kept with constants set to 1.

vertices on the certified profile
n ≈ 617
leading terms only
full formulas, constants 1
bar left of the tick = C-HD ahead · right = Dijkstra-Fib ahead

Constants set to 1 are a stand-in. The writeup notes the real constants in C-HD's formal construction are enormous, so the true crossover sits further out than the one you just scrolled to.

05

Who wins where

Every cell is one graph shape: size across, average degree up. Color shows which algorithm's formula is smallest there, or how much faster C-HD is than Dijkstra with a Fibonacci heap (the 1987 champion). The white-space top-left is impossible (more than n − 1 neighbors per vertex). Click a cell to load it into section 01.

Map of which shortest-path bound is smallest across graph size and density
What to notice: C-HD only competes below the dashed certified edge; above it, it hands off to Bellman–Ford and drops out. With constants set to 1, the plain m·log⅔n formula still edges it out at the very sparsest shapes (d below about 2). From there to a degree of about 5 on large graphs, C-HD's formula is the smallest, and the US road network sits in that band. The writeup's showcase regime runs right along the dashed edge, and at every size on this map Fibonacci-heap Dijkstra's formula is still smaller there. Section 02 follows that edge out to the sizes where C-HD finally wins it.
Same map, as a landscape you can orbit

Height is C-HD's advantage: log₂ of (competitor's cost ÷ C-HD's cost). Land above the translucent waterline is where C-HD wins; everything below, it loses. Color is still the overall winner. Turn on the certified range and the ground outside it drops off a cliff (it starts off, so you can see the raw formula first), because there C-HD runs Bellman–Ford. Drag to orbit, scroll or pinch to zoom, tap the terrain to load a point into section 01.

Hover the terrain to read a point.
What to notice: against Dijkstra-Fib there's a long, low ridge above the water along the sparse edge, peaking on the largest graphs. Switch to "best other algorithm" and most of that ridge sinks, because Duan 2025's formula already takes the very sparsest shapes. What's left above water is a thin shelf between an average degree of about 2 and 5, which is where the road-network pin stands.
06

In action: why "sorting barrier"?

Dijkstra finalizes vertices one at a time, in exact distance order, so as a side effect it sorts all n vertices by distance. That sorting is where the n log n comes from. C-HD, like the Duan et al. algorithms before it, gets under that by not insisting on the order: run bounded local searches out from the frontier, charge newly touched vertices against a size limit, and only keep a heap over a thinned-out set of "pivot" vertices that organize the recursion. The right panel shows the band idea (Δ-stepping), which is a simpler cousin of the real algorithm, on the same graph.

Dijkstra

One vertex per round, always the closest unfinished one. Every push and pop is heap comparisons.

rounds
0
relaxations
0
heap compares
0
frontier
0

Band relaxation (Δ-stepping)

Everything within the current band is relaxed together, in no particular order. Wider band means fewer rounds but more redone work.

rounds
0
relaxations
0
redone vertices
0
frontier
0
just processedfrontier (tentative)→finalized, near → faredges; dark lines = shortest-path tree
Try dragging Δ to the far left: the right panel turns back into Dijkstra (one vertex per band). Drag it right: rounds collapse but "redone vertices" and relaxations climb toward Bellman–Ford. The 2025 algorithm lives in the middle on purpose: a few Bellman–Ford steps to shrink the frontier, recursion to keep the bands honest, and a partial-sort heap for what remains.
07

Inside C-HD, step by step

Section 06 showed the general trick: don't insist on sorting. Here is how C-HD does it. Each call takes a frontier, runs one bounded local search per frontier vertex, and stops a search once it has discovered k vertices. Vertices it touches but can't improve still count toward that size limit, as unexplored leaves. Searches that hit the limit become trees whose roots are kept as pivots; searches that run dry finish their small patch on the spot. Only pivots go into the priority structure, and the recursion tree does the rest in bounded batches.

Recursion tree
Recursion tree of calls so far
current callstopped early (B′ < B)finished
bound B
frontier → pivots
relaxations
deleted edges
check vs Dijkstra
in this call's frontiercurrent search (|K| ≤ k)unexplored leafsearch trees★ pivotfinished by a dry search→completed, near → far- - ✕ deleted edge
This is a runnable, scaled-down model of the structure in the C-HD team's paper: FindPivots-HD from its §3.3 (the search loop, leaf counting, contact merges and the permanent edge deletion rule, cited by line as FH.x) inside the bounded recursion it inherits from Duan et al. The parameters are tiny so each step is visible, and the batching and budgets are simplified. It is not the Lean-verified program: that program runs Bellman–Ford on any graph with fewer than 65,536 vertices, so on a graph this size the real C-HD would never start. Every run here is checked against Dijkstra, and this model matched it on 16,000 randomized test graphs.
08

One big heap vs small queues

Same start, same 617 intersections of Savannah's grid, two ways to keep the frontier in order. On the left, Dijkstra's binary heap: every vertex waiting to be settled lives in one structure, and every settle costs a trip down a tree whose height is log of its size. On the right, the C-HD model from section 07: the frontier is thinned to pivots and split into a small queue per recursion level. Underneath, what each one hands back, and in what order.

Both sides advance by share of their own run, so the same slider position means "this far through" for each.

Dijkstra · one binary heap

Every tentative vertex, ordered by distance. The root is always next.

in heap
0
tree height
0
comparisons
0
settled
0

C-HD model · a queue per level

Only pivots and re-queued leftovers get in. Each row is one live recursion level.

in queues
0
largest queue
0
relaxations
0
completed
0
Entries waiting in each structure over the run
What comes out · one sliver per intersection, colored by distance
Dijkstra
C-HD model
→near → fargaps on the lower ribbon separate batches handed back by one call
Dijkstra's ribbon is one smooth gradient because it has to be: it settles vertices in exact distance order, which is a full sort. The lower ribbon only promises which batch a vertex lands in, so inside a batch the order is arbitrary (drawn here by vertex number) and the gradient turns ragged. That missing order is the work C-HD avoids. At this size the price shows too: its queues are smaller on average, but it relaxes more edges than Dijkstra does.
09

Real streets, real wavefront

Same race as section 06, now on actual road networks from OpenStreetMap, baked into this page. One-way streets are honored, so this is a directed graph, which is exactly C-HD's setting. Edge weights are meters of road. Road networks are the showcase for this whole topic: an average out-degree around 2 to 3 puts them in the sparse band where the new bounds bite, if the graph is big enough. Tap the map to move the start.

Dijkstra

Settles the single nearest intersection each round.

rounds
0
relaxations
0
heap compares
0
finalized
0%

Band relaxation (Δ-stepping)

Settles every intersection inside the current Δ-meter band per round.

rounds
0
relaxations
0
redone
0
finalized
0%
Share of intersections finalized over the race
→finalized road, near → farfrontierjust processed
Race by rounds and the band method wins by a mile: fewer sequential steps, which is what you'd parallelize. Race by work (edge relaxations) and the gap mostly closes or flips, because the band redoes vertices whose distances were still settling. The new sub-sorting algorithms try to keep the first benefit without paying the second. Road data © OpenStreetMap contributors, ODbL.
10

Live benchmark, in your browser

Real code on real random directed graphs (weights uniform in (0, 1]). Each run checks that every algorithm returns the same distances. The chart shows nanoseconds per edge: a flat line means linear scaling, a rising line means a log factor is showing up.

Measured nanoseconds per edge versus number of edges
nmDijkstra msΔ-step msBellman–Ford (queue) msBFS msagree
Press "run sweep".
What you'll usually see: at browser-sized graphs, memory access dominates and the log n factor barely registers. That's the honest punchline of this whole topic. The new bounds are asymptotic wins; a 2025 C++ implementation study (Castro et al., arXiv 2511.03007) frames practical utility as still an open question. This page doesn't implement C-HD itself (its Lean construction isn't a practical implementation, and the writeup says it wasn't benchmarked on large graphs); Δ-stepping stands in as the "relax a band without sorting" idea.
11

Fine print

Where the bound comes from. C-HD, from a Vals AI writeup (Sept 20, 2026): ten Claude Opus 5.5 agents coordinating on a message board designed it in about 15 hours and proved correctness and the runtime bound in Lean (proof repo). Directed graphs, non-negative real weights, exact distances. The bound holds for m ≤ n·⌊⌊log₂n⌋¾⌋; outside that the program runs Bellman–Ford. It's a blog post with a machine-checked proof, not yet a peer-reviewed paper.

The +2 and +1. Pure guards. log(2 + …) never drops below 1, and n + 1 never divides by zero. They change nothing asymptotically.

Reference formulas used. Dijkstra binary heap (n+m)log n; Fibonacci heap m + n log n; d-ary heap with d = m/n, 2m·log n / log d; Duan, Mao, Mao, Shu, Yin 2025, m·log⅔n; Duan, Mao, Shu, Yin 2026, m√log n + √(mn·log n·log log n); Bellman–Ford nm; BFS n + m. All logs base 2, all constants 1.

Why constants = 1 matters. Big-O hides constants and the new algorithms have large ones (recursion, pivot finding, block data structures). The crossings in sections 02 and 05 show where the formulas cross, which is a statement about growth, not stopwatch time.

Model assumptions. Directed graph, real non-negative weights, only comparisons and additions on weights. With integer weights on a word RAM, other algorithms (Thorup's linear-time undirected result, for one) change the picture.

Street data. Road snapshots from OpenStreetMap, fetched via the Overpass API in Sept 2026 and contracted to intersections: drivable and pedestrian highway types, one-way tags and roundabouts honored, clipped to a small box, and trimmed to the largest strongly connected piece so every intersection is reachable from any start. © OpenStreetMap contributors, ODbL.

Sources. arXiv 2504.17033 (2025, m log⅔ n) · arXiv 2602.07868 (2026 improvement) · arXiv 2511.03007 (implementation study).