TY - GEN
T1 - Algorithms, reductions and equivalences for small weight variants of all-pairs shortest paths
AU - Chan, Timothy M.
AU - Williams, Virginia Vassilevska
AU - Xu, Yinzhan
N1 - Funding Information:
Funding Timothy M. Chan: Supported by NSF Grant CCF-1814026. Virginia Vassilevska Williams: Supported by an NSF CAREER Award, NSF Grants CCF-1528078, CCF-1514339 and CCF-1909429, a BSF Grant BSF:2012338, a Google Research Fellowship and a Sloan Research Fellowship. Yinzhan Xu: Supported by NSF Grant CCF-1528078.
Publisher Copyright:
© 2021 Timothy M. Chan, Virginia Vassilevska Williams, and Yinzhan Xu.
PY - 2021/7/1
Y1 - 2021/7/1
N2 - All-Pairs Shortest Paths (APSP) is one of the most well studied problems in graph algorithms. This paper studies several variants of APSP in unweighted graphs or graphs with small integer weights. APSP with small integer weights in undirected graphs [Seidel'95, Galil and Margalit'97] has an Õ (nω) time algorithm, where ω < 2.373 is the matrix multiplication exponent. APSP in directed graphs with small weights however, has a much slower running time that would be Ω(n2.5) even if ω = 2 [Zwick'02]. To understand this n2.5 bottleneck, we build a web of reductions around directed unweighted APSP. We show that it is fine-grained equivalent to computing a rectangular Min-Plus product for matrices with integer entries; the dimensions and entry size of the matrices depend on the value of ω. As a consequence, we establish an equivalence between APSP in directed unweighted graphs, APSP in directed graphs with small (Õ(1)) integer weights, All-Pairs Longest Paths in DAGs with small weights, cRed-APSP in undirected graphs with small weights, for any c ≥ 2 (computing all-pairs shortest path distances among paths that use at most c red edges), #≤cAPSP in directed graphs with small weights (counting the number of shortest paths for each vertex pair, up to c), and approximate APSP with additive error c in directed graphs with small weights, for c ≤ Õ (1). We also provide fine-grained reductions from directed unweighted APSP to All-Pairs Shortest Lightest Paths (APSLP) in undirected graphs with {0, 1} weights and #modcAPSP in directed unweighted graphs (computing counts mod c), thus showing that unless the current algorithms for APSP in directed unweighted graphs can be improved substantially, these problems need at least Ω(n2.528) time. We complement our hardness results with new algorithms. We improve the known algorithms for APSLP in directed graphs with small integer weights (previously studied by Zwick [STOC'99]) and for approximate APSP with sublinear additive error in directed unweighted graphs (previously studied by Roditty and Shapira [ICALP'08]). Our algorithm for approximate APSP with sublinear additive error is optimal, when viewed as a reduction to Min-Plus product. We also give new algorithms for variants of #APSP (such as #≤UAPSP and #modUAPSP for U ≤ n Õ (1)) in unweighted graphs, as well as a near-optimal Õ(n3)-time algorithm for the original #APSP problem in unweighted graphs (when counts may be exponentially large). This also implies an Õ(n3)-time algorithm for Betweenness Centrality, improving on the previous Õ(n4) running time for the problem. Our techniques also lead to a simpler alternative to Shoshan and Zwick's algorithm [FOCS'99] for the original APSP problem in undirected graphs with small integer weights.
AB - All-Pairs Shortest Paths (APSP) is one of the most well studied problems in graph algorithms. This paper studies several variants of APSP in unweighted graphs or graphs with small integer weights. APSP with small integer weights in undirected graphs [Seidel'95, Galil and Margalit'97] has an Õ (nω) time algorithm, where ω < 2.373 is the matrix multiplication exponent. APSP in directed graphs with small weights however, has a much slower running time that would be Ω(n2.5) even if ω = 2 [Zwick'02]. To understand this n2.5 bottleneck, we build a web of reductions around directed unweighted APSP. We show that it is fine-grained equivalent to computing a rectangular Min-Plus product for matrices with integer entries; the dimensions and entry size of the matrices depend on the value of ω. As a consequence, we establish an equivalence between APSP in directed unweighted graphs, APSP in directed graphs with small (Õ(1)) integer weights, All-Pairs Longest Paths in DAGs with small weights, cRed-APSP in undirected graphs with small weights, for any c ≥ 2 (computing all-pairs shortest path distances among paths that use at most c red edges), #≤cAPSP in directed graphs with small weights (counting the number of shortest paths for each vertex pair, up to c), and approximate APSP with additive error c in directed graphs with small weights, for c ≤ Õ (1). We also provide fine-grained reductions from directed unweighted APSP to All-Pairs Shortest Lightest Paths (APSLP) in undirected graphs with {0, 1} weights and #modcAPSP in directed unweighted graphs (computing counts mod c), thus showing that unless the current algorithms for APSP in directed unweighted graphs can be improved substantially, these problems need at least Ω(n2.528) time. We complement our hardness results with new algorithms. We improve the known algorithms for APSLP in directed graphs with small integer weights (previously studied by Zwick [STOC'99]) and for approximate APSP with sublinear additive error in directed unweighted graphs (previously studied by Roditty and Shapira [ICALP'08]). Our algorithm for approximate APSP with sublinear additive error is optimal, when viewed as a reduction to Min-Plus product. We also give new algorithms for variants of #APSP (such as #≤UAPSP and #modUAPSP for U ≤ n Õ (1)) in unweighted graphs, as well as a near-optimal Õ(n3)-time algorithm for the original #APSP problem in unweighted graphs (when counts may be exponentially large). This also implies an Õ(n3)-time algorithm for Betweenness Centrality, improving on the previous Õ(n4) running time for the problem. Our techniques also lead to a simpler alternative to Shoshan and Zwick's algorithm [FOCS'99] for the original APSP problem in undirected graphs with small integer weights.
KW - All-Pairs Shortest Paths
KW - Fine-Grained Complexity
KW - Graph Algorithm
UR - http://www.scopus.com/inward/record.url?scp=85107911373&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85107911373&partnerID=8YFLogxK
U2 - 10.4230/LIPIcs.ICALP.2021.47
DO - 10.4230/LIPIcs.ICALP.2021.47
M3 - Conference contribution
AN - SCOPUS:85107911373
T3 - Leibniz International Proceedings in Informatics, LIPIcs
BT - 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021
A2 - Bansal, Nikhil
A2 - Merelli, Emanuela
A2 - Worrell, James
PB - Schloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
T2 - 48th International Colloquium on Automata, Languages, and Programming, ICALP 2021
Y2 - 12 July 2021 through 16 July 2021
ER -