Papers
Topics
Authors
Recent
Search
2000 character limit reached

A Linear-Time Algorithm for Finding an Odd Cycle Through Two Specified Vertices

Published 25 Apr 2026 in cs.DS and math.CO | (2604.23169v1)

Abstract: We present a deterministic linear-time algorithm for finding an odd cycle through two specified vertices in an undirected graph. This is shown in a generalized form as follows: Let ΓΓ be any group in which every element is of order at most $2$. For a given ΓΓ-labeled graph with two specified vertices (or edges), we can determine in linear time whether there exist two cycles with distinct labels that are through both of the two specified vertices (or edges), and find such cycles if yes.

Authors (2)

Summary

  • The paper introduces a deterministic linear-time algorithm (O(n + m)) that finds an odd cycle through two specified vertices.
  • The method leverages SPQR-tree decomposition to reduce the problem to analyzing triconnected components and group-labeled graphs with self-inverse elements.
  • The approach achieves optimal complexity and offers practical benefits for parity-constrained optimization and signed network analysis.

Summary of "A Linear-Time Algorithm for Finding an Odd Cycle Through Two Specified Vertices" (2604.23169)

Problem Formulation and Background

The paper addresses the computational problem of determining, in deterministic linear time, whether an undirected graph contains an odd cycle passing through two specified vertices, and finding such a cycle if it exists. The result generalizes prior work on finding cycles through three fixed vertices and extends the scope to group-labeled graphs where every group element has order at most 2. The central result, Theorem 1.1, establishes the existence of a linear-time algorithm (O(n+m)O(n + m), with nn and mm denoting the numbers of vertices and edges) for this problem.

The authors leverage a higher-level abstraction, considering group-labeled graphs (G,γ)(G, \gamma), where GG is the graph and γ\gamma assigns labels from a group T\mathcal{T} (whose elements are self-inverse) to the edges. The main focus is on the case T=Z2\mathcal{T} = \mathbb{Z}_2, corresponding to signed graphs and parity constraints, but the results apply to any group of order at most 2 elements.

Generalization and Equivalence Transformations

The paper introduces two equivalent forms of the problem:

  1. Cycles with Distinct Labels through Two Vertices: Given a biconnected group-labeled graph and two vertices, decide if two cycles exist with distinct labels through both vertices.
  2. Cycles with Distinct Labels through Two Edges: Given a biconnected group-labeled graph and two edges, decide if two cycles exist with distinct labels through both edges.

The equivalence is established via standard reductions: vertices are split and edges are subdivided to transform the instance between the two forms, preserving both biconnectivity and labeling properties.

Structural Decomposition via SPQR-Trees

The linear-time algorithm's cornerstone is structural decomposition using SPQR-trees, which facilitate efficient separation of the graph into triconnected components. The SPQR-tree encodes cycles and connectivity at a finer granularity:

  • Q-nodes: Single edges
  • S-nodes: Cycles
  • P-nodes: Parallel edges between two vertices
  • R-nodes: Triconnected components (the only nontrivial case for distinguishing cycle labels)

By focusing on the path connecting the Q-nodes corresponding to the distinguished edges, and summarizing information from off-path subtrees, the algorithm reduces the complexity to solving the problem in triconnected graphs.

Algorithmic Framework and Decision Procedure

For triconnected components, the existence of two cycles through two specified edges with distinct labels is characterized by the presence of a non-zero cycle of length at least three in the residual graph after the two edges are removed (DeVos and Nurse (DeVos et al., 2023)). The constructive algorithm achieves linear runtime by:

  • Computing SPQR-trees in linear time ([Hopcroft & Tarjan, Gutwenger & Mutzel]).
  • Summarizing possible path labels for off-path subtrees using representative sets (max two per subtree).
  • Aggregating possible cycle labels from triconnected component skeletons, thereby reducing the problem to simple group operations.
  • Explicit construction and recovery of witness cycles based on stored realizing paths.

The case analysis, detailed in Section 4, covers all possible configurations of the specified vertices relative to a non-zero cycle and systematically constructs two path pairs with distinct labels, exploiting local connectivity and parity constraints.

Strong Numerical Results and Claims

  • Linear Time Complexity: The algorithm operates in O(n+m)O(n + m), achieving optimal time for cycle search in general graphs and marked improvement over polynomial-time methods based on graph minor theory ([Kawarabayashi et al., Huynh]).
  • Generality Over Constant-Size Groups: The method applies to any group where all elements are self-inverse, subsuming traditional signed graphs as a special case.
  • Explicit Witness Construction: Not only does the method decide existence, but it constructs explicit cycles in the required time bound.

Practical and Theoretical Implications

Practically, this algorithm enables efficient odd cycle detection through designated graph elements, crucial for applications in parity-constrained combinatorial optimization, circuit design, and signed network analysis. Theoretically, the result refines combinatorial connectivity theory:

  • It demonstrates that SPQR-tree-based decomposition is sufficiently powerful for rapid path and cycle label aggregation, avoiding heavy machinery from graph minor theory.
  • The reduction to cases where group elements are of order at most 2 highlights the boundaries of tractability; for groups like Z3\mathbb{Z}_3, structural characterization fails and the algorithm does not extend (as shown by counterexamples in the paper).

Speculation on Future Directions

This work opens avenues for further exploration:

  • Extension to Arbitrary Groups: Investigating algorithms when group elements may have order greater than 2, particularly for nn0 with nn1, remains a challenging open problem.
  • Parameterized Complexity: The approach may generalize to parameterized settings, such as width-bounded graphs or more than two specified vertices/edges.
  • Applications to Signed Network Dynamics: Faster cycle and path identification in signed social or biological networks can leverage this work, especially when parity constraints are operational.

Conclusion

The paper presents a deterministic linear-time algorithm for finding odd cycles through two specified vertices (or edges) in undirected graphs, with extensive generalization to group-labeled graphs under self-inverse elements. By harnessing SPQR-tree decomposition and elementary combinatorial arguments, the authors achieve optimal complexity, practical constructiveness, and theoretical advancement in the study of parity-constrained cycle problems. The algorithm's implications are significant for both graph algorithms and combinatorial optimization, setting the stage for broader generalizations and deeper structural insights.

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.