Time-Optimal APSP and Matrix Multiplication in Classes of Linear Neighborhood Complexity
Édouard Bonnet, Julien Duron, Marcin Pilipczuk, Marek Sokołowski, Szymon Toruńczyk
Abstract
The notion of linear neighborhood complexity is a very general structural assumption on a graph class, covering most classes of sparse graphs such as planar graphs, graphs excluding a fixed (topological) minor, or bounded expansion graphs, as well as many structured classes of dense graphs, such as graphs of bounded clique-width, twin-width, merge-width, or flip-width. In this work, we present O(n2)-time optimal algorithms for n-vertex graphs coming from a class of linear neighborhood complexity for the following problems: All-Pairs Shortest Paths, the multiplication of the adjacency matrix M of the input graph with any n × n matrix. More specifically, after a quadratic preprocessing, we can multiply M with any n-vector in O(n) time. This solves several questions raised in [Bonnet, Kim, Geniet, Moon; ICALP '26], and improves and generalizes results in several other recent papers [Bonnet, Giocanti, Ossona de Mendez, Thomassé; STACS '23], [Bannach, Marwitz, Tantau; STACS '24], [Anand, van den Brand, McCarty; NeurIPS '26], [Kozma, Opler '26], and [Cardinal, McCarty, Yuditsky '26]. We also extend our results to classes of bounded VC density. In classes of linear neighborhood complexity, we also give a triangle-detection algorithm in randomized linear time O(n+m) in n-vertex m-edge graphs, a K4-detection algorithm in randomized O(n 5 n + m n) or deterministic O(n2) time, and a K5-detection algorithm in randomized O(n 9 n + m 5 n) time.
Create a lesson
Related papers
A Near-Optimal Space Lower Bound for Euclidean Diameter Estimation in Dynamic Streams
Ashwin Padaki, Krish Singal, Erik Waingarten
A Walk From Free Probability to Matrix Discrepancy I: Matrix Spencer
Tarun Kathuria
A Walk From Free Probability to Matrix Discrepancy II: Weaver's Problem and the Kadison-Singer Conjecture
Tarun Kathuria
Degree-Free Spectral Independence for Log-Concave Holant Measures
Xiaoyu Chen, Zejia Chen, Xinyuan Zhang
Optimizing Both Checking and Update Costs in Random Walk Search
Simon Apers, Marin Costes
Routing Multiple Agents Below the Sum of Distances
Matthias Bentert, Eduard Eiben, Fedor V. Fomin et al.