Manuscript Offprint
arXiv:2610.11717Every Regular Language Has a Bipartite Cactus Automaton
Mario Grobler
University of Bremen
Bremen, Germany
Till Koziel
RWTH Aachen University
Aachen, Germany
Sebastian Siebertz
University of Bremen
Bremen, Germany
Thompson’s classical construction turns every regular expression into an equivalent -NFA whose transition graph is series-parallel. The construction uses -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 -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 -NFA whose transition graph is series-parallel. This gives a simple structural representation of regular languages, but it relies on -transitions. The usual elimination procedure introduces labelled shortcut transitions along -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 -free NFA for whose transition graph is . This graph is series-parallel, but it is not a cactus: every edge belongs to two cycles. The right automaton is an equivalent -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 -transitions are not allowed [7]. They proved that every regular language is recognized by an -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

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

(b) An equivalent NFA whose transition graph is a tree
Figure 1: Two -free NFAs recognizing
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 -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 -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 -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].
An alphabet is a finite set of symbols. A word over is a finite sequence with for every ; the case gives the empty word . The set of all words over is denoted by . A nondeterministic finite-state automaton (NFA) is a tuple , where is a finite set of states, is a transition relation, is the initial state, and is the set of accepting states. For states , we write for the set of labels on transitions from to .
A run of on a word is a sequence of states such that and for every . The run is accepting if . The language accepted by is has an accepting run on . The languages accepted by NFAs are exactly the regular languages.
The regular expressions over are defined inductively. The expressions , , and , for every , are regular expressions, and if and are regular expressions, then so are , , and . Their languages are given by , , , , , and . The languages defined by regular expressions are precisely the regular languages.
For , a language has parity if for every . The empty language has either parity. We use addition of parities modulo 2.
All graphs in this paper are finite, simple, and undirected. For distinct vertices of a graph , we write for the graph obtained by adding the edge if it is not already present. For , we denote by the subgraph induced by . For an edge , we write for the graph obtained by removing , and for , the graph obtained by deleting and all edges incident with it is denoted by . An edge of a graph is a bridge if deleting increases the number of connected components. A vertex is a cut vertex if deleting it increases the number of connected components. A block is a maximal connected subgraph that has no cut vertex of its own. In particular, every bridge together with its endpoints forms a block, and every isolated vertex forms a block. A connected graph is a cactus if every edge belongs to at most one cycle. Equivalently, any two cycles of a cactus have at most one vertex in common. Another equivalent characterization is that every block containing an edge is either a single edge or a cycle.
We use the following elementary closure properties of cacti.
Lemma 2.1
The following operations preserve cacti.
-
Take cacti that are otherwise vertex-disjoint, choose one vertex in each, and identify all chosen vertices to a single common vertex.
-
Take two vertex-disjoint cacti and add one edge with one endpoint in each of them.
-
Let be a cactus and let be distinct. If has a unique -y path, then is a cactus.
Proof. For the first statement, every cycle remains inside one of the original graphs, because a cycle cannot pass through the identified vertex twice. The edge added in the second statement is a bridge and therefore belongs to no cycle.
For the third statement there is nothing to prove if is already an edge. Otherwise, let be the unique -y path in . No edge of belongs to a cycle of : such a cycle would provide an alternative path between the endpoints of that edge, and hence an alternative -y path. The only new cycle in is therefore , and none of its old edges belonged to a cycle before. Thus every edge of the new graph still belongs to at most one cycle.
For an automaton , its transition graph is , where if and only if and there exists such that either or . Thus directions and labels are forgotten, we have no multi-edges and and loops give no edge. This is natural, as it is common
Every Regular Language Has a Bipartite Cactus Automaton
to depict multiple transitions between the same states that have the same direction as a single arc with multiple labels and, as we will show below, our automata will not have loops.
Graph properties of an automaton always refer to , and connected components of an automaton mean connected components of . We will only consider automata with connected transition graphs and no loops, i.e. transitions of the form .
A map is a transition-compatible coloring of if for every transition . In particular, an automaton with such a coloring has no loops, and is a proper 2-coloring of its transition graph. If , then every run of length ends in a state of color . Every coloring discussed in the sequel will be transition compatible, in particular, at no point loops are introduced.
3 From regular expressions to cactus automata
In this section, we prove Theorem 1.1. We first separate a regular expression into its even and odd parts. This is a simple special case of typed regular expressions with types in a finite monoid, which were considered e.g. by Bojańczyk [3, Section 2.1]. The parity typing below is their specialization to the length morphism . What we call parity normal form is a specialization of [3, Theorem 3], applied to the product of a morphism recognizing and the length-parity morphism. We give a proof of the normal form lemma for completeness and for the graph theorists among us. We can then carry a bipartition through the whole construction. The cactus property is maintained directly using the elementary operations from Lemma 2.1.
3.1 Parity normal form
We call a regular expression typed with parity if it is obtained by the following rules. The expression may be given either parity, has parity 0, and every letter has parity 1. The union of two expressions of parity has parity , the concatenation of expressions of parities and has parity , and the star of an expression of parity 0 has parity 0. Here and below, parities are added modulo 2. An immediate induction shows that the language of an expression typed with parity has parity .
Lemma 3.1 (Parity normal form).
For every regular expression , there are regular expressions and , typed with parity 0 and 1, respectively, such that for . Moreover, every star occurring in or is applied to an expression of parity 0.
Proof. We proceed by induction over r. For the atomic expressions, put
For union, define . For concatenation, define
These expressions clearly have the asserted types and languages.
It remains to consider . Put and , and define
Both and have parity 0, so all new stars are applied to even expressions. To verify the languages, fix a factorization of a word in into factors from and classify every factor as even or odd. Grouping consecutive even factors gives a factorization , where and . If is even, pair , then , and so on. The resulting factorization belongs to . If is odd, leave unpaired and pair , then , and so on. The factorization belongs to . Conversely, every word produced by either expression is a product of factors from , and the displayed pairing shows that the number of odd factors is even in the first expression and odd in the second. These are precisely the even and odd words in .
Throughout the automata constructions below, when we speak of copies, sometimes indexed by a specified symbol, we always mean fresh, pairwise disjoint, and disjoint from every newly introduced state, unless we explicitly identify specified states. In particular, if are indices and is some set of states, then and denote copies of , where is the copy of , for , with . Moreover, if and only if . If no explicit index is mentioned, then it shall be implied that a the copies are labeled by a unique but otherwise unspecified index. Each constructed automaton contains exactly the states and transitions that are stated in its construction, and a copied state is accepting exactly when its accepting mark is explicitly retained.
We now inductively construct automata for typed expressions. For an automaton , we define the possible labels of a last transition at a state by for some .
To guarantee the stronger graph structure, we introduce strongly cactus automata. The initial state s separates the transition graph into rooted components. Each component has exactly one entry state, contains at least one accepting state, and has no transition back to s. The additional invariant is simple: every non-initial possible source of a last transition is joined to s by a unique path in its local graph.
Definition 3.2 (Strongly cactus automaton of parity p).
Let , let be a connected NFA, and let be the connected components of . Put . We call strongly cactus of parity if it has a coloring such that the following conditions hold.
-
The coloring is transition-compatible, , and for every .
-
The graph is a cactus, and no transition enters s.
-
For every , the set for some consists of one state , called the entry state of , and .
-
For every with , the local graph has a unique s-g path.
Transitions are the ingoing transitions of , and transitions with both endpoints in are its internal transitions. The initial state itself may be accepting.
For a component of , we call its local graph. Thus two local graphs of the same automaton have only the initial state in common.
By the first condition, is bipartite, and every word in has parity p. By the second condition, its transition graph is a cactus. We call the vertices in Condition 4 exposed. Notice that the unique path from s to an exposed vertex consists entirely of bridges of the local graph.
Every Regular Language Has a Bipartite Cactus Automaton
3.2 The atomic expressions
The atomic typed expressions easily translate into strongly cactus automata.
Lemma 3.3 (Automata for the atomic languages).
The empty language has a strongly cactus automaton of either parity. There are strongly cactus automata of parity 0 and 1 accepting and , respectively, for every .
Proof. The following three automata recognize , , and , respectively.

