arXiv:2610.37018cs.DSOct 2026

Manuscript Offprint

arXiv:2610.37018

Linear-Time FPT Rectilinear Planarity Testing of Series-Parallel Graphs

Giacomo Ortali

Abstract

A planar graph is rectilinear planar if it admits a planar orthogonal drawing without bends. For series-parallel graphs in the variable embedding setting the best known testing algorithm takes O(n2)O(n^2) time. We show that rectilinear planarity of a series-parallel graph with maximum degree four can be tested in 2O(k)⋅n2^{O(k)} \cdot n time, where kk is the number of degree-4 vertices; the planar embedding is not fixed. In particular, the running time is subquadratic when k=o(log⁡n)k = o(\log n). Each node of the SPQ*-tree stores the set of its admissible spiralities; we show that this set is a union of 2O(k)2^{O(k)} arithmetic progressions of step two. All proofs are in the paper and are additionally verified in Lean 4 with Mathlib.

1 Introduction

A graph is rectilinear planar if it admits a planar orthogonal drawing without bends; only graphs of maximum degree four (4-graphs) can be rectilinear planar. Rectilinear planarity testing is NP-hard [8]. For partial 2-trees in the variable embedding setting it can be solved in O(n2)O(n^2) time, and in O(n)O(n) time when no two parallel components of a biconnected component share a pole [5]. Whether O(n)O(n) time is achievable for all series-parallel graphs is open.

Theorem 1. Let GG be a series-parallel 4-graph with nn vertices, kk having degree four. Whether GG is rectilinear planar, over all planar embeddings, can be tested in 2O(k)⋅n2^{O(k)} \cdot n time.

In particular, if k=o(log⁡n)k = o(\log n) the running time is n1+o(1)n^{1+o(1)}, which is subquadratic and improves on the O(n2)O(n^2) bound of [5].

We follow the spirality approach of [5]: each node μ\mu of the SPQ*-tree gets the set Σ(μ)\Sigma(\mu) of spiralities its component can take. The O(n2)O(n^2) bound of [5] comes from these sets not being intervals. Without degree-4 vertices the spirality sets are intervals; degree-4 vertices may break them into several maximal arithmetic progressions of step two (pieces). Our main technical result, the Key Lemma (Lemma 8), shows that a P2-node without degree-4 poles does not increase the number of pieces when the spirality set of one of its children has a single piece; as a consequence, every spirality set has at most 364k36^{4k} pieces (Lemma 11). Storing each set as the list of its pieces, every node is then processed in 2O(k)2^{O(k)} time. All proofs are given in the paper. The Key Lemma, the combinatorial bounds, the correctness of the algorithm and its cost for a fixed root are additionally verified in Lean 4 with Mathlib (Section 5).

Outline. Section 2 recalls spiralities and the rules of [5]. Section 3 bounds the number of pieces of every spirality set. Section 4 gives the algorithm, first for a fixed root and then for all roots. Section 5 describes the formalization.

(b) SPQ ∗^{*}-tree

(a) Graph

Figure

Figure 1: (a) A series-parallel 4-graph; u and v have degree four. (b) Its SPQ*-tree, rooted at the top chain: the P3-node with poles u, v is heavy (red), the P2-node with poles a, b is light (blue).