Manuscript Offprint
arXiv:2610.20297Simple, Faster (min, +) Matrix Multiplication and APSP
Abstract
In this note, we provide a deterministic algorithm that computes the (min, +)-Matrix Product of two matrices and with polynomially bounded integer entries in time, improving upon the exponent of time obtained in the recent breakthrough by Anthropic (Alman and Vassilevska Williams, 2026). Our algorithm uses a phased approach first proposed by Bringmann, Grandoni, Saha, and Vassilevska Williams in 2016. The phased approach produces an approximation of in truly subcubic time such that the number of remaining triples is truly subcubic. This provided strong evidence that a truly subcubic (min, +)-Matrix Product and therefore, a truly subcubic algorithm for All Pairs Shortest Paths (APSP) may exist. However, to find the remaining triples in subcubic time, a sparse certificate is needed whose construction was not known. We use the thin matrix product theorem of the recent breakthrough to provide such a certificate. This gives a simple modular subcubic algorithm for APSP.
Supported by NSF HDR TRIPODS Phase II grant 2217058 (EnCORE Institute).
1 Introduction
All-Pairs Shortest Paths (APSP), which asks given an N-vertex graph to compute the distance between all pairs of vertices, is one of the central problems in fine-grained complexity. Classical algorithms for APSP, such as the Floyd–Warshall algorithm, achieve a running time. A long series of works (e.g. [Fre76, Dob90, Tak92, Tak98, Han04, Pet04, Zwi04, Cha05, Han06, Cha10, HT12]) improved sub-polynomial factors over the classic running time, culminating in an algorithm by Williams [Wil18] with running time. Very recently, a major breakthrough by Anthropic (see Alman and Vassilevska Williams [AV26]) gave the first truly subcubic algorithm for APSP, falsifying one of the central hypotheses in Fine-Grained Complexity, obtaining a deterministic algorithm in time (see also the simplified exposition due to Karingula and Lovett [KL26] that achieves for some ). [AV26] also obtain a Las Vegas algorithm running in expected time for real-valued APSP. In light of this breakthrough, one might naturally expect further improvements to the APSP exponent.
In this note, we give a simple improvement to the exponent of APSP, via a faster algorithm for computing the Product of two matrices. The product of two matrices , defined , is a useful primitive in algorithm design, and is known to be equivalent to APSP up to polylogarithmic factors [VW18]. Our first result is an improved randomized algorithm.
Theorem 1.1. There is a Las Vegas algorithm computing the -product of two matrices with polynomially bounded integer entries in expected time .
Using known reductions, this also gives faster algorithms for many problems equivalent to (min, +)-Matrix Multiplication, including APSP, Negative Triangle, Replacement Paths, Second Shortest Simple Path, Metricity, (min, +)-Verification [VW18], Weighted Tree Edit Distance [BGMW20, NPS+25], and 2D Maximum Subarray [TT00, BDT16].
Our algorithm uses a modular approach to tackle the product in subcubic time, first proposed by Bringmann, Grandoni, Saha, and Vassilevska Williams [BGSV19], and subsequently refined and modified in [GPVX21, CDXZ22, JPSX26]. In [BGSV19], the very first step of the algorithm is to provide an additive approximation of C by recursively scaling and rounding. This additive approximation is used to perturb the entries of A and B so that many entries of A and B become small. This enables computation of fast product over those small entries via fast matrix multiplication [AGM97]. Surprisingly, as [BGSV19] shows after the perturbation, only a subcubic number of witnesses, triples which can contribute to C, are left: this provided a promising route towards refuting the APSP conjecture.
In order to complete this framework and obtain truly subcubic APSP, one needs a sparse certificate to find those remaining triplets. The works of [BGSV19, GPVX21, CDXZ22, JPSX26] show such sparse certificate exists for various structured matrices such as bounded difference and monotone matrices. Subsequent work [GPVX21, CDXZ22, JPSX26] combine the perturbation and sparse certification steps through modular arithmetic over primes.
We develop on the modular approach of [BGSV19, GPVX21, CDXZ22, JPSX26] and utilize Theorem 25 of the recent breakthrough [AV26] to provide a sparse certificate in truly subcubic time without any structural assumptions. This leads to a slightly better running time, and a significantly simpler, easy to understand algorithm. We state Theorem 25 of [AV26] below.
Theorem 1.2 (Theorem 25 of [AV26]). For every and every there is a such that the following holds. Given as input matrices and , where , whose entries are integers of absolute value at most , as well as a set of at most positions of an matrix, the entries , can be computed deterministically in time .
To invoke Theorem 1.2, we divide the matrices A and B into blocks and for each block, design a family of new matrices X and Y satisfying the properties of Theorem 1.2 such that computing relevant entries of helps us certify whether a given block of A and B is a candidate in which we ought to look for a witness. We stop whenever the first witness is obtained. Our second result shows that the same exponent can be achieved deterministically.
Theorem 1.3. There is a deterministic algorithm computing the -product of two matrices A, B with polynomially bounded integer entries in time .
For the sake of simplicity, we present our randomized algorithm in its entirety, and then present the deterministic algorithm separately. We leave as an interesting future direction to further improve the exponent of Matrix Multiplication, e.g. by improving the running time of thin matrix product, or to extend our improvements to real-valued matrices.
Ongoing Work. The main goal of this note was to give a simplified, modular approach to (min, +) Matrix Multiplication and APSP, and to contextualize the new breakthrough through existing frameworks, thereby facilitating a better intuitive understanding. Any improvement in exponents is a byproduct of that. After prompting ChatGPT with our algorithm, it has suggested further improvements of the running time, as well as extending exponent improvements to real-valued matrices using known reductions [CVX22], Lemma 37 of [AV26] and re-optimizing the parameters. We are trying to understand if these improvements fit within our simple framework.
Statement on AI Usage. For the randomized algorithm, we used publicly available ChatGPT Pro for verification of our approach, optimization of parameters and for numerical calculations. The subsequent ideas for the deterministic algorithm are due to ChatGPT Pro with mild supervision. We have evaluated all proposed arguments, and refined the proof and exposition of the claimed results. The paper was written by the authors, and we take full responsibility for the final manuscript.
Theorem 2.1 (Prime Number Theorem). Let denote the number of primes at most x. The prime number theorem states that
As a corollary, for any sufficiently large integer R, the number of primes in the interval is
3 Faster (min, +) Matrix Multiplication
We present the proof of Theorem 1.1.
Proof of Theorem 1.1. By a standard reduction (e.g. shifting all entries by a large constant), we may assume that every input value is a positive integer. We follow the framework of previous algorithms for Bounded Difference and Monotone (min, +) Matrix Multiplication.
Step 1: Reduction to Verification via Additive Approximation. First, by a standard reduction (see e.g. Section 4.1 of [JPSX26]), we observe that it suffices to reduce to the following witness finding problem.
Definition 3.1. Given , the -Witness Equality problem asks to check for all , whether there exists such that .
Lemma 3.2 (Tight Reduction to Verification). Suppose (min, +)-Witness Equality can be computed in time whenever A, B have entries in [U] and C has entries in [2U]. Then the (min, +)-Product of two integer matrices with entries in [U] can be computed in time
We defer the proof of Lemma 3.2 and focus on providing an algorithm for (min, +)-Witness Equality. The idea is essentially that from , we can obtain a +2-approximation of . Then, invoking the oracle for (min, +)-Witness Equality times, we can check all 3 possible values of for each . We say is accurate if there exists such that . By Lemma 3.2, it suffices to check for whether every pair is accurate.
Step 2: Finding a Sparse Certificate. In this step, our goal is to efficiently prune triples for which . Fix parameters whose values we will determine later and let for some sufficiently large constant. Split the inner dimension into contiguous blocks of size . A block is a block witness for output pair if there exists such that . Since are disjoint and cover , observe that is accurate if and only if there is a block witness .
To find block witnesses efficiently, we begin by finding a set of candidate witnesses. Let be a prime. For a block and prime , we say is a candidate block witness with respect to for if there exists satisfying
We have the following claim.
Claim 3.3 (Candidate Block Witness). Fix . If is a block witness, then is a candidate block witness with respect to for any choice of prime .
Let be a randomly sampled prime. If is not a block witness, then is not a candidate block witness with respect to with probability over the choice of .
Proof of Claim 3.3. The first claim is trivial, so we focus on the second. Since is not a block witness, for define
Note that so that has at most prime factor in the range . By the prime number theorem, there are primes in the range so that for a random choice of prime , the probability that is at most
A union bound ensures that for any with probability at most . By our choice of , the probability can be upper bounded by .
This motivates the following approach: sample primes independently in the range . We say K is a candidate block witness if K is a candidate block witness with respect to all sampled primes p. Any block that is a block witness will be a candidate block witness, whereas any block that is not a block witness will be a candidate block witness with inverse polynomial probability. Our first goal is to generate candidate block witnesses algorithmically. To do so, we give a subroutine that given block K and prime p, checks whether K is a candidate block witness with respect to p.
Lemma 3.4 (Candidate Block Witness Verification). Let be a block and be a prime. For every and every there is a such that the following holds.
If , there is an algorithm that decides for every pair whether is a candidate block witness with respect to for in time
Proof of Lemma 3.4. Here, we will use the Theorem 1.2, restated below.
Theorem 1.2 (Theorem 25 of [AV26]). For every and every there is a such that the following holds. Given as input matrices and , where , whose entries are integers of absolute value at most , as well as a set of at most positions of an matrix, the entries , can be computed deterministically in time .
Note that since is the output size, we must have . We begin with the algorithm.
Verify Candidate Block Witness.
-
For , let .
-
For , construct boolean matrices with entries
(X can be constructed once as it does not depend on r.)
-
For , compute for .
-
For and , return .
We begin with correctness. For any pair ,
The first equality follows by definition of the matrix product. The second equality follows by . The third equality follows by the fact that for exactly one value of . Thus, is a candidate block witness with respect to for if and only if , establishing correctness.
To bound the running time, fix and examine the shape of and . Note that has dimension , has dimension and both can be constructed in linear time. Thus, in order to apply Theorem 1.2, we require . Furthermore, if , we can partition into disjoint subsets of size at most . Applying Theorem 1.2 to each disjoint subset, the total time to compute all for all over all is therefore
Constructing X requires time, while constructing over all requires time. Finally, note that the remaining steps requires time.
Step 3: Verifying the Sparse Certificate Given Lemma 3.4, we present our algorithm for (min, +)-Witness Equality. In this final step, we search all candidate block witnesses and check if they are true block witnesses. As discussed, we begin by sampling random primes and generating all candidate block witnesses for every pair .
Generate Candidate Block Witnesses
-
Sample random primes independently in the range .
-
Using Lemma 3.4, verify for every pair and block K, whether K is a candidate block witness with respect to all sampled primes. Return K is a candidate block witness if and only if yes.
Correctness of the above procedure follows by the correctness of Lemma 3.4 and the definition of candidate block witnesses. The time required over all blocks K and primes p is
For a pair , let denote the set of candidate block witnesses. In the second phase, we test whether a candidate block witness is a block witness. We use the following algorithm for every pair .
Verify Block Witnesses
-
For each candidate block witness enumerate and check .
-
If any check succeeds, return is accurate and terminate.
-
If no check succeeds, return is inaccurate.
Correctness of the algorithm follows from the fact that Claim 3.3 implies that every block witness is a candidate block witness. Thus, if is accurate, we will eventually iterate over a block witness in and enumerate the witness such that . On the other hand, if is not accurate, no check will succeed.
To bound the running time, we separately bound the time required to process block witnesses and false candidates (i.e. candidate block witnesses that are not block witnesses). Since we terminate after any successful check, we process at most 1 block witness for every pair , resulting in total time to process all block witnesses. To bound the time required to process false candidates, we bound the total number of false candidates. From Claim 3.3, a block that is not a block witness is a candidate block witness with probability at most . Since there are pairs and blocks per pair, the total number of false candidates is in expectation at most , resulting in expected time to process all false candidates. Overall, the expected runtime of our algorithm is
Recall that we require , so that minimizing subject to this constraint, the running time is
Setting and simplifying (e.g. recalling ), we obtain the running time
From Table 2 of [AV26], we instantiate the constants as , , and . Then, note that so that it suffices to balance
Subject to the constraint and , we set for some sufficiently small constant. Since Theorem 1.2 requires that and which we have chosen to be , the running time is
We prove the remaining required reduction to (min, +)-Witness Equality for completeness. The proof is essentially identical to [JPSX26], with the only change being that the input and output matrices are not required to be monotone.
Proof of Lemma 3.2. We recurse on the value of . In the base case where , return for all .
Then, suppose . Without loss of generality, suppose is a power of 2. We begin by constructing matrices as follows
and recursively compute . It is easy to see that have values in .
Let . For every triple , observe that
Taking minima over k yields
for every pair . Thus, .
For each run the (min, +)-Witness Equality algorithm with candidate matrix since . For every , return the smallest for which the (min, +)-Witness Equality algorithm reports that there exists such that
Note that this algorithm is correct since , so that the minimum value with a witness must be the true value of the product.
Let denote the time required to compute the product of two matrices with entries in . By the master theorem, the total time required is
3.1 Derandomization
Next, we discuss how to derandomize Theorem 1.1.
Proof of Theorem 1.3. Observe that in the proof of Theorem 1.1 the only randomization required is to sample primes in Step 2, finding a sparse certificate. We discuss how to choose these primes deterministically below. To exploit the resulting sparsity, we search the candidate blocks depth-first and stop after finding the first witness for each output pair. We use the data structure version of Theorem 1.2 (see Corollary 31 of [AV26]), with parameters depending on the level, to answer the queries made by this search.
Fix parameters whose values we will determine later. We may assume and that is a power of two. We begin by splitting the inner dimension into contiguous blocks of size at most . We call these blocks level-0 blocks, and denote one such block by . At level , each level-0 block is split into at most contiguous blocks of size at most . Note that . We let denote a level- block and let denote the last level that we search. As before, we say that is a block witness for if there exists such that . For each triple , define , so that we are looking, for each , for some such that .
Let us begin by recalling the properties required by the randomized algorithm. Let denote all primes between . Consider some prime . We say a block is a candidate block witness for with respect to if there exist such that , and is a false candidate if it is a candidate block witness but not a block witness. Following the proof of Claim 3.3, we can show that for a randomly chosen prime , any block is a false candidate with probability at most . Thus, we may choose to bound this probability by a constant, say 1/2. In fact, by independently selecting random primes , one can reduce this probability to . To derandomize the above approach, we will instead show how to deterministically find primes that reduce the number of false candidates.
At level , we will ensure that the number of false candidates is upper bounded by a function , a bound which is trivially satisfied at . We will deterministically choose a constant number of primes such that the number of false level candidates decreases by a factor of . We know that a random prime will eliminate all but a fraction of false candidates. Thus, a natural attempt is to deterministically choose a prime that eliminates the largest fraction of false candidates (or minimize ). Unfortunately, both the quantity of false candidates eliminated by a given prime (and ) may be hard to compute, as it may involve checking whether a candidate is genuine or not (see [JPSX26] for further discussion). Instead, we find a function that is a constant-factor approximation of (Lemma 3.8) and we can efficiently compute (Lemma 3.9). This indirect approach of finding an estimate of the desired bound that is easier to compute is similar to [JPSX26], although our estimator is distinct and tailored to our specific application. Thus, choosing a prime that minimizes suffices to ensure that the number of false candidates decreases by a factor of . Iteratively choosing a constant number of such primes at level (each time ensuring we minimize ) decreases by the desired factor.
Given the above hierarchy, we proceed to search blocks in a depth-first order. For any given pair , iterate over all level 0 blocks. At each block, we will check whether it is a candidate block (as before with [AV26]), and if so process its children in depth-first order. At the final level of the hierarchy, we enumerate elements in all candidate blocks, and terminate the search for whenever a true witness is found. The depth-first order of the traversal ensures that at level , at most 1 true block witness is examined. Thus, the total number of level blocks examined at level is at most , since we must also examine the children of false level candidates. Since is decreasing in , our algorithm makes progressively fewer queries to the matrix product computed by [AV26] at higher levels , but incurs higher preprocessing cost as the inner dimension is decreasing in . Thus, instead of using Theorem 1.2, we use the data structure version of Theorem 25 (see Corollary 31 of [AV26]) which allows us to obtain faster preprocessing at the cost of slower queries.
We elaborate on the high-level approach described above below.
Step 1: Finding a Good Modulus. Let be a constant whose value we will determine later. At each level , we pick a set of primes of size . We say that a block is a candidate block witness for with respect to if it is a candidate block witness with respect to every . A triple is a level- candidate if, for every , the ancestor is a candidate block witness for with respect to . A level- candidate is false if is not a block witness. We have the following simple claim.
Claim 3.5. If is a block witness for , then is a level- candidate. If and is a level- candidate, then is a level- candidate for the unique parent .
Proof of Claim 3.5. If satisfies , then it belongs to every ancestor of and satisfies for every prime . Thus every ancestor passes the tests for its level. The second assertion follows directly from the definition.
For a given triple and modulus , let
denote the number of false witnesses for in with respect to . We define the following potential function
We claim that this potential upper bounds the number of false level candidates.
Claim 3.6. The total number of false level candidates is at most .
Proof of Claim 3.6. Suppose is a false level candidate. Then, for each , there exists such that and . In particular, we have for all , so that .
Thus, it suffices to bound . Towards this goal, our goal at each level is to choose satisfying the following invariant
As in Theorem 1.1, we set for some sufficiently large constant so that
Lemma 3.7. Let and let be a constant. There exists a deterministic algorithm that finds a set consisting of distinct primes in such that satisfies Equation (1), in time
Proof of Lemma 3.7. Note that , so every nonzero has at most distinct prime factors. Let consist of the first primes. We will ensure a choice of such that for sufficiently large , these primes are . We construct deterministically in time.
We will construct iteratively, beginning with . Throughout the construction, we choose the next prime from , so all chosen primes are distinct. For , define the potential
so that . We maintain the following invariant:
(2) which is trivially satisfied at since there are triples . Given , we describe how to choose to obtain . At a high level, our goal is to choose so that is minimized. However, since it is not clear how to compute efficiently directly, we must take an alternative approach.
Define
so that
For any fixed , let and define
Here , and hence , depends on . We first show that approximates , and then describe how to compute it.
Lemma 3.8. Let be a set of distinct primes. Then, for any prime ,
Proof of Lemma 3.8. Fix a triple . We begin by examining . The product counts tuples such that and for . We say such a tuple is bad, so that counts exactly the number of bad tuples.
Now, let us examine . Observe
Since , no triple contributes to the difference. Furthermore, counts tuples such but for . We say a tuple is counted by if it satisfies the above condition.
By definition, for any , every tuple that is counted by is bad, yielding the upper bound. To argue the lower bound, it suffices to show that any bad tuple is counted by at least fraction of . To see this, observe that each and therefore has at most distinct prime factors. Combined, there are at most distinct primes that factor at least one of . Since , there are at least primes that do not divide any of , so that any bad tuple is counted by at least of the primes in .
Next, we describe how to estimate .
Lemma 3.9. For every constant , there is a deterministic algorithm that computes for all in time
Proof of Lemma 3.9. We compute separately for each . Fix such a , write , and let .
Fix and a triple . For a set , we let if and otherwise. We may rewrite the product
For a fixed set S, we will compute
To do so, we construct matrices over the ring as follows
The outer dimension of the matrices is while the inner dimension is
The polynomials in the ring have degree less than in so that the total number of monomials is at most . Since every is either or , where and is , we have . For constant , ring multiplication can be performed in time by multivariate polynomial multiplication followed by reduction modulo . Thus the matrix product can be computed in time . The computed entries are of the form
In particular, the coefficient of is exactly the number of tuples such that for all . In particular, summing the coefficients of multiplied by over all entries , we obtain exactly the desired sum in Equation (3). Iterating over candidate primes , all , and all choices of , we compute every in time
as desired.
The above discussion motivates the following algorithm. Given , compute for every , choose
and set . By Lemma 3.9, summing over gives the time bound in Lemma 3.7. It remains to prove that the chosen primes satisfy Equation (1).
Claim 3.10. The above choice of maintains Equation (2).
Proof. Fix . For a uniformly chosen prime , Claim 3.3 gives
Indeed, each tuple counted by can be extended in at most ways, and a fixed nonzero difference is divisible by with probability . Excluding the constant number of already chosen primes changes this bound by only a constant factor.
By Lemma 3.8 and the definition of ,
Starting from and applying this bound at most constant times proves Equation (2), and hence Equation (1).
This concludes the proof of Lemma 3.7.
Step 2: Finding and Verifying a Sparse Certificate. Lemma 3.7 allows us to find a set of good primes. We now describe how to use the set of good primes to compute a small sparse certificate (i.e. find the set of level candidates). In contrast to the randomized algorithm, we will interleave the steps of finding and verifying the sparse certificate. Concretely, we will use the data structure of [AV26, Corollary 31] to test candidate blocks during a depth-first search.
Theorem 3.11 (Corollary 31 of [AV26]). Let and , let , and let
Given as input matrices and whose entries are integers of absolute value at most , where and where
we can preprocess them deterministically in time and space, after which any single entry in can be computed deterministically in time. The constants hidden in the depend on . Moreover, increases to as decreases to 10.
Theorem 3.11 allows us to trade-off slower queries for faster preprocessing. At level , we let so that .
Lemma 3.12. Fix a level and the set of primes. Suppose , , and . Given , let .
There is a deterministic data structure that returns for any block , output pair , and , with preprocessing time and query time .
Proof of Lemma 3.12. For each block , prime , and residue , construct the matrices from Lemma 3.4
The inner dimension is ; smaller blocks are padded with zero coordinates in both matrices. For a query , set . As in Lemma 3.4 we have
Apply Theorem 3.11 to preprocess each input matrix pair. There are products, since is constant. Constructing all input matrices takes time, and their preprocessing and query costs give the claimed bounds.
We now use these data structures to search the candidate blocks in depth-first order. For each output pair , process all level-0 blocks in order. At each visited block , use the following algorithm.
-
Query for each . If any , discard and proceed to the next block.
-
If , test for all until a witness is found. If is found, return is accurate and proceed to the next output pair. If no is found, discard and proceed to the next block.
-
If , recurse on the first child and then recurse on the second child (in depth-first search order).
If the full search finishes without finding a witness , return that is inaccurate.
Lemma 3.13. Let , where the implied constant is sufficiently large, and let . Suppose the parameters in Lemma 3.12 are valid for every . Then the above algorithm solves -Witness Equality deterministically in time
Proof of Lemma 3.13. Correctness follows from Claim 3.5 as we return that is accurate only after finding an exact witness, and a search will not terminate until either an exact witness is found or all candidate blocks are explored.
To bound the number of queries, fix . At each level, the depth-first search visits at most one block witness. Indeed, once it enters a block containing an exact witness, it finds such a witness before returning from that block, and then stops. Over all output pairs, at most visited blocks at any level are block witnesses. The number of false candidates at level is at most by Claim 3.6.
There are tests at level 0. At level , every tested block is a child of a visited level- candidate. Thus the number of queries at level , over the constant number of primes in , is
The same bound holds at level 0. Multiplying by the query time in Lemma 3.12 gives the query term in the statement. The final scans at level h cost
It remains to include preprocessing and Lemma 3.7. Summing Lemma 3.12 over the levels gives the preprocessing terms. Furthermore, we have
Lemma 3.7, summed over all levels, therefore contributes . Combining the bounds proves the lemma.
Putting it Together: Choosing the Parameters. We instantiate our algorithm with parameters
where are chosen to match Theorem 1.1 and is a constant whose choice we justify later. Choose
Round down to a power of two. Choose the constant in sufficiently large, and then the constant in sufficiently small that . Thus .
Next, we aim to choose so that the parameters of Lemma 3.12 are satisfied and we may apply Lemma 3.13. Before choosing at level , we give a quick discussion on how this choice might affect the performance of Lemma 3.12. The constants in Theorem 3.11 may depend on parameters and therefore . To make these constants uniform over all levels and input sizes, we round each chosen upward to the nearest multiple of (or any arbitrarily small fixed constant). Since lies in a bounded range, there are total choices of and the term of Theorem 3.11 can indeed be bounded by an absolute constant.
Following the above discussion, at level , choose by rounding
upward to the nearest multiple of , and set . Note that our choice of ensure . Intuitively, since we make fewer queries at higher levels , we are willing to trade off slower queries in exchange for faster preprocessing.
We first check the hypotheses of Lemma 3.12. Note by our choice of . For every , we compute
for sufficiently large N. Therefore, since c = 21, we have
Next, observe that is decreasing in g, so that
where . We have already ensured so that Lemma 3.12 applies at every level.
By our choice of and , we can bound the time required for Lemma 3.7 as as long as or , which our choices satisfy. Note that our choice of ensures that every prime in is smaller than for sufficiently large . Note that this also bounds the time required by the preprocessing term.
We next bound the preprocessing time required by Lemma 3.12. Since , we have
Using , the preprocessing term at each level is consequently
We now bound the query time, recall that is concave in , since entropy is concave and is linear in . Our choice of satisfies
By concavity and our choice of , we have
Multiplying by and using the two inequalities above gives
Since is increasing, we have and we may drop the last term in the upper bound. Applying the two inequalities above, we have
so that the time to compute one level query is . Note that we also have since is increasing, so we may also upper bound . From Lemma 3.13, the total time to compute all queries is
by our choice of . The final scan at level requires time as long as or , which holds for our choices of . We conclude the proof by observing that Lemma 3.2 costs a logarithmic factor.
References
[AGM97] Noga Alon, Zvi Galil, and Oded Margalit. On the exponent of the all pairs shortest path problem. J. Comput. Syst. Sci., 54(2):255–262, April 1997. 1
[AV26] Josh Alman and Virginia Vassilevska Williams. Truly subquadratic 3sum and truly subcubic apsp via triangles in sparse lopsided graphs. arXiv preprint arXiv:2610.06783, 2026. 1, 2, 4, 6, 7, 11
[BDT16] Arturs Backurs, Nishanth Dikkala, and Christos Tzamos. Tight hardness results for maximum weight rectangles. arXiv preprint arXiv:1602.05837, 2016. 1
[BGMW20] Karl Bringmann, Paweł Gawrychowski, Shay Mozes, and Oren Weimann. Tree edit distance cannot be computed in strongly subcubic time (unless apsp can). ACM Transactions on Algorithms (TALG), 16(4):1–22, 2020. 1
[BGSV19] Karl Bringmann, Fabrizio Grandoni, Barna Saha, and Virginia Vassilevska Williams. Truly subcubic algorithms for language edit distance and rna folding via fast bounded-difference min-plus product. SIAM Journal on Computing, 48(2):481–512, 2019. 1
[CDXZ22] Shucheng Chi, Ran Duan, Tianle Xie, and Tianyi Zhang. Faster min-plus product for monotone instances. In Proceedings of the 54th Annual ACM SIGACT Symposium on Theory of Computing, pages 1529–1542, 2022. 1
[Cha05] Timothy M. Chan. All-pairs shortest paths with real weights in time. In 9th International Workshop on Algorithms and Data Structures, WADS, 2005. 1
[Cha10] Timothy M. Chan. More algorithms for all-pairs shortest paths in weighted graphs. SIAM J. Comput., 39(5), 2010. 1
[CVX22] Timothy M. Chan, Virginia Vassilevska Williams, and Yinzhan Xu. Hardness for triangle problems under even more believable hypotheses: Reductions from real apsp, real 3sum. In Proceedings of the 54th Annual ACM Symposium on Theory of Computing (STOC 2022), pages 834–847. ACM, 2022. 2
[Dob90] Wlodzimierz Dobosiewicz. A more efficient algorithm for the min-plus multiplication. Int. J. Computer Math., 32, 1990. 1
[Fre76] Michael L. Fredman. New bounds on the complexity of the shortest path problem. SIAM J. Comput., 5(1):83–89, 1976. 1
[GPVX21] Yuzhou Gu, Adam Polak, Virginia Vassilevska Williams, and Yinzhan Xu. Faster monotone min-plus product, range mode, and single source replacement paths. arXiv preprint arXiv:2105.02806, 2021. 1
[Han04] Yijie Han. Improved algorithm for all pairs shortest paths. Inf. Process. Lett., 91(5), 2004. 1
[Han06] Yijie Han. Achieving time for all pairs shortest paths by using a smaller table. In 21st International Conference on Computers and Their Applications, CATA, 2006. 1
[HT12] Yijie Han and Tadao Takaoka. An time algorithm for all pairs shortest paths. In 13th Scandinavian Workshop on Algorithm Theory, SWAT, 2012. 1
[JPSX26] Ce Jin, Jaewoo Park, Barna Saha, and Yinzhan Xu. Deterministic monotone min-plus product and convolution. arXiv preprint arXiv:2605.07150, 2026. 1, 3, 6, 7
[KL26] Sankeerth Rao Karingula and Shachar Lovett. A simplified proof of polynomial improvements for 3sum and apsp. https://ecc.weizmann.ac.il/report/2026/247/, 2026. 1
[NPS 25] Jakob Nogler, Adam Polak, Barna Saha, Virginia Vassilevska Williams, Yinzhan Xu, and Christopher Ye. Faster weighted and unweighted tree edit distance and apsp equivalence. In Proceedings of the 57th Annual ACM Symposium on Theory of Computing, pages 2167–2178, 2025. 1
[Ope26] OpenAI. An upper bound of 9/4 for the matrix multiplication exponent. https://github.com/openai/math/blob/main/preprints/Matrix-Multiplication-Nine-Fourths-October-2-2026/paper.pdf, 2026. 2
[Pet04] Seth Pettie. A new approach to all-pairs shortest paths on real-weighted graphs. Theoretical Computer Science, 312(1):47–74, 2004. 1
[Tak92] Tadao Takaoka. A new upper bound on the complexity of the all pairs shortest path problem. Inf. Process. Lett., 43(4), 1992. 1
[Tak98] Tadao Takaoka. Subcubic cost algorithms for the all pairs shortest path problem. Algorithmica, 20(3), 1998. 1
[TT00] Hisao Tamaki and Takeshi Tokuyama. Algorithms for the maximum subarray problem based on matrix multiplication. Interdisciplinary Information Sciences, 6(2):99–104, 2000. 1
[VW18] Virginia Vassilevska Williams and R Ryan Williams. Subcubic equivalences between path, matrix, and triangle problems. Journal of the ACM (JACM), 65(5):1–38, 2018. 1
[Wil18] R. Ryan Williams. Faster all-pairs shortest paths via circuit complexity. SIAM J. Comput., 47(5), 2018. 1
[Zwi04] Uri Zwick. A slightly improved sub-cubic algorithm for the all pairs shortest paths problem with real edge lengths. In 15th International Symposium on Algorithms and Computation, ISAAC, 2004. 1