Figure 2: The atomic automata for , , and , in this order.
The first automaton may be assigned either parity. Color the only state of each of the first two automata by 0, and color s by 0 and f by 1 in the third. Their transition graphs have at most one edge, and deleting the initial state leaves at most one component. All conditions in Definition 3.2 are immediate.
3.3 Closure under union
Let , and let and be strongly cactus automata of parity . Take disjoint copies of and , identify their initial states, and call the identified state . Keep all transitions and accepting states. Thus is accepting if and only if or . Denote the resulting automaton by .
Lemma 3.4.
The automaton constructed above is strongly cactus of parity and satisfies .
Proof. The empty word is accepted precisely when it is accepted by A or by B. Every non-empty run of U chooses, in its first step, a component from one of the two automata. Since no transition enters and there are no transitions between different components, the run stays on that side. Hence .
The two colorings agree at their initial states, which both have color 0, and therefore combine into a transition-compatible coloring of U. All accepting states have color p. The components of are exactly the components of and , copied disjointly. Their entries, accepting states, and exposed vertices are unchanged. The two graphs meet only in , so their union is a cactus by Lemma 2.1. No transition enters the identified initial state. Therefore U is strongly cactus of parity p.
3.4 Closure under concatenation
Let and be strongly cactus of parities and , respectively. Put . If is empty, then has no component by Condition 3 of Definition 3.2. Since its transition graph is connected, consists only of its non-accepting initial state, and . In this case the one-state automaton for the empty language, assigned parity , recognizes . We therefore assume that .
We construct an automaton as follows.
-
Introduce a fresh initial state and declare it accepting if and only if and .
-
If , take copies of all components of , copy their internal transitions, and copy every transition from to an entry state as a transition from to the corresponding copied entry state. Keep all copied accepting states. These components deal with an empty first factor.
-
For every with , let be the component of containing . Take one copy of this component and one copy of the whole automaton , whose copied initial state is denoted by . Copy all internal transitions of and all transitions of , but erase the accepting marks in . Copy the ingoing transitions of as transitions from , and add for every . Keep all accepting states of .
-
If , take one copy of , with copied initial state . For every , add , and keep all accepting states of this copy. Since no transition enters , an accepting run of whose last transition has source consists of that single transition. The new transition therefore reads the entire one-letter first factor and places the run at the initial state of the copied automaton . One copy of suffices for all such labels.
The original transitions from g into accepting states of A are retained in , but their targets are no longer accepting there. Hence a run may pass an earlier visit to an old accepting state and choose a later occurrence of a possible last transition as the boundary between the two factors.
Lemma 3.5
The automaton constructed in Steps 1–4 is strongly cactus of parity and satisfies .
Proof. By Step 1, is accepted exactly when . Let and . If and is non-empty, the components from Step 2 simulate an accepting run of on . If also , Step 1 applies. Suppose that is non-empty, choose an accepting run of on , and let be its last transition. If , use the component from Step 3 indexed by : simulate the run up to in , take the bridge labeled to , and then simulate an accepting run of on . If , the accepting run of has length one because no transition enters . Step 4 uses its label to enter and then simulates the run of . This also covers when the copied initial state of is accepting. Thus .
Conversely, the empty run is accepting only in the case already handled by Step 1. Let a non-empty accepting run of be given. If it enters a component from Step 2, erasing the copy indices gives an accepting run of , while supplies the empty first factor. Otherwise the run enters a component from Step 3 or Step 4. All accepting marks in the copied A-component were erased, so in Step 3 the run must use one of the bridge transitions from to . If this transition has label , the definition of gives a transition into an accepting state of . Replacing the bridge by this transition and erasing the copy indices gives an accepting run of on the prefix. The part after the bridge gives an accepting run of on the suffix. In Step 4, the first transition corresponds directly to a transition into an accepting state of , and therefore supplies a one-letter first factor. Hence every accepted word belongs to .
We define the coloring of the new automaton. Color by 0. In every copied A-component, retain the coloring . In every Step 2 copy, retain . This step can occur only when , because has color 0 and is accepting. In every Step 3 copy , use the shifted coloring . The source of the bridge has color 1 - p, whereas has color p, so the bridge changes color. Finally, Step 4 can occur only when : a transition from into an accepting state changes the color from 0 to 1. We therefore use the
Every Regular Language Has a Bipartite Cactus Automaton
shifted coloring in this copy. Every transition changes color, and all accepting states have color .
The local graph of a component from Step 2 is a copied local graph of B. For Step 3, it consists of a copied local graph of A and a copy of joined by the bridge . For Step 4, it is a copy of joined to by a bridge. It follows from Lemma 2.1 that every local graph, and then their union at , is a cactus. There is one entry in every component, every component contains an accepting state of the copied automaton B, and no transition enters .
It remains to verify that every non-initial possible source of a last transition is exposed. Components from Step 2 inherit this property from B. Consider a Step 3 component indexed by g. If is accepting, then is the source of a transition into an accepting state. The copied local graph of A has a unique path, because g is exposed in A.
Every other possible source of a last transition lies in the copy . There is a unique path from to : it is the unique path followed by the bridge . If the source is , this is the required path. If it is a state , then is exposed in , and the unique -h path in the corresponding copied local graph extends the path from to . Since the bridge is the only connection between the two copied graphs, the resulting path is unique.
Finally, a Step 4 component is a copy of attached to by the bridge . The same argument, now with this bridge as the initial segment, shows that all non-initial possible sources of last transitions in this component are exposed. Therefore is strongly cactus of parity .
3.5 Closure under Kleene star for even languages
Let be strongly cactus of parity 0, and let be a coloring witnessing this. Recall that for , for some . Put . Our aim is to construct a strongly cactus automaton for . The equality holds because empty factors can be removed from every product without changing the resulting word.
The naive suppression of -transitions does not guarantee to yield an automaton with a cactus transition graph, as the example depicted in Figure 3 illustrates.

