Papers
Topics
Authors
Recent
Search
2000 character limit reached

Fast Shortest Path in Graphs With Sparse Signed Tree Models and Applications

Published 18 Feb 2026 in cs.DS, cs.DM, and math.CO | (2602.16605v1)

Abstract: A signed tree model of a graph GG is a compact binary structure consisting of a rooted binary tree whose leaves are bijectively mapped to the vertices of GG, together with 2-colored edges xyxy, called transversal pairs, interpreted as bicliques or anti-bicliques whose sides are the leaves of the subtrees rooted at xx and at yy. We design an algorithm that, given such a representation of an nn-vertex graph GG with pp transversal pairs and a source v∈V(G)v \in V(G), computes a shortest-path tree rooted at vv in GG in time O(plog⁡n)O(p \log n). A wide variety of graph classes are such that for all nn, their nn-vertex graphs admit signed tree models with O(n)O(n) transversal pairs: for instance, those of bounded symmetric difference, more generally of bounded sd-degeneracy, as well as interval graphs. As applications of our Single-Source Shortest Path algorithm and new techniques, we - improve the runtime of the fixed-parameter algorithm for first-order model checking on graphs given with a witness of low merge-width from cubic [Dreier and Toruńczyk, STOC '25] to quadratic; - give an O(n<sup>2</sup>log⁡n)O(n<sup>2</sup> \log n)-time algorithm for All-Pairs Shortest Path (APSP) on graphs given with a witness of low merge-width, generalizing a result known on twin-width [Twin-Width III, SICOMP '24]; - extend and simplify an O(n<sup>2</sup>log⁡n)O(n<sup>2</sup> \log n)-time algorithm for multiplying two n×nn \times n matrices A,BA, B of bounded twin-width in [Twin-Width V, STACS '23]: now AA solely has to be an adjacency matrix of a graph of bounded twin-width and BB can be arbitrary; - give an O(n<sup>2</sup>log⁡<sup>2</sup>n)O(n<sup>2</sup> \log<sup>2</sup> n)-time algorithm for APSP on graphs of bounded twin-width, bypassing the need for contraction sequences in [Twin-Width III, SICOMP '24; Bannach et al. STACS '24]; - give an O(n<sup>7/3</sup>log⁡<sup>2</sup>n)O(n<sup>{7/3}</sup> \log<sup>2</sup> n)-time algorithm for APSP on graphs of symmetric difference O(n<sup>1/3)O(n<sup>{1/3}).

Summary

  • The paper develops an O(p log n)-time single-source shortest-path algorithm for unweighted graphs represented by signed tree models with n vertices and p transversal pairs.
  • It converts signed tree models into compact interval biclique partitions and DAG compressions, enabling near-optimal APSP and related algorithms on bounded twin-width, merge-width, and other structured graph classes.
  • The framework yields witness-free APSP in O(n² log² n) for bounded twin-width graphs, O(n^(7/3) log² n) for moderate symmetric difference, and advances matrix multiplication, model checking, and dynamic SSSP.

This paper develops fast shortest-path algorithms for graphs given by sparse signed tree models, a compact binary-structure representation generalizing tree models for twin-width. A signed tree model consists of a rooted full binary tree whose leaves bijectively correspond to the vertices of the graph, together with non-crossing transversal pairs colored as edges (bicliques) or anti-edges (anti-bicliques); two leaves are adjacent exactly when covered by a positive transversal pair. The central contribution is an O(plog⁡n)O(p\log n)-time Single-Source Shortest Path (SSSP) algorithm for unweighted nn-vertex graphs with signed tree models having pp transversal pairs, together with conversion routines to other sparse encodings and a range of applications: All-Pairs Shortest Path (APSP), matrix multiplication, first-order model checking, and fully dynamic SSSP.

Signed tree models and their reach

The framework covers a broad hierarchy of graph classes. Bounded sd-degeneracy — a parameter extending degeneracy to dense settings, more permissively than symmetric difference — implies degenerate signed tree models. Since bounded twin-width ⇒\Rightarrow bounded merge-width ⇒\Rightarrow bounded flip-width ⇒\Rightarrow bounded symmetric difference ⇒\Rightarrow bounded sd-degeneracy, all these classes admit signed tree models with O(n)O(n) transversal pairs; interval graphs do as well (with comb trees). Classes of almost linear neighborhood complexity admit almost sparse models with n1+o(1)n^{1+o(1)} transversal pairs, and it is conjectured that every monadically dependent class has almost linear neighborhood complexity.

The main conversion theorem states that in O(plog⁡n)O(p\log n) time one can turn such a model into any of: an interval biclique partition (IBP) with nn0 bicliques, a DAG compression of size nn1, or (in additional nn2 time) a positive tree model with nn3 transversal edges. Either of the first two items yields SSSP in nn4 time via known machinery. For sparse models (nn5) this is essentially optimal, and sublinear in the input size for graphs with nn6 edges.

Algorithmic core

The algorithm exploits that transversal pairs induce a laminar family of rectangles in the adjacency matrix ordered by the tree's leaf order. Using Mortensen's dynamic orthogonal range-reporting structure, the inclusion forest of this family is computed in nn7. After cleaning so that signs alternate along parent-child relations, each positive rectangle must be partitioned minus its disjoint negative children into nn8 rectangles in nn9 time, where pp0 is the number of children; this relies on a classical subroutine of de Rezende, Lee, and Wu for complementing pairwise-disjoint rectangles (the authors note that disjointness is essential, as intersecting families may have quadratically many complement components). The result is an IBP with pp1 bicliques. Replacing the tree by a balanced binary tree then realizes each interval biclique with few positive transversal edges, yielding the other encodings.

A generic corollary converts any class admitting computable signed tree models with pp2 transversal pairs in time pp3 into APSP algorithms running in pp4. This is instantiated twice:

  • Bounded twin-width: a Las Vegas algorithm computes a signed tree model with pp5 transversal pairs in pp6 time with high probability, via a randomized sampling scheme that repeatedly partitions vertices by neighborhoods toward a random sample and extracts low-symmetric-difference pairs. This gives APSP in pp7 without requiring a contraction sequence as witness — previously such runtimes were only known with witnesses.
  • Moderate symmetric difference: for graphs of symmetric difference pp8, an sd-degeneracy sequence of width pp9 is found in ⇒\Rightarrow0 time with high probability, improving the trivial greedy ⇒\Rightarrow1 bound, giving APSP in ⇒\Rightarrow2. Notably ⇒\Rightarrow3, so this beats the best matrix-multiplication-based APSP for general unweighted graphs.

Both results are near-optimal in spirit: under SETH, Diameter on twin-width-4 graphs cannot be solved in ⇒\Rightarrow4 even with a witness. These algorithms imply the same bounds for Diameter, Radius, Eccentricity, and Wiener Index.

Matrix multiplication

The paper gives an ⇒\Rightarrow5-time algorithm multiplying an adjacency matrix ⇒\Rightarrow6 of a bounded-twin-width graph by an arbitrary matrix ⇒\Rightarrow7 over any additive group. The key primitive expresses the reordered adjacency matrix as ⇒\Rightarrow8, with ⇒\Rightarrow9 a sparse ⇒\Rightarrow0-matrix of at most ⇒\Rightarrow1 nonzeros and ⇒\Rightarrow2 the lower-triangular all-ones matrix, enabling matrix-vector products over additive groups (no ring structure needed) in time linear in the IBP size plus ⇒\Rightarrow3.

This significantly extends the Twin-Width V result, which required both matrices to have bounded twin-width as ordered matrices and relied on involved contraction-sequence approximation and FO query answering. The new approach also handles chains of products ⇒\Rightarrow4 in ⇒\Rightarrow5, which the prior method could not, since intermediate products lose the twin-width bound. The implementation simplicity claim is concrete: steps one and three require roughly 15–20 lines of code.

Model checking and dynamic SSSP

Combining construction sequences for merge-width (convertible to signed tree models with at most ⇒\Rightarrow6 transversal pairs in linear time, after loop removal) with the distance machinery improves the FO model-checking runtime of Dreier and Toruńczyk from cubic to quadratic in ⇒\Rightarrow7 for fixed formula rank and width. The improvement targets the scattered-set subroutine: since resolved-pair graphs are built by positive construction sequences, they admit linear-size distance models via DAG compression, making the ⇒\Rightarrow8-scattered maximal subset computation linear rather than quadratic — the sole bottleneck of the cubic bound.

As a further consequence, the paper derives a fully dynamic Las Vegas SSSP algorithm on bounded-twin-width classes with ⇒\Rightarrow9 amortized update time and ⇒\Rightarrow0 worst-case query time, initialized in ⇒\Rightarrow1, with ⇒\Rightarrow2 worst-case updates if the edit budget is ⇒\Rightarrow3. Updates simply add transversal pairs at leaf positions, with periodic rebuilds. For comparison, the best fully dynamic SSSP for general unweighted graphs has ⇒\Rightarrow4 Monte Carlo update/query time.

Additionally, combining Welzl-style partitioning results for attained VC density ⇒\Rightarrow5 with the SSSP framework yields APSP in ⇒\Rightarrow6 for classes of attained VC density 1, and ⇒\Rightarrow7 via genuine VC density arguments — covering bounded merge-width and flip-width classes without witnesses.

Limitations and open questions

Several gaps remain explicit. The APSP bound for bounded twin-width is a ⇒\Rightarrow8 factor above the witness-assisted ⇒\Rightarrow9; whether the latter can be attained witness-free is open. Conversions incur log-factor blow-ups (⇒\Rightarrow0 for DAG compressions, ⇒\Rightarrow1 for positive tree models), and shaving them would directly improve all downstream bounds. Computing genuinely sparse signed tree models efficiently for bounded twin-width or merge-width remains open (current methods give ⇒\Rightarrow2 pairs). Deciding sd-degeneracy at most 1 is NP-complete and symmetric difference at most 8 is co-NP-complete, with no known nontrivial approximation algorithms; approximating sd-degeneracy within reasonable ratios would have direct APSP consequences. Finally, whether every hereditary factorial class admits sparse signed tree models is unresolved — permutation graphs and 2-track interval graphs are candidate counterexamples, but ruling them out requires techniques beyond counting.

Conclusion

The paper establishes sparse signed tree models as an algorithmically productive representation, delivering an essentially optimal SSSP routine whose applications include witness-free APSP on broad structured classes, a simpler and more general bounded-twin-width matrix multiplication, quadratic FO model checking for bounded merge-width, and nontrivial dynamic SSSP. Its limitations are chiefly logarithmic overheads in conversions and the cost or absence of efficient model computation for some classes, both of which the authors formulate as concrete open problems.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.