Skip to main content
QUICK REVIEW

[Paper Review] Computing the diameter polynomially faster than APSP

Raphael Yuster|arXiv (Cornell University)|Nov 29, 2010
Complexity and Algorithms in GraphsComputer Science14 references16 citations
TL;DR

This paper presents the first randomized algorithm that computes the diameter of a directed graph with integer edge weights polynomially faster than known All-Pairs Shortest Paths (APSP) algorithms. By introducing a novel Threshold APSP problem—reporting all pairs within distance d—it uses matrix convolution over polynomials and fast matrix multiplication to achieve a runtime of Õ(M^{ω/(ω+1)}n^{(ω²+3)/(ω+1)}) for weights in {−M,…,M}, which is faster than Zwick’s APSP algorithm for bounded M.

ABSTRACT

We present a new randomized algorithm for computing the diameter of a weighted directed graph. The algorithm runs in $\Ot(M^{\w/(\w+1)}n^{(\w^2+3)/(\w+1)})$ time, where $\w < 2.376$ is the exponent of fast matrix multiplication, $n$ is the number of vertices of the graph, and the edge weights are integers in $\{-M,...,0,...,M\}$. For bounded integer weights the running time is $O(n^{2.561})$ and if $\w=2+o(1)$ it is $\Ot(n^{7/3})$. This is the first algorithm that computes the diameter of an integer weighted directed graph polynomially faster than any known All-Pairs Shortest Paths (APSP) algorithm. For bounded integer weights, the fastest algorithm for APSP runs in $O(n^{2.575})$ time for the present value of $\w$ and runs in $\Ot(n^{2.5})$ time if $\w=2+o(1)$. For directed graphs with {\em positive} integer weights in $\{1,...,M\}$ we obtain a deterministic algorithm that computes the diameter in $\Ot(Mn^\w)$ time. This extends a simple $\Ot(n^\w)$ algorithm for computing the diameter of an {\em unweighted} directed graph to the positive integer weighted setting and is the first algorithm in this setting whose time complexity matches that of the fastest known Diameter algorithm for {\em undirected} graphs. The diameter algorithms are consequences of a more general result. We construct algorithms that for any given integer $d$, report all ordered pairs of vertices having distance {\em at most} $d$. The diameter can therefore be computed using binary search for the smallest $d$ for which all pairs are reported.

Motivation & Objective

  • To develop a faster algorithm for computing the diameter of directed graphs with integer edge weights than existing All-Pairs Shortest Paths (APSP) algorithms.
  • To address the open problem of whether diameter can be computed asymptotically faster than APSP in integer-weighted directed graphs.
  • To extend the Õ(n^ω) algorithm for unweighted directed graphs to the positive integer-weighted case, matching the performance of the best undirected graph algorithms.
  • To introduce and solve the Threshold APSP problem—reporting all pairs within distance d—as a key primitive for diameter computation.

Proposed method

  • Introduce the Threshold APSP problem: for a given threshold d, report all ordered pairs of vertices with distance at most d.
  • Use binary search on d to compute the diameter, reducing the diameter problem to multiple instances of Threshold APSP.
  • For negative and zero weights in {−M,…,M}, use a recursive decomposition by levels of distance, grouping matrices A_k for k in intervals L(d,M,j).
  • Encode multiple distance matrices A_k as coefficients of a single polynomial matrix B, where B[u,v] = Σ_{q=0}^{s-1} A_{q+t}[u,v] x^q.
  • Compute C = B² in the polynomial ring to recover A_k via coefficient extraction, leveraging fast matrix multiplication over polynomials.
  • Use base substitution (e.g., x = n+1) to simulate polynomial multiplication with integer arithmetic, bounded by Õ(M n^ω) time due to O(M) coefficients.

Experimental results

Research questions

  • RQ1Can the diameter of a directed graph with integer edge weights be computed faster than known APSP algorithms?
  • RQ2Is there a way to compute the diameter using a problem class (Threshold APSP) that is strictly easier than full APSP?
  • RQ3Can the Õ(n^ω) algorithm for unweighted directed diameter be extended to positive integer-weighted graphs with matching asymptotic complexity?
  • RQ4What is the optimal trade-off between weight range M and graph size n for diameter computation using fast matrix multiplication?

Key findings

  • The algorithm computes the diameter of a directed graph with integer weights in {−M,…,M} in Õ(M^{ω/(ω+1)}n^{(ω²+3)/(ω+1)}) time, which is polynomially faster than Zwick’s APSP algorithm for bounded M.
  • For bounded integer weights (M = O(1)), the running time is O(n^{2.561}) when ω < 2.376, improving upon the O(n^{2.575}) time of the best known APSP algorithm.
  • When ω = 2 + o(1), the algorithm runs in Õ(n^{7/3}) time, matching the best known subcubic time for undirected graphs.
  • For positive integer weights in {1,…,M}, a deterministic algorithm computes the diameter in Õ(M n^ω) time, matching the best known complexity for undirected graphs.
  • The algorithm uses polynomial matrix convolution to compute multiple distance matrices simultaneously, reducing the cost from O(M²n^ω) to Õ(M n^ω).
  • The solution relies on a recursive level-based decomposition of distance ranges and efficient polynomial representation to enable fast matrix multiplication over structured coefficient sets.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.