(a) A strongly cactus automaton of parity 0

(b) The same automaton with -transitions

(c) Suppressing -transitions

(d) Alternative for suppressing -transitions
Figure 3: Example of naive suppression
We make two observations. First, . Indeed, both and every accepting state have color 0, whereas every transition must change color. Thus the source of the last transition of a non-empty accepting run is never . Put . Hence is the set of non-initial states from which a transition into an accepting state is available. In particular, the source of the last transition of every non-empty accepting run belongs to . Second, no transition enters . Once a run leaves , it therefore cannot return to and remains in one component of .
For , let be the component of containing , and let be its unique entry state. A run whose last-transition source is uses only and states of . For , let consist of all words such that has a run from to on and . Then . Indeed, if is the last transition of a non-empty accepting run, then and the word read by the run belongs to . Conversely, the definition of shows that every word in is accepted by . Different states may lie in the same component of . In that case . The copies indexed by and below are nevertheless fresh and disjoint.
We now explain the construction in detail. First, take a copy of the entire automaton with states for every . The copied states retain their accepting marks and their coloring. For every , we construct a new gadget as follows.
Take fresh copies , of all states and transitions of . If , remove the accepting mark from the copied state . All other copied states retain their accepting mark. We call the copied components of terminal modules of . For each let be fresh copies of the states and transitions of the component . Each copied state of retains the color of the corresponding original state. We call return modules of . All states in have their accepting marks erased. Denote as the restart state of and attach each return module via the copied ingoing transitions , for each .
Now, for each add return transitions for . These transitions ensure that a run can continue after reading a word . Attach each to via bridge transitions for . Finally, make accepting, to account for the empty word. This is permissible, since no transitions enters . Let the resulting automaton be denoted by . For all copied states with corresponding original state define .
The coloring defined in the construction is transition-compatible for . This coloring is transition compatible on states . For it holds that , since is of parity 0. Thus respects transition-compatibility. Similarly, for , , so remains transition-compatible. The transition-compatibility of the coloring for all other states and transitions follows suit.
This replaces the usual -transitions in the standard star construction. We cannot return to the genuine initial state , because no transition may enter the initial state of a strongly cactus automaton. Note why we cannot make the restart state accepting. Otherwise, the sources of the return transitions would become possible sources of last transitions, even though they may lie on the cycles closed by those return transitions. This would violate the exposed-source condition.
Figure 4 illustrates the construction when has only one component and two states , with transitions and into accepting states. The figure shows the gadget . There is a separate gadget for a first factor whose last-transition source is .
Lemma 3.6
Let . The words read by runs of that start at and end in an accepting state of are precisely the words in . Moreover, the transition graph of is a cactus and for every terminal module, every source of a transition into a copied accepting state is joined to by a unique path.
Every Regular Language Has a Bipartite Cactus Automaton
(a) The original automaton A with component C
(b) The gadget of

