arXiv:2610.11717cs.FLOct 2026

Manuscript Offprint

arXiv:2610.11717

Every Regular Language Has a Bipartite Cactus Automaton

Mario Grobler, Till Koziel, Sebastian Siebertz

Mario Grobler

University of Bremen

Bremen, Germany

grobler@uni-bremen.de

Till Koziel

RWTH Aachen University

Aachen, Germany

till.koziel@rwth-aachen.de

Sebastian Siebertz

University of Bremen

Bremen, Germany

siebertz@uni-bremen.de

Thompson’s classical construction turns every regular expression into an equivalent ε\varepsilon-NFA whose transition graph is series-parallel. The construction uses ε\varepsilon-transitions, and eliminating them by the usual shortcut construction need not preserve planarity or the bound of two on the treewidth of the transition graph. Book and Chandra proved that every regular language nevertheless has an ε\varepsilon-free NFA with a planar transition graph. We show that the transition graph can in fact be chosen to be a bipartite cactus: every cycle is even, and any two cycles have at most one vertex in common. In particular, it is outerplanar and has treewidth at most two. This is a considerably more simple structure than the general series-parallel guarantee supplied by Thompson’s construction. The proof is a direct induction on parity-typed regular expressions and uses only elementary closure properties of cactus graphs.

1 Introduction

Nondeterministic finite-state automata (NFAs) are central objects of study in theoretical computer science, see, for example, [12, 13, 14, 15, 17]. Although they are usually studied through the languages they recognize, the graph structure of their state diagrams is also a natural object of study. A classical example is Eggan’s theorem, which relates the star height of a regular language to the cycle rank of directed transition graphs of automata recognizing it [11].

Very simple transition graphs arise naturally from Thompson’s construction for regular expressions [18]. Given a regular expression, the construction produces an equivalent ε\varepsilon-NFA whose transition graph is series-parallel. This gives a simple structural representation of regular languages, but it relies on ε\varepsilon-transitions. The usual elimination procedure introduces labelled shortcut transitions along ε\varepsilon-paths, and this operation need not preserve the series-parallel structure, planarity, or the treewidth bound of two.

The graphs obtained in this paper are considerably more restricted than general series-parallel graphs. A connected graph is a cactus if every edge belongs to at most one cycle, equivalently, every block is either a single edge or a cycle. The cacti form a proper subclass of the outerplanar graphs, and every outerplanar graph is a subgraph of a series-parallel graph, see [8].

In Figure 1, the left automaton is a natural ε\varepsilon-free NFA for {aa,bb,cc}\{aa, bb, cc\} whose transition graph is K2,3K_{2,3}. This graph is series-parallel, but it is not a cactus: every edge belongs to two cycles. The right automaton is an equivalent ε\varepsilon-free NFA whose transition graph is a tree. The example illustrates how nondeterminism and state duplication can be used to improve the graph structure without changing the accepted language.

Book and Chandra showed that planarity can still be achieved when ε\varepsilon-transitions are not allowed [7]. They proved that every regular language is recognized by an ε\varepsilon-free NFA with a planar transition graph.

The corresponding statement fails for deterministic automata [7]. This observation initiated a line of work on topological restrictions of automata. Subsequent work studied planar finite automata [2],

G. Bacci, M. Randour (Eds.): Seventeenth International Symposium on Games, Automata, Logics, and Formal Verification (GandALF 2026)

EPTCS 454, 2026, pp. 117–129, doi:10.4204/EPTCS.454.9

© M. Grobler, T. Koziel, S. Siebertz

This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike License.

Every Regular Language Has a Bipartite Cactus Automaton

Figure

(a) A natural NFA whose transition graph is planar, but not a cactus

Figure

(b) An equivalent NFA whose transition graph is a tree

Figure 1: Two ε\varepsilon-free NFAs recognizing {aa,bb,cc}\{aa, bb, cc\}

finite automata with restricted state graphs [16], and, in the deterministic setting, the genus of regular languages [4, 5, 6].

We strengthen the results of Thompson and of Book and Chandra by proving the following theorem.

Theorem 1.1.

For every regular language, there exists an ε\varepsilon-free NFA that recognizes the language and has a bipartite cactus transition graph.

Like Thompson’s proof, our proof proceeds by structural induction over a regular expression. However, we first decompose the expression into its even and odd parts, in such a way that every Kleene star is applied to an even language. We then maintain an explicit bipartition throughout the construction. After deleting the initial state, the automaton consists of independent components with exactly one entry each. Every non-initial source of a transition into an accepting state is joined to the initial state by a unique path in the corresponding local graph. This simple invariant is what we use for the Kleene-star construction: adding an edge between the ends of such a path creates at most one new cycle and cannot make two cycles overlap. Our constructions use state duplication to avoid the introduction of ε\varepsilon-transitions. The graph-theoretic part of the proof consequently uses only that cacti are preserved when they are joined at a single vertex or by a bridge, and when an edge is added between two vertices joined by a unique path.

Our theorem has the nice consequence that Courcelle’s theorem applies: every fixed MSO2MSO_{2}-definable property of the transition structure can be decided in linear time, while standard extensions cover broad classes of counting and optimization problems [10, 1]. Furthermore, many problems can additionally be solved with constant-workspace in polynomial time algorithms on cactus graphs, see [9].

References (16)