arXiv:2609.04825cs.DSSep 2026

Manuscript Offprint

arXiv:2609.04825

Beyond Distance Ordering: Resource Complexity and Universal Optimality of Exact Labeled Directed Shortest Paths

Bin Cai

Abstract

We study exact single-source shortest paths when the output is only the materialized labeled distance vector (DIST), rather than a distance order. In the full deterministic comparison-addition model, the minimum worst-case number of additions on every fixed directed topology is exactly the maximum number ρfwd\rho_{\mathrm{fwd}} of forward nonsource endpoint classes over rooted vertex orders; the lower bound permits adaptive control, literals, and arbitrary mixed sums. This arithmetic law aligns with the comparison optimum on DAGs, where the full resource region is an exact rectangle. Cycles destroy that alignment: a two-spoke shared-hub graph has coordinatewise optima (4,2)(4,2) but requires five comparisons at the two-addition budget. Its kk-spoke extension forces klog⁡2k+O(k)k \log_2 k + O(k) comparisons at the addition optimum and has an entropy-tight deterministic tradeoff Ck+r∗(Hk)=Θ(k+Λk,r)C_{k+r}^*(H_k) = \Theta(k + \Lambda_{k,r}), where Λk,r=log⁡2(k!/[r!(r+1)k−r])\Lambda_{k,r} = \log_2(k!/[r!(r+1)^{k-r}]), with leading constant one when Λk,r/k→∞\Lambda_{k,r}/k \to \infty. Because the two coordinatewise minima need not belong to one program, these conflicts lead to the same-program benchmark OPTDIST=inf⁡Asup⁡w(CA(w)+PA(w))\mathrm{OPT}_{\mathrm{DIST}} = \inf_A \sup_w (C_A(w) + P_A(w)). An exact transcript-cone game yields one uniform interpreter whose charged addition-comparison cost equals OPTDIST\mathrm{OPT}_{\mathrm{DIST}} on every topology; its optimal actions are synthesizable in polynomial space but may require exponential time. Finally, an active-core reduction and the current deterministic directed-SSSP bound give an efficient uniform O(OPTDISTlog⁡(2+OPTDIST)log⁡log⁡(4+OPTDIST))O(\mathrm{OPT}_{\mathrm{DIST}} \sqrt{\log(2 + \mathrm{OPT}_{\mathrm{DIST}})} \log \log(4 + \mathrm{OPT}_{\mathrm{DIST}})) charged-operation bound. Thus optimal numerical policies exist uniformly, while efficient constant-competitive navigation remains open.

1 Introduction

Shortest paths admit several output contracts. A program can return the labeled numerical vector, a nondecreasing order of vertices, or a tree of witness paths. These outputs are related, but they need not have the same numerical complexity. This paper isolates

DIST(G,s)=(d(s,v))v≠s,\mathrm{DIST}(G,s)=\left(d(s,v)\right)_{v\neq s},

with every coordinate held in an actual numerical register. No settlement order or path witness is requested. Recent directed-SSSP algorithms below the sorting barrier already make this distinction algorithmically relevant [DMM +^{+}25, DMSY26]; universal-optimal Dijkstra results, by contrast, benchmark the order-producing task DO [HHR +^{+}24, vdHRR25].

A common-suffix example makes the output boundary literal: two comparisons determine all labeled distances, while producing their order requires Θ(nlog⁡n)\Theta(n \log n) comparisons (section O). Our central question is therefore:

If the output is only the exact labeled distance vector, what numerical resources are intrinsically necessary, and can one uniform algorithm match the best topology-specialized program?

We answer this in the deterministic comparison-addition (CA) model. A program may adaptively compare any two held registers and may add any two held finite values. It may reuse registers, form mixed non-path sums, use repeated operands and finitely many real literals, and share intermediate values among output labels. Copying and discrete control are free, but an output value must be materialized. The topology is fixed for a specialized program; arc weights range over all nonnegative reals.

Exact arithmetic. Our first result characterizes the addition coordinate on every topology. For a rooted order of the vertices, count the nonsource endpoint classes directed forward, and let ρfwd(G,s)\rho_{\mathrm{fwd}}(G,s) be the maximum count. Then

P∗(G,s)=ρfwd(G,s).P^{*}(G,s)=\rho_{\mathrm{f w d}}(G,s).

Endpoint-class Dijkstra attains the value uniformly without computing the NP-hard parameter. The content is the lower bound: it applies to arbitrary adaptive mixed-sum programs, rather than merely counting relaxations in a particular shortest-path algorithm. A generic potential-and-slack input, the full path-difference kernel, and a projected fiber-opening argument force one addition per forward endpoint class.

Acyclic alignment, cyclic conflict. On a reachable DAG with nn vertices, mm primitive arcs, qq endpoint classes, and dsd_{s} source-out classes, the entire resource region is

R(G,s)={(c,p):c≥m−n+1, p≥q−ds}.\mathcal{R}(G,s)=\{(c,p):c\geq m-n+1,~p\geq q-d_{s}\}.

Thus the two resources align perfectly in the acyclic case. We use this as the baseline, not as the endpoint of the paper.

A minimal active cycle already breaks the rectangle. For the two-spoke shared-hub graph H2H_{2},

C∗(H2)=4,P∗(H2)=2,C2∗(H2)=5.C^{*}(H_{2})=4,\qquad P^{*}(H_{2})=2,\qquad C_{2}^{*}(H_{2})=5.

The first two values are coordinatewise optima, yet no program attains both. The last inequality follows from a mathematical reduction to eight strict cells and a finite exhaustive coefficient-state certificate. We state this computer-assisted boundary explicitly and provide a deterministic verifier.

Endogenous sorting and its tradeoff. The graph HkH_{k} repeats the spoke around one hub. It still requests only labeled DIST, and P∗(Hk)=kP^{*}(H_{k})=k, but an addition-optimal program must distinguish kk! scale-separated spoke orders:

⌈log⁡2(k!)⌉≤Ck∗(Hk)≤S(k)+2k,\lceil\log_{2}(k!)\rceil\leq C_{k}^{*}(H_{k})\leq S(k)+2k,

where S(k)S(k) is the optimal pairwise-sorting comparison count. Hence Ck∗(Hk)=klog⁡2k+O(k)C_{k}^{*}(H_{k})=k\log_{2}k+O(k) while C∗(Hk)=Θ(k)C^{*}(H_{k})=\Theta(k). This is endogenous sorting in the information sense. We do not claim that arbitrary aggregate comparisons can be converted one-for-one into pairwise key comparisons.

The full interpolation exposes the mechanism. Set

Fk(r)=Ck+r∗(Hk),Λk,r=log⁡2k!r!(r+1)k−r(0≤r≤k).F_{k}(r)=C_{k+r}^{*}(H_{k}),\qquad\Lambda_{k,r}=\log_{2}\frac{k!}{r!(r+1)^{k-r}}\quad(0\leq r\leq k).

We prove

∣Fk(r)=Θ(k+Λk,r)∣\left|F_{k}(r)=\Theta(k+\Lambda_{k,r})\right|

uniformly, with leading constant one on the entropy term whenever Λk,r/k→∞\Lambda_{k,r}/k \to \infty. The lower bound is causal. After tt additions at most tt disjoint spoke pairs can be exposed. If the pair in position ss is still hidden after s+rs+r additions, a synchronized threat makes that pair essential to k−s+1k-s+1 distinct outputs although only k−sk-s additions remain. The resulting deadline allows at most r!(r+1)k−rr!(r+1)^{k-r} permutations per transcript. For the upper bound, deterministic multiple selection produces ordered blocks of width r+1r+1, and a rolling computation spends a second addition only inside the crossing block. The standard deterministic multiple-selection theorem contributes a lower-order entropy term; we therefore do not claim a uniform additive-O(k)O(k) formula.

The same-program benchmark. The cyclic tradeoff is also the bridge to universal optimality: it shows that the topology-specific comparator must price one program, not assemble a fictitious algorithm from separately optimized coordinates. In particular, the H2H_{2} nonrectangle rules out C∗+P∗C^{*} + P^{*} as a measure of total numerical work because the two minima may belong to different programs. We therefore define

OPTDIST(G,s)=inf⁡Asup⁡w≥0(CA(G,s,w)+PA(G,s,w)).\mathrm{O P T}_{\mathrm{D I S T}}(G,s)=\inf_{A}\sup_{w\geq0}\bigl(C_{A}(G,s,w)+P_{A}(G,s,w)\bigr).

Both resources are charged to one execution of one program. This is the benchmark for universal optimality throughout the paper.

No numerical uniformity tax. We characterize OPT_{DIST} by a transcript-cone game. A state records the homogeneous coefficient vectors of held registers and the physical comparison outcomes seen so far. Those outcomes define a cone of consistent inputs. A state is terminal only when every label has one fixed held register that is correct throughout the entire cone. Addition and comparison moves reproduce the physical program model exactly. We prove

WING({0,e1,…,em},∅,K)⟺OPTDIST(G,s)≤K.\mathrm{WIN}_{G}(\{0,e_{1},\ldots,e_{m}\},\varnothing,K)\Longleftrightarrow\mathrm{OPT}_{\mathrm{DIST}}(G,s)\leq K.

A canonical minimax policy therefore gives one uniform interpreter UpspaceU_{pspace} satisfying

TUpspace(G,s)=OPTDIST(G,s)T_{U_{\mathrm{p s p a c e}}}(G,s)=\mathrm{O P T}_{\mathrm{D I S T}}(G,s)

for every topology. The interpreter reconstructs topology-specific optimal actions from the graph; they are not nonuniform advice. Its state and depth-first policy search use polynomial space, but the ordinary time between charged operations may be exponential. Exact numerical universal optimality is settled; efficient navigation is not.

The efficient boundary. A canonical active-core reduction deletes dominator-inactive arcs, reduces source-parallel classes, and retains only endpoints of active nonsource arcs. If k is the number of those arcs and σ\sigma is the source-class reduction cost, then

∣V(H)∣≤2k+1,∣E(H)∣≤3k,σ+k≤2OPT⁡DIST⁡(G,s),|V(H)|\leq2k+1,\quad|E(H)|\leq3k,\quad\sigma+k\leq2\operatorname{O P T}_{\operatorname{D I S T}}(G,s),

and

OPTDIST(H,q)≤OPTDIST(G,s)≤σ+OPTDIST(H,q)≤2OPTDIST(G,s).\mathrm{OPT}_{\mathrm{DIST}}(H,q)\leq\mathrm{OPT}_{\mathrm{DIST}}(G,s)\leq\sigma+\mathrm{OPT}_{\mathrm{DIST}}(H,q)\leq2\mathrm{OPT}_{\mathrm{DIST}}(G,s).

Combining this same-input charge with the current deterministic directed-SSSP algorithm of Duan, Mao, Shu, and Yin [DMSY26] gives one explicit efficient uniform algorithm using

O(OPTDISTlog⁡(2+OPTDIST)log⁡log⁡(4+OPTDIST))O\left(\mathrm{OPT}_{\mathrm{DIST}}\sqrt{\log(2+\mathrm{OPT}_{\mathrm{DIST}})\log\log(4+\mathrm{OPT}_{\mathrm{DIST}})}\right)

charged operations after linear topology preprocessing.

Resultstatement typeuniformitycomputation status
P∗=ρfwdP^* = \rho_{\mathrm{fwd}}exact, all topologiesuniform upperefficient
DAG rectangleexact baselineuniformefficient
H2H_2 nonrectangleexactfamily-specificlower endpoint computer-assisted
HkH_k lawentropy-tight asymptoticconstructive upperefficient
Transcript-cone theoremexact, all topologiesratio onePSPACE, possibly exponential
Active-core liftingsublogarithmic factoruniformefficient

Table 1: The theorem hierarchy and scope. “Exact” refers to charged numerical operations, not ordinary running time.

Organization. Section 2 fixes the output contract and program model. Sections 3 and 4 give the exact arithmetic law and its acyclic control case. Sections 5 and 6 develop cyclic conflict, endogenous sorting, and the Pareto law. Sections 7 and 8 introduce OPTDIST and prove the transcript-cone equivalence. Section 9 locates the efficient boundary. Detailed proofs and reproducibility material follow in the appendices.