all four choices are available whenever the run is at
Figure 4: A schematic example with one original component and two possible last-transition sources g and h. The thick transition completes the first factor and reaches the private restart state . The other thick arrows illustrate a possible continuation whose next factor has last-transition source h and whose final factor has last-transition source g. After every return, all four modules are available again. The component , used when the first factor ends through h, is shown only schematically. Only the relevant vertices and transitions are shown.
Proof. Consider a traversal of a return module . Replace its final transition by any transition witnessing , replace by , and erase the copy indices. This gives an accepting run of on the same word. Conversely, every run witnessing that a word belongs to can be copied into and completed by the corresponding transition back to . Thus the return modules together read precisely the words in and return to .
The terminal modules together with are an unmodified copy of . As such, the terminal modules together read precisely the words in and end in an accepting state. The modules meet only at , and the only transitions entering are the final transitions of return modules. Since is not accepting, every accepting run consists of zero or more traversals of return modules followed by one traversal of a terminal module. It therefore reads a word in .
Conversely, let , where and for every . For every , choose with . For , read in the return module . After each of these factors the run is again at , so the choice of is independent of . Finally, read in the terminal module , which contains a copy of the chosen accepting run of on . This gives an accepting run of the gadget on .
It remains to verify the graph properties. For , put . The local graph of a terminal module is a copy of , with replaced by , and is therefore a cactus. Let be the source of a transition into a copied accepting state in this module. Then is exposed in , so has a unique path. Its copy is the unique path in the terminal module.
The local graph of the return module is obtained from a copy of by adding the edge . Since is exposed in , the graph has a unique path. Hence adding this edge preserves the cactus property by Lemma 2.1: it creates at most one new cycle.
All modules meet only at , so their union is again a cactus. Attaching the other modules at cannot create another simple path from to a vertex of a terminal module, because such a path would have to leave through another module and later return to . Thus the path to every possible last-transition source in a terminal module remains unique.
In the first copy two things can happen. A run may simply end in one of the accepting states retained in this copy. In that case it reads one non-empty factor from . Alternatively, it may use one of the new transitions from to . The run then starts with a copied transition , simulates a run of up to , and takes . This last transition reads the same letter as a possible final transition of . Hence the whole passage from to reads exactly one word from .
Once the run is at , it starts the next factor in exactly the same way as starts at : a copied transition enters either a return module or a terminal module , for . At the end of a middle factor, a transition reads its final letter and brings the run back to the same state . The run can repeat this step as often as desired. For the last factor it chooses a terminal module and ends in one of the accepting states retained there.
The states are private. If , then , even if . If two components shared the same restart state, then deleting would merge them and the resulting component would have more than one entry from . There would also be different paths from to the common restart state, which would destroy the unique-path property needed for the terminal modules.
The automaton consists exactly of a copy of and the components constructed above.
Lemma 3.7.
The automaton is strongly cactus of parity 0 and satisfies .
Proof. We first verify the accepted language. The empty run at accepts . The runs that remain in the first copy of together accept precisely the words in . Indeed, each such run is a copied non-empty accepting run of . Conversely, if has a non-empty accepting run and is the source of its last transition, then the run can be copied into the .
If a run uses the transition from to , its prefix up to reads a word from . By Lemma 3.6, the remaining part reads a word from . Hence the runs that use a restart state together accept precisely , the products of at least two words from . Consequently .
This also covers . Every non-empty accepting run of has a last transition whose source belongs to . Thus implies , and our construction leaves only the accepting initial state .
We next verify the graph conditions. For , recall that . The graph formed by and is a copy of , where is the copy of . The edge joins this graph to the cactus . It is a bridge because the two graphs are otherwise disjoint. Hence the local graph of is a cactus. All local graphs meet only at , so is a connected cactus by Lemma 2.1.
Deleting separates all components of from one another. A component of is of the form . The unique entry of is . It contains the accepting states retained in as well as the accepting states of its terminal modules. No transition enters ; return transitions enter only the private states .
It remains to verify the exposed-source condition. First let be the source of a transition into an accepting state retained in . Then is exposed in , so has a unique -h path. Its copy is the unique - path in the first part of . The bridge and the graph attached beyond it cannot create a second simple path to .
Now let be the source of a transition into an accepting state of a terminal module. Since is exposed in , the first copy has a unique path. Together with the bridge , this is the unique path. By Lemma 3.6, the vertex is joined to by a unique path. Concatenating the two paths gives the unique path from to .
Finally, retain the coloring in every copied component and color and all private states by 0. Every copied accepting state has color 0. Every entry state has color 1, because it is the endpoint of a transition from , which has color 0. Moreover, every has color 1, because it is the source of
Every Regular Language Has a Bipartite Cactus Automaton
a transition into an accepting state of color 0. Consequently every new transition changes color, and all copied internal transitions change color because is transition-compatible. We have verified all conditions of Definition 3.2. Therefore is strongly cactus of parity 0.
3.6 Proof of the main theorem
We first do the typed induction.
Theorem 3.8
Let and let be a regular expression typed with parity . Then there exists an NFA accepting that is strongly cactus of parity . In particular, its transition graph is a bipartite cactus.
Proof. Proceed by structural induction on the typed expression . The atomic cases are supplied by Lemma 3.3. If , the two subexpressions have the same parity, and Lemma 3.4 applies. If , apply Lemma 3.5. The parity of the result is the sum of the two input parities. Finally, if , the typing rules guarantee that has parity 0, and Lemma 3.7 applies.
Then we put together the typed automata.
Proof of Theorem 1.1. Let be a regular expression for the given language . By Lemma 3.1, there are expressions and typed with parity 0 and 1 whose languages are the even and odd parts of . By Theorem 3.8, choose strongly cactus automata and for these expressions. Apply the union construction of Lemma 3.4 to and . The resulting automaton recognizes and has a bipartite cactus transition graph.
4 Conclusion
We proved that every regular language is recognized by an -free NFA whose transition graph is a bipartite cactus. This is substantially more restrictive than planarity, and also more restrictive than general series-parallel structure: every cycle is even, and two cycles can meet only at a cut vertex. Cactus graphs have nice structural properties, that make some generally intractable problems solvable in polynomial or even linear time.
The proof is constructive, but its normalization and closure steps duplicate components and may introduce many auxiliary states. We have not optimized the construction or established tight state-complexity bounds. Determining the smallest possible blow-up, either as a function of the input automata or relative to a minimal DFA, is therefore a natural remaining problem.
For deterministic automata, genus and crossing-number parameters offer complementary ways to measure how far a regular language is from admitting a planar deterministic representation. Clarifying the hierarchies induced by these parameters, and comparing their behavior with the nondeterministic bipartite-cactus representations proved here, would sharpen the topological theory of regular languages.
Another direction is to identify which language-theoretic restrictions are forced by planarity, outerplanarity, or the cactus property in deterministic, unambiguous, and finitely ambiguous automata. It would also be useful to determine which additional automata-theoretic properties can be imposed simultaneously with a bipartite cactus transition graph while retaining a representation theorem for all regular languages.
References
[1] Stefan Arnborg, Jens Lagergren & Detlef Seese (1991): Easy Problems for Tree-Decomposable Graphs. Journal of Algorithms 12(2), pp. 308–340, doi:10.1016/0196-6774(91)90006-K.
[2] Ivona Bezáková & Martin Pál (1999): Planar Finite Automata. Student Science Conference, Comenius University, Bratislava.
[3] Mikołaj Bojańczyk (2008): The Common Fragment of ACTL and LTL. In Roberto M. Amadio, editor: Foundations of Software Science and Computational Structures, Lecture Notes in Computer Science 4962, Springer, pp. 172–185, doi:10.1007/978-3-540-78499-9_13.
[4] Guillaume Bonfante & Florian Deloup (2018): The Genus of Regular Languages. Mathematical Structures in Computer Science 28(1), pp. 14–44, doi:10.1017/S0960129516000037.
[5] Guillaume Bonfante & Florian L. Deloup (2019): Decidability of Regular Language Genus Computation. Mathematical Structures in Computer Science 29(9), pp. 1428–1443, doi:10.1017/S0960129519000057.
[6] Guillaume Bonfante & Florian L. Deloup (2024): The Genus of Regular Languages and Directed Graph Emulators. Theoretical Computer Science 1000, p. 114579, doi:10.1016/j.tcs.2024.114579.
[7] Ronald V. Book & Ashok K. Chandra (1976): Inherently Nonplanar Automata. Acta Informatica 6(1), pp. 89–94, doi:10.1007/BF00263745.
[8] Andreas Brandstädt, Van Bang Le & Jeremy P Spinrad (1999): Graph classes: a survey. SIAM, doi:10.1137/1.9780898719796.
[9] Boris Brimkov & Illya V. Hicks (2017): Memory efficient algorithms for cactus graphs and block graphs. Discrete Applied Mathematics 216, pp. 393–407, doi:10.1016/j.dam.2015.10.032. Graph-theoretic and Polyhedral Combinatorics Issues and Approaches in Imaging Sciences.
[10] Bruno Courcelle (1990): The Monadic Second-Order Logic of Graphs. I. Recognizable Sets of Finite Graphs. Information and Computation 85(1), pp. 12–75, doi:10.1016/0890-5401(90)90043-H.
[11] L. C. Eggan (1963): Transition Graphs and the Star-Height of Regular Events. Michigan Mathematical Journal 10(4), pp. 385–397, doi:10.1307/mmj/1028998975.
[12] Samuel Eilenberg (1974): Automata, Languages, and Machines, Volume A. Pure and Applied Mathematics 59, Academic Press, New York.
[13] John E. Hopcroft, Rajeev Motwani & Jeffrey D. Ullman (2006): Introduction to Automata Theory, Languages, and Computation, 3 edition. Addison-Wesley.
[14] Stephen C. Kleene (1956): Representation of Events in Nerve Nets and Finite Automata. In Claude E. Shannon & John McCarthy, editors: Automata Studies, Annals of Mathematics Studies 34, Princeton University Press, Princeton, NJ, pp. 3–42, doi:10.1515/9781400882618-002.
[15] Dexter C. Kozen (1997): Automata and Computability. Undergraduate Texts in Computer Science, Springer, New York, doi:10.1007/978-1-4612-1844-9.
[16] Martin Kutrib, Andreas Malcher & Christian Schneider (2022): Finite Automata with Undirected State Graphs. Acta Informatica 59(1), pp. 163–181, doi:10.1007/s00236-021-00402-0.
[17] Michael O. Rabin & Dana Scott (1959): Finite Automata and Their Decision Problems. IBM Journal of Research and Development 3(2), pp. 114–125, doi:10.1147/rd.32.0114.
[18] Ken Thompson (1968): Programming Techniques: Regular Expression Search Algorithm. Communications of the ACM 11(6), pp. 419–422, doi:10.1145/363347.363387.