Problem
Shortest paths is a extremely uncomplicated problem. There is a chart of vertices and (possibly directed) edges that nexus them. Each border has a genuine figure weight. Starting from several vertex, for all another vertex in the chart you desire to discover the minimum total importance of a path, or study that it is unreachable.
In the type I considered, the chart was directed, I required exact answers and was stated non-negative genuine weights for the edges.
I assume that genuine figure weights can be compared and added. Any operations the shortest way algorithm does internally (such as counting how many nodes are visited or storing distances on intermediate vertices) counts towards operating time.
With this setup, the traditional Dijkstra’s shortest way algorithm runs in O(m+nlogn)O(m+n\log n) time, anywhere n≥2n \ge 2 is the figure of vertices and mm is the figure of edges in the input graph. This is achieved using a suitable precedence queue data structure, specified as a Fibonacci heap. For m≥nm\ge n, another deterministic algorithms accomplish O(mlog2/3n)O(m \log^{2/3} n), archetypal introduced in this 2025 breakthrough paper, and O(mlogn+mnlognloglogn)O(m \sqrt{\log n} + \sqrt{mn \log n \log\log{n}}) (this 2026 prosecute up).
Given these bounds, there’s a broad area of the indicator area for mm as a function of nn anywhere Dijkstra is better. So I welcomed my agents to fig out what’s imaginable if the weights were non-negative reals, and to demonstrate correctness and effectiveness using Lean, the ceremonial verification tool.
Solution
After concerning 15 hours and 733 messages on the communication board, the squad had completed a projected new algorithm for finding exact shortest-path distances in the directed chart setting. This algorithm, called C-HD, is presented in this Lean proof.
The algorithm handles local hunt which encounter unproductive edges fairly well. It motionless uses precedence comparisons, but a newly encountered vertex can figure towards a search’s size bounds as an unexplored leaf. The algorithm maintains local invariants (rules that remain true following all update), alongside careful border deletion and a bounded local search. This enables it to accomplish this border inside its certified range:
O (n+m+mlog (2+mn+1)+m1/3(nlog(n+2))2/3).O\!\left(n+m+m\log\!\left(2+\frac{m}{n+1}\right)+m^{1/3}\bigl(n\log(n+2)\bigr)^{2/3}\right).where n≥2n \ge 2 is the figure of vertices in the input chart and mm is the figure of edges. The certified range is m≤n⌊⌊log2n⌋3/4⌋m\le n\lfloor\lfloor\log_2 n\rfloor^{3/4}\rfloor. For this analysis, I additionally add overhead of allocating memory, sorting edges, study the input graph, and outputting results.
An intuitive clarification of why C-HD has a improved border than Dijkstra or the listed SOTA algorithms in the applicable administration is that it reduces repeated hunt and data-structure work. The idea is:
- Start from the origin and the current frontier of vertices.
- Run bounded local searches alongside outgoing edges.
- Count newly encountered vertices towards the hunt limit, including unexplored leaves whenever an border does not enhance a extend estimate.
- Use the resulting hunt trees and pivots to arrange the recursive work.
This deterministic procedure limits repeated work. The algorithm C-HD implements carefully handles local invariants so that equal if it revisits the identical endpoint/vertex a few times, repeated handling can be bounded. In this way, C-HD achieves a improved border on total activity in the stated regime, equal although it doesn’t cognize the command of visiting vertices beforehand. It motionless says the complete input graph.
Note the algorithm relies on sorted outgoing-edge lists, which it constructs as part of its own charged preprocessing. To grip small inputs and inputs exterior the certified density range, the agents added a distinct algorithm, Bellman–Ford, alongside the O((n+1)(m+1))O((n+1)(m+1)) runtime bound, selected at the commencement of the execution. Bellman–Ford is not a type of Dijkstra.
Below I display an excerpt from the theorem that was proved, alongside alongside the genuine runtime mark achieved.
-- From namespace Frontier.CHD.Final: theorem chd_CHDTarget : GateCTarget.CHDTarget GateCCalc.F := ⟨chdProgram, chd_exact_within.1, bodyC KcC + 65536 * 9 + 100, chd_exact_within.2⟩ theorem chd_gateC : Frontier.GateC := GateCTarget.chdTarget_F_imp_gateC chd_CHDTarget
C_HD_bound, inside the certified range: O(n + m + m * log(2 + m/(n+1)) + m^(1/3) * (n*log(n+2))^(2/3))
To difference against previous work, let’s appearance at graphs alongside approximately m=nlog3/4nm = n \log^{3/4} n edges. The runtime border for Dijkstra is O(nlogn)O(n \log n); the C-HD algorithm gets O(nlog11/12n)O(n \log^{11/12} n). Though this seems akin a insignificant improvement, it method that I’ve achieved a improved asymptotic high border as these graphs grow.
For instance, if n=21000n = 2^{1000}, the proportion of the foremost expressions nlog2nn\log_2 n and n(log2n)11/12n(\log_2 n)^{11/12} is 10001/12≈1.781000^{1/12}\approx1.78, ignoring constants and lower-order terms. This is not a measured speedup. This betterment scales polylogarithmically alongside the input size: squaring nn multiplies that proportion by 21/122^{1/12}.
Actual Performance
Of course, this is motionless lone an high border of the complexity — a mathematical promise. It may be that equal although the algorithm is theoretically improved in this regime, it volition really execute worse whenever run. For this run, I ran small correctness simulations but did not benchmark the implementation on ample genuine graphs. Based on my analysis, the method has a improved asymptotic border than the listed previous limits in the proved regime. The constants in the ceremonial building are enormous, so this does not established a applicable speedup.
Formal Verifications
I additionally successfully verified a border on the achievement of the algorithm inside the certified range:
O(n + m + m * log(2 + m/(n+1)) + m^(1/3) * (n*log(n+2))^(2/3))
which simplifies to O(nlog11/12n)O(n\log^{11/12}n) alongside the overview m≈nlog3/4nm\approx n\log^{3/4}n.
I checked the evidence using the Lean Comparator tool. The Lean evidence establishes the runtime border and a strict asymptotic betterment complete nlognn\log n alongside the stated density profile. Substituting that overview into the published limits additionally shows that the border is smaller than mlog2/3nm\log^{2/3}n and mlogn+mnlognloglognm\sqrt{\log n}+\sqrt{mn\log n\log\log n}.
The Comparator checks that the submitted evidence proves the stated theorem, uses lone permitted axioms, and is accepted by Lean’s kernel. This helps justify the ceremonial achievement justify matches the stated target.
How much betterment does C-HD deliver?
If you’re thinking, “but how much period volition this really save?”, here’s what the evidence establishes:
Along the overview m≈nlog3/4nm\approx n\log^{3/4}n, the proportion of the foremost border expressions is (logn)1/12(\log n)^{1/12}. The evidence does not provision measured runtimes or exact repeat counts for graphs alongside a trillion vertices. When m=10nm = 10n, the chart is in a distinct density regime, and this outcome does not established an betterment complete the finest known limits there.
Elicitation
If OpenAI’s Hugging Face event and its Navier–Stokes outcome have taught me anything, it’s that agents can dramatically compress the period it takes to create advancement on a problem. And one uncomplicated way to get agents to activity together is to provision them a way to conversation to all other, ie a communication board.
What I did current was spawn 10 Claude Opus 5.5 agents at maximum attempt and provision them a uncomplicated communication board. They had first roles, but could reorganize their work, portion discoveries, difficulty all other’s ideas, and change attempt toward whichever method looked most promising.
I gave them slightly of a lengthy immediate explaining exactly what I was looking for: a significant theoretical betterment for exact shortest paths on directed graphs alongside non-negative genuine weights, backed by a complete Lean proof. They could prosecute multiple directions: eliminate logarithmic factors, discover a improved exponent, discover a linear-time algorithm, or demonstrate a essential lesser border on what any algorithm could achieve.
Lastly, I additionally asked them to difference their outcome against the latest papers, document unsuccessful approaches so another agents wouldn’t reiterate them, and difficulty all other’s claims. Before declaring success, they needed a reproducible Lean build and two distinct equal reviews. If they couldn’t demonstrate an improvement, they were told to maintain the partial advancement and say what remained unresolved.
It’s fascinating what a squad of agents can do. A nation of geniuses in a datacenter; That prediction wasn’t too far off.
The complete evidence bundle (Lean sources, informal paper, and verification records) is accessible at github.com/spicylemonade/c-hd-proof.