Deterministic APSP in time on a word RAM
ProvedLight.Sec3.apsp_299791All-pairs shortest paths on directed graphs with integer weights and no negative cycles can be solved deterministically in time on a word RAM with -bit words:
The problem. An instance of size is a directed graph on the vertices given by a partial weight function : is the weight of the edge , or undefined if there is no such edge. Instances have no negative cycle: every closed path has total weight at least . The input is the adjacency matrix followed by the weight matrix (with where there is no edge), both row by row. The output has two cells for every pair : the flag followed by the distance (the weight of a path from to that is at most the weight of every such path) if is reachable from , and the flag otherwise.
The machine and the time bound. means: for every there are a program of the word RAM, a number and a function with (precisely, for some and all ) such that on every instance of every size whose input numbers have absolute value at most , and for every word size , the program halts within steps, accepts, and leaves the correct output in the cells right after the input. The word RAM has nine instructions (write the constant ; add, subtract or multiply modulo ; load; store; jump if negative; accept; reject); there is no division, no shift, no bitwise operation and no randomness.
The bound improves the deterministic exponent of Theorem 22 of Alman and Vassilevska Williams. The algorithm saves , so ; the margin absorbs the polylogarithmic factors.
This is the library form of the campaign goal TrulySubcubicAPSP.apsp_bound_299791; the platform node TrulySubcubicAPSP.sourceSpecificationTransport carries it over to the campaign's own definitions.
Formalization Note APSP and Problem.SolvedInTime are those of the namespace EndStatement (the library file EndStatement.lean, on the platform the definition TrulySubcubicAPSP_SourceSpecification); the exponent is the rational numeral .
/- Copyright (c) 2026 Anthropic, PBC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. SPDX-License-Identifier: Apache-2.0 -/ -- Generated by skeleton subtraction from the ThreeSumApsp library at commit 27a2fa4bab32. import Definitions.Def_APSP299791_Defs5 set_option autoImplicit false set_option relaxedAutoImplicit false open Light open Light.Sec3 open ThreeSumApsp ThreeSumApsp.WordRam
theorem Light.Sec3.apsp_299791 : EndStatement.APSP.SolvedInTime (2.99791 : ℚ) := by sorry