MathLabs
TheoremProved

Shortest paths as a tropical matrix power

Statement

Let AA be the (min⁡,+)(\min,+) weight matrix of a directed graph on nn vertices with no negative-weight cycles. Let A⊗mA^{\otimes m} denote the mm-fold tropical matrix product of AA with itself. Then the entry (A⊗(n−1))ij(A^{\otimes(n-1)})_{ij} equals the length of the shortest path from ii to jj in the graph. This is exactly the quantity computed by the Floyd–Warshall algorithm, whose recurrence dij(k)=min⁡(dij(k−1), dik(k−1)+dkj(k−1))d_{ij}^{(k)} = \min\big(d_{ij}^{(k-1)},\ d_{ik}^{(k-1)} + d_{kj}^{(k-1)}\big) builds up A⊗(n−1)A^{\otimes(n-1)} one intermediate vertex at a time.

Why is it true?

Entry (A⊗m)ij(A^{\otimes m})_{ij} tracks the length of the best walk from ii to jj using **at most mm edges**, because tropical matrix multiplication is exactly "combine a first leg and a rest-of-the-journey via addition, then keep only the cheapest combination" — precisely Bellman's principle of optimality for shortest paths. Iterating this n−1n - 1 times is enough because a shortest simple path in an nn-vertex graph never needs more than n−1n - 1 edges, so no further tropical squaring can improve the answer.

Proof sketch

By induction on mm. Base case m=1m = 1: (A⊗1)ij=Aij(A^{\otimes 1})_{ij} = A_{ij} is trivially the length of the best walk using at most one edge. Inductive step: assume (A⊗m)ik(A^{\otimes m})_{ik} equals the length of the shortest walk from ii to kk using at most mm edges, for every kk. Then (A⊗(m+1))ij=(A⊗m⊗A)ij=min⁡k((A⊗m)ik+Akj)(A^{\otimes(m+1)})_{ij} = (A^{\otimes m} \otimes A)_{ij} = \min_k\big((A^{\otimes m})_{ik} + A_{kj}\big). Any walk from ii to jj with at most m+1m+1 edges either uses at most mm edges already (covered by the k=jk = j, Ajj=0A_{jj} = 0 term) or splits as a walk of at most mm edges from ii to some vertex kk followed by one final edge k→jk \to j; minimizing over all such kk recovers exactly (A⊗(m+1))ij(A^{\otimes(m+1)})_{ij}, so the claim holds for m+1m + 1. Since there are no negative-weight cycles, no shortest walk needs to repeat a vertex, so every shortest path uses at most n−1n - 1 edges; taking m=n−1m = n - 1 shows (A⊗(n−1))ij(A^{\otimes(n-1)})_{ij} is exactly the shortest-path distance, matching the Floyd–Warshall recurrence, which computes the same quantity by fixing intermediate vertices one at a time instead of edge-counts.

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. Diane Maclagan, Bernd Sturmfels (2015). Introduction to Tropical Geometry
  2. Grigory Mikhalkin (2005). Enumerative tropical algebraic geometry in R^2 · arXiv:math/0312530
  3. Imre Simon (1978). Limited subsets of a free monoid · DOI:10.1109/SFCS.1978.21