Finite automata with undirected state graphs

We investigate finite automata whose state graphs are undirected. This means that for any transition from state p to q consuming some letter a from the input there exists a symmetric transition from state q to p consuming a letter a as well. So, the corresponding language families are subregular, and in particular in the deterministic case, subreversible. In detail, we study the operational descriptional complexity of deterministic and nondeterministic undirected finite automata. To this end, the different types of automata on alphabets with few letters are characterized. Then, the operational state complexity of the Boolean operations as well as the operations concatenation and iteration is investigated, where tight upper and lower bounds are derived for unary as well as arbitrary alphabets under the condition that the corresponding language classes are closed under the operation considered.


Introduction
The operation problem for a language family is the question of costs (in terms of states) of operations on languages from this family with respect to their representations.More than two decades ago, the operation problem for regular languages represented by deterministic finite automata as studied in [14,15] renewed the interest in descriptional complexity issues of finite automata in general.In the meantime, impressively many results have been obtained for a large number of language families.It seems that the recent studies of operational state complexity focus on subregular languages.A recent survey of the several branches and details can be found in [4], which is also a valuable and comprehensive source of references.Already since the early days of automata theory, a significant theory on subfamilies of regular languages has been developed in the literature.Examples of early studied classes are finite languages, definite languages and variants, star-free languages, etc.Some of these regular subfamilies were motivated by particular issues such as, for instance, neural nets or circuit design.A list of some of these early regular subfamilies, their structure, and their properties was already given by Havel [5,6].
Since then, new developments in the theory of computer science triggered the study of new subregular language families.For instance, deterministic expression languages or oneunambiguous regular languages [2] are motivated from document type definitions (DTDs) used in standard generalized markup language (SGML) and extensible markup language (XML) schemes.In particular, the determinization of nondeterministic finite automata that accept some subregular languages has been investigated in detail [1].In most cases, it turned out that the conversion problem is nearly as costly (in terms of the number of states) as in the general case.
Subregular language families of particular interest are the families of languages accepted by types of reversible finite automata.Reversibility is a fundamental principle in physics.Since abstract computational models with discrete internal states may serve as prototypes of computing devices which can physically be constructed, it is interesting to know whether these abstract models are able to obey physical laws.The observation that loss of information results in heat dissipation [12] strongly suggests to study computations without loss of information.Recent results on reversible finite automata can be found, for example, in [7][8][9]13].
Here, we are interested in a strict form of reversible finite automata, namely we do not only require that every state of the automaton has a unique predecessor for a given input letter, but that this predecessor can already be reached by a forward transition with the same input letter.These automata can be seen as finite automata whose state graphs are undirected.So, this notion is even stronger than the concept of time-symmetry studied in [3,11].Time-symmetry appears in physics when a system can go back in time by applying the same transition function as for forward computations after a weak transformation of the phase-space.For example, in Newtonian mechanics one can go back in time by applying the same dynamics after a transformation that leaves masses and positions unchanged but reverses the sign of the momenta.While time-symmetric machines themselves cannot distinguish whether they run forward or backward in time, for undirected automata the time directions fade away since they are both available in the transition.
In the next section, we present the necessary notations and give an introductory example.Since the definition of undirected finite automata implies strong restrictions on the possible state graphs and, thus, the possible automata themselves, it is possible to characterize the different types of undirected automata with small alphabets in Sect.3.These characterizations are a powerful tool to derive tight bounds on the operational state complexity of deterministic (Sect.4) and nondeterministic (Sect.5) undirected finite automata.All bounds obtained are summarized in Table 1.Finally, in Sect.6, we discuss open and untouched problems for future work.

Preliminaries
Let * denote the set of all words over the finite alphabet .The empty word is denoted by λ, and + = * \ {λ}.The reversal of a word w is denoted by w R .For the length of w we write |w|.For the number of occurrences of a symbol a in w, we use the notation |w| a .Set inclusion is denoted by ⊆ and strict set inclusion by ⊂.We write 2 S for the power set and |S| for the cardinality of a set S. A nondeterministic finite automaton (NFA) is a system Q, , δ, q 0 , F , where Q is the finite set of internal states, is the finite set of input symbols, q 0 ∈ Q is the initial state, F ⊆ Q is the set of accepting states, and δ : Q × → 2 Q is the transition function.
A finite automaton is deterministic (DFA) if and only if |δ(q, a)| = 1, for all states q ∈ Q and letters a ∈ .In this case, we simply write δ(q, a) = p instead of δ(q, a) = {p} assuming that the transition function is a mapping δ : So, by definition, any DFA is complete, that is, the transition function is total, whereas it may be a partial function for NFAs in the sense that the transition function of nondeterministic machines may map to the empty set.
If the state graph induced by some finite automaton is undirected, then we obtain the subclasses of nondeterministic undirected finite automata (NUFA) and deterministic undirected finite automata (DUFA).Formally, for undirected finite automata, it is required that q ∈ δ( p, a) if and only if p ∈ δ(q, a), for all p, q ∈ Q and a ∈ .The language accepted by a finite automaton M is where the transition function is recursively extended to δ : In order to illustrate the definitions, we continue with an example.

Characterization of undirected finite automata with small alphabets
The definition of undirected finite automata implies strong restrictions on the possible state graphs and, thus, the possible automata themselves.These restrictions allow only a very few different state graphs for minimal deterministic undirected finite automata with a unary or binary input alphabet.The situation for nondeterministic automata is still rather restricted, but there are more types of distinguishable state graphs.The following characterizations of possible types of state graphs is used for later results on the closure properties of the families of accepted languages as well as their operational state complexity.In the rest of the section, we tacitly assume = {a} for unary languages and = {a, b} for binary languages.

Unary and binary deterministic undirected finite automata
The situation for unary deterministic undirected finite automata is straightforward.The only two possible state graphs are depicted in Fig. 2. Any of the states can be made accepting or rejecting which yields four different languages that are accepted by unary DUFAs.
Corollary 1 Let M be a unary DUFA.Then, language L(M) is one of the following: 123 Fig. 2 Possible state graphs of unary deterministic undirected finite automata We continue with the analysis of possible state graphs of deterministic undirected finite automata accepting binary languages.
Theorem 1 Let M be a minimal binary DUFA.Then, its state graph is of one of the five types shown in Fig. 3.
Proof Let M = Q, {a, b}, δ, q 0 , F be a binary DUFA.First, we consider the cases where δ(q 0 , a) = δ(q 0 , b).If δ(q 0 , a) = δ(q 0 , b) = q 0 then the transition function is fully specified and the state graph of M is of type 1 in Fig. 3.
If δ(q 0 , a) = δ(q 0 , b) = q 0 , then there is a new state, say state q 1 , such that δ(q 0 , a) = δ(q 0 , b) = q 1 .Since M is symmetric, again the transition function is fully specified.Now, the state graph of M is of type 2 in Fig. 3.
For the remaining cases, we assume δ(q 0 , a) = δ(q 0 , b).Now, we can distinguish two subcases.The first subcase is given when one transition is a loop from q 0 to q 0 , while the other goes to some new state q 1 .So, let us first assume δ(q 0 , a) = q 0 and δ(q 0 , b) = q 1 .Then, all transitions from state q 0 are specified.Due to the symmetry, the only transition missing is δ(q 1 , a).Here a loop from q 1 to q 1 is possible or a transition to another new state q 2 .For the case δ(q 1 , a) = q 1 , the transition function is fully specified and we have a state graph of type 3 with n = 1.For the case δ(q 1 , a) = q 2 , the only missing transition is δ(q 2 , b).Now, the argumentation used for q 1 applies.Since the number of states is finite, eventually we end up with a loop transition and obtain a state graph of type 3.
The second subcase is given when both transitions δ(q 0 , a) and δ(q 0 , b) go to different new states, say q 1 and p 1 .Then all transitions from state q 0 are specified.The transitions missing are δ(q 1 , b) and δ( p 1 , a).For both branches of the state graph we can argue as before for type 3.If one branch ends in a loop from a state to itself, the other branch necessarily ends also in a loop from a state to itself.The lengths of the branches determine the numbers m, n ≥ 1 and the state graph is of type 4. Finally, if one branch does not end in a loop, but with a transition to some state of the other branch, then the other branch does not end in a loop as well (due to the symmetry).In this case, both branches are connected such that the state graph becomes a cycle, that is, it is of type 5. Since no more cases exist, the assertion follows.

Unary nondeterministic undirected finite automata
In this subsection, we turn to the possible state graphs of unary NUFAs.
Theorem 2 Let M be a unary NUFA.Then, language L(M) is of one of the following types: Proof Let M = Q, {a}, δ, q 0 , F be an NUFA with unary input alphabet.Basically, the type of the accepted language is determined by two numbers (if they exist) k ≥ 0 and l > k.The number k is defined to be the shortest path from the initial state q 0 to some accepting state q + ∈ F. If k exists, that is, if L(M) is non-empty, then l is defined dependent on whether k is even or odd.If k is even, l is defined to be the shortest path longer than k that leads from Fig. 4 State graph of a minimal nondeterministic undirected finite automaton accepting the language L 3,k or L 4,k the initial state q 0 to an accepting state q + and has odd length.If such a path does not exist, l remains undefined.Similarly, if k is odd then l must be even.Now, we can determine the type of L(M).If there is no path from q 0 to some accepting state then L(M) = L 1 = ∅.Otherwise the number k is defined.
If k = 0 and, thus, Next, assume that k is defined, δ(q 0 , a) is defined, and l is undefined.Since M is undirected we obtain q 0 ∈ δ(q 0 , a 2 ).We conclude that a k belongs to L(M) and, for all i ≥ 0, the input a k+2i belongs to L(M) as well.Since l is undefined there are no words whose parity is different from Finally, let k, δ(q 0 , a), and l be defined.As before we may conclude that the input a k+2i belongs to L(M), for all i ≥ 0. On the other hand, since l is defined and l > k, we also have a l+2i ∈ L(M), for all i ≥ 0. The parities of k and l are different.Therefore, all words a l+i , for i ≥ 0, belong to L(M).This implies Note that all language types are different and are, in fact, accepted by some NUFA.
Note that the languages { a n | n ≥ k } are equal to L 5,k,k+1 , if k is even, and equal to L 6,k,k+1 , if k is odd.Next, we turn to the minimal numbers of states that are necessary for some NUFA to accept languages of different type.
Lemma 1 Let M be a unary NUFA that accepts a language of type L 1 or L 2 .Then, one state is sufficient and necessary for M.
Proof Clearly, one non-accepting initial state for which the transition function is undefined is a witness when M accepts the empty set.
Similarly, if the initial state whose transition function is undefined is accepting, then M accepts the language {λ}.Lemma 2 Let k ≥ 1 and M be a unary NUFA that accepts a language of type L 3,k or L 4,k .Then, k + 1 states are sufficient and necessary for M.
Proof Since the shortest word accepted has length k, automaton M must have at least k + 1 states.Otherwise, L(M) would be empty or a shorter word would be accepted.The NUFA depicted in Fig. 4 accepts L 3,k or L 4,k with k + 1 states.Lemma 3 Let k ≥ 0, l > k, and M be a unary NUFA that accepts a language of type L 5,k,l or L 6,k,l .Then, l states are sufficient and necessary for M.
Proof Since the shortest word accepted has length k, automaton M must have at least k + 1 states.If l = k + 1, the assertion follows.
In contrast to the assertion, assume now that M has k +1 ≤ j < l states.Since a l ∈ L(M), there is a loop passed through in an accepting computation on input a l .Let m ≥ 1 be the Consider the sequence of l + 1 states p 0 , p 1 , . . ., p x , with p x accepting, passed through in an accepting computation of a l .Then, we let M accept a l−m along the same sequence with leaving out the loop.
First assume that at least two of the states in the sequence belong to the loop left out, say p i and p j with i < j.While M runs through the loop from p i to p i via p j , it reads an odd number of input symbols.So, either the computation from p i to p j or the computation from p j on the loop back to p i consumes an odd number of input symbols, but not both since the total length of the loop is odd.Since M is undirected, once in state p i , M can reach p j by following the loop or following the loop backward.On one path, it reads an even, and on the other path, it reads an odd number of input symbols.Continuing the computation from p j to p x gives in both cases a computation with less than l steps.However, only words of even or words of odd lengths less than l belong to L(M).We derive from the contradiction that exactly one state in the sequence p 0 , p 1 , . . ., p x belongs to the loop left out.
If there are more than one of such loops, the sum of their lengths must be odd.This implies that at least one has an even and at least one of them has an odd length.So, running through this one or that one gives accepted inputs of different parities shorter than l, a contradiction.This implies that there is exactly one such loop that involves exactly one of the states, say p i .We conclude that all states p i , 0 ≤ i ≤ x are different.Moreover, x + m must be l, and all states on the loop are different.Therefore, altogether x + 1 + m − 1 = x + m = l states are necessary.
The NUFA depicted in Fig. 5 accepts L 5,k,l or L 6,k,l with l states.

Deterministic operational state complexity
In this section, we investigate the operational state complexity of DUFAs.Let • be a binary operation under which the class of languages accepted by DUFAs is closed.The •-operation problem for DUFAs can be defined as follows: -Given some m-state DUFA A and some an n-state DUFA B.
-How many states are sufficient and necessary (in terms of m and n) for a DUFA to accept the language L(A) • L(B)?
The tight lower bounds for union, intersection, and concatenation of unary DFAs require m and n to be relatively prime Obviously, this problem generalizes as well to unary language operations like, for example, complementation.Moreover, it also generalizes to other devices.The notion state complexity is used when the size of the finite automata is measured by their number of states.
Let L 1 and L 2 be languages over some alphabet .In the following, we are particularly interested in the Boolean operations complementation The results on the deterministic state complexity obtained in this section, and the results on the nondeterministic state complexity that is obtained in Sect. 5 are summarized in Table 1.
In order to compare the operational state complexities of DUFAs and NUFAs with classical deterministic and nondeterministic finite automata, we summarize the latter complexities in Table 2 (see, for example, [4] for details and references).
Before we can turn to study the operational state complexity of DUFAs under the abovementioned operations, we have to give evidence under which operations their language class is not closed.The evidence of the closure under the remaining operations follows from the subsequent considerations of their state complexities.
The family of languages accepted by DUFAs is neither closed under concatenation nor under iteration.In the unary case, we have just the four languages from Corollary 1. Con-catenating L 2 = a * with L 4 = { a n | n is odd } yields a unary language that contains words of even as well as odd length, but does not contain the empty word.Thus, this language is not accepted by any DUFA.The iteration of L 1 = ∅ yields the language {λ} that is not accepted by any DUFA either.This is already sufficient to show the non-closure under concatenation and iteration also in the general case.For the sake of completeness, we give non-unary examples witnessing the non-closure as well.Let A and B be the following DUFAs: The shortest word in L(A) • L(B) is ab.So, a DUFA accepting L(A) • L(B) must have the following state sub-graph: However, we have ab ∈ L(A) and b ∈ L(B) but abb cannot be accepted by any DUFA with a state sub-graph as depicted.
Concerning the iteration, we consider the DUFA A with the following state graph: Assume there is a DUFA B that accepts L(A) * .Since λ ∈ L(A) * , the initial state of B is accepting.Moreover, the word ab belongs to L(A) * .This implies that aa is accepted by B as well, but aa / ∈ L(A) * .The question whether the family of languages accepted by DUFAs is closed under reversal in the non-unary case is currently open.For the special case that the DUFAs have only one accepting state the closure follows by running the DUFAs backward, that is, the unique accepting state and the initial state switch their roles.However, this construction fails for more than one accepting state and, due to the symmetry, the usual trick to add an extra state and appropriate transitions fails as well.
We continue with the operational state complexity of DUFAs on unary alphabets.It has been shown in Corollary 1 that in this case, the automata have an easy form which makes it possible to show closure under the Boolean operations and reversal, and to establish upper and lower bounds for each of the operations.In the second part of the section, we investigate the state complexity of the Boolean operations for DUFAs over arbitrary alphabets and can establish tight bounds as well.
Theorem 3 Let m, n ∈ {1, 2} be integers and A be a minimal m-state and B be a minimal n-state DUFA over the same unary alphabet.Then one state is sufficient for a DUFA to accept

Table 3 Summary of the results for the union and intersection of languages accepted by unary DUFAs
Moreover, there are minimal m-state DUFAs and minimal n-state DUFAs such that these sufficient numbers of states are necessary.
Proof Owing to Corollary 1, we know that every language that is accepted by a unary DUFA has one of the following forms, namely For L 1 and L 2 one state and for L 3 and L 4 two states are necessary.Now, we have to show that any application of the operations complementation, intersection, union, or reversal gives again one of the four unary languages which implies the upper bounds for the operations.For complementation, we have For the operations union and intersection, we obtain the results which are summarized in Table 3 from which the lower bounds follow.Now, we turn to arbitrary alphabets and consider first the complementation of DUFAs.

Theorem 4
Let n ≥ 1 be an integer.Then, n states are sufficient for a DUFA to accept the complement of any language accepted by an n-state DUFA.Moreover, for any minimal n-state DUFA A n , any DUFA accepting the language L(A n ) has at least n states.
Proof For the upper bound, it is sufficient to observe that the classical construction for the complementation of deterministic machines, that is, the interchanging of accepting and nonaccepting states, works for DUFAs as well.
For the lower bound, let A n be a minimal n-state DUFA.Assume that the complement L(A n ) is accepted by some DUFA B with m < n states.Then, by the upper bound, L(B) = L(A n ) is accepted by a DUFA with m states which contradicts the minimality of A n .
Example 2 For every n ≥ 1, the lower bound of the operational state complexity of DUFA complementation is witnessed by the following n-state DUFA A n = {q 0 , q 1 , . . ., q n−1 }, {a, b}, δ n , q 0 , {q 0 , q 1 , . . ., q n−2 } which is depicted for even n in the upper figure and for odd n in the lower figure.
Let us assume that B = Q, {a, b}, δ, q I , F is a DUFA accepting the complement L(A n ) with less than n states.Then, we consider w n = (ba) (n−1)/2 for odd n and w n = (ba) (n−2)/2 b for even n.In both cases, we have |w n | = n − 1 and w n / ∈ L(A n ) which implies that w n ∈ L(A n ).Hence, L(B) = ∅ and there must be some f ∈ F that is reachable from the initial state q I .Since B has less than n states, there is some v with |v| < n − 1 such that δ(q I , v) = f .Thus, v ∈ L(B) and |v| < n − 1 = |w n |.On the other hand, w n is the shortest word in L(A n ) = L(B) which gives the contradiction.
Next, we continue with the intersection operation.To this end, we provide the following preparatory lemma which is needed to prove a tight lower bound.

Lemma 4
Let m ≥ 4 be an even integer.There are natural numbers x 1 , x 2 , y 1 , and y 2 such that the following equations hold simultaneously.Moreover, one can choose x 1 , x 2 , y 1 , and y 2 such that both equations additionally assume their minimum.
Proof First, we show that Eq. ( 1) holds with a minimal value if we set Thus, Eq. ( 1) holds if x 1 = y 1 − 1 = m/2, and assumes the value m 2 + m − 1. Next, we consider the case when x 1 = y 1 − 1 and show that in this case either Eq. ( 1) is not solvable or a value larger than m 2 + m − 1 is assumed.Let x 1 ≥ y 1 .Then, we have This gives that the equation is not solvable, since x 1 ≥ 0, but 1 − m/2 < 0. Now, consider the remaining case x 1 < y 1 − 1.Then, we have In this case, the value of the equation becomes larger than m 2 + m − 1, since m − 1 + 2mx 1 is a strictly increasing function of x 1 .It follows that Eq. ( 1) holds with a minimal value, if Second, we show that setting x 2 = m/2−2 = y 2 implies that Eq. ( 2) holds with a minimal value as well.Let x 2 = y 2 , then we have Thus, Eq. ( 2) holds if x 2 = y 2 = m/2 − 2, and assumes the value m 2 − 3m + 1. Next, we consider the case when x 2 = y 2 and show that in this case either Eq. ( 2) is not solvable or a value larger than m 2 − 3m + 1 is assumed.Let x 2 < y 2 .Then, we have Since m + 1 + 2mx 2 is a strictly increasing function of x 2 , Eq. ( 2) assumes a value larger than m 2 − 3m + 1.Now, we consider the remaining case x 2 > y 2 .Then, we have The left-hand side of Eq. ( 2) can be written as (1 + 2x 2 )m + 1 and the right-hand side can be written as (2 + 2y 2 )m − (2y 2 + 3).Setting g(x 2 ) = 1 + 2x 2 and h(y 2 ) = 2 + 2y 2 , we can write Eq. ( 2) as g(x 2 )m + 1 = h(y 2 )m − (2y 2 + 3).We observe that at both sides of the equation there are multiples of m which are added by 1 and −(2y 2 + 3), respectively.Hence, 1 + 2y 2 + 3 has to be a multiple of m which gives that 2y 2 + 3 = km − 1 for some integer k ≥ 1.Thus, we obtain y 2 = (km)/2 − 2 which is a contradiction to the shown fact that y 2 < m/2 − 2. We conclude that Eq. ( 2) is not solvable if x 2 > y 2 .Altogether, we have shown that Eq. ( 2) holds with a minimal value, if

Theorem 5 For any integers m, n ≥ 1 let A be an m-state and B be an n-state DUFA. Then, m • n states are sufficient for a DUFA to accept the language L(A) ∩ L(B).
Proof For the upper bound, we use the usual cross-product construction.Let A = Q A , , δ A , q 0,A , F A be an m-state and B = Q B , , δ B , q 0,B , F B be an n-state DUFA.
Then define C = Q A × Q B , , δ, (q 0,A , q 0,B ), F A × F B , where δ((q 1 , q 2 ), a) = (δ A (q 1 , a), δ B (q 2 , a)) for all  1) and ( 2) hold simultaneously while assuming a minimal value.Hence, due to the equality and the minimality, we obtain a word (ab) (m 2 +m−2)/2 a of minimal length m 2 + m − 1 which belongs to L(A) ∩ L(B).Analogously, considering words in L(A) ∩ L(B) of the form (ba) b for some ≥ 1 the left-hand side and right-hand side of Eq. ( 2) provides a word (ba) (m 2 −3m)/2 b of minimal length m 2 − 3m + 1 which belongs to L(A) ∩ L(B) as well.Since both minimal lengths are different, automaton C has to have two different paths from the initial state to an accepting state which implies, according to Theorem 1, that C is of Fig. 6 The DUFA A (upper automaton) and B (lower automaton) used for proof of the lower bound type 4 or type 5. Let us first assume that C is of type 4.Then, in particular the upper path contains an accepting state f that is entered after reading w = (ab) (m 2 +m−2)/2 a and the upper path ends in some state q that ends in a loop.If f = q, then there is a transition from f to f on input a which implies that input wa is accepted by C.This is a contradiction, since wa is not accepted by B. If f = q, then there are two possibilities, namely the remaining path from f to q processes inputs of the form (ba) k b * or of the form (ba) k−1 ba * for some k ≥ 1.In either case, we can construct a word w which is accepted by C, but not by B which gives the contradiction.In the first case, we consider w = w(ba) k b(ab) k , and in the second case, we set w = w(ba) k−1 ba(ba) k−1 b.Hence, we conclude that C is of type 5.This means that C has two different paths which start in the initial state and end in the same state.Thus, C has at least Finally, we study the union operation and obtain the same tight bound as for intersection.For the upper bound we can again use the usual cross-product construction as in the proof of Theorem 5.

Theorem 7 For any integers m, n ≥ 1 let A be an m-state and B be an n-state DUFA. Then, m • n states are sufficient for a DUFA to accept the language L(A) ∪ L(B).
Theorem 8 There are infinitely many integers m, n ≥ 1 with n = 2m − 2 such that A is an m-state DUFA, B is an n-state DUFA, and m • n states are necessary for any DUFA to accept the language L(A) ∪ L(B).
Proof For the lower bound, we consider two DUFAs A and B accepting the complements of the languages accepted by A and B used in the proof of Theorem 6.Both DUFAs can be obtained due to Theorem 4 by interchanging accepting and non-accepting states.The resulting DUFAs are minimal, have m and n states, respectively, L(A ) = L(A) and L(B ) = L(B).Now, let C be a minimal DUFA accepting L(A ) ∪ L(B ) and assume that C has < m • n states.By applying Theorem 4, we can then construct an -state DUFA C such that . This is a contradiction to the proof of Theorem 6 where it is shown that every DUFA accepting L(A) ∩ L(B) needs at least m • n states.

Nondeterministic operational state complexity
In this section, we complement the operational state complexity results by investigating NUFAs.As in the deterministic case, we first give evidence under which operations the family of languages accepted by NUFAs is not closed.By Theorem 2, unary languages from this family are of one of the six types mentioned in the theorem.
To show the non-closure under union, it is sufficient to consider language L 2 = {λ} and L 4,3 = { a n | n ≥ 3 and n odd }.Their union is not of type 1 or 2 (of Theorem 2).Assume that the union is of one of the other types.Then k must be 0. So, either a or aa or both do belong to the language as well.However, both words do not belong to the union.The same reasoning applies to language L * 4,3 , which shows the non-closure under iteration.We turn to complementation.The complement of language L 3,4 = { a n | n ≥ 4 and n even } includes the words a i for 0 ≤ i ≤ 3. Therefore, L 3,4 is not of type 1, 2, 3, or 4. Assume that it is of type 5 or 6.Then, k must be 0 and l must be 1 which implies that the language is a * , a contradiction.
In the non-unary case, we have additionally the non-closures under concatenation and reversal.As in the deterministic case, for the sake of completeness, we give next non-unary examples witnessing some non-closures.Let A and B be the following NUFAs: We have L(A) = a + and L(B) = b + .So, an NUFA accepting L(A) ∪ L(B) must have either the following state sub-graph or the state sub-graph obtained by merging states q 1 and q 2 .
So, the word aab is accepted but neither belongs to L(A) nor to L(B).This shows the non-closure under union.It will turn out that the family of languages accepted by NUFAs is closed under intersection.So, by its non-closure under union and De Morgan's law, it follows that it is not closed under complementation.
The non-closure under concatenation is witnessed by the following NUFAs A and B: The shortest word in L(A) • L(B) is ab.So, an NUFA accepting L(A) • L(B) must have the following state sub-graph: Therefore, the word abbaab is accepted but cannot be factorized as uv with u ∈ L(A) and v ∈ L(B).This shows the non-closure concatenation.Let this state sub-graph be the state graph of an NUFA A. We consider the iteration L(A) * .Since λ ∈ L(A) * , the initial state of an NUFA accepting L(A) * is accepting.Since ab ∈ L(A) * , an a-transition from the initial state is defined.Therefore, aa / ∈ L(A) * is accepted as well.This shows the non-closure under iteration.
Finally, we consider the operation reversal.The non-closure under reversal is witnessed by the following NUFA A: Assume that there is an NUFA B that accepts the reversal L(A) R .Since a ∈ L(A) R and b ∈ L(A) R , there is an a-transition and a b-transition from B's initial state to some accepting state.So, due to the symmetry, B accepts aab as well.However, the word baa does not belong to L(A) and, thus, the non-closure under reversal follows.
We continue with the operational state complexity of unary NUFAs.Owing to the characterization given in Theorem 2, we can show tight bounds by a detailed case analysis.If the underlying alphabet is at least binary, then NUFAs are only closed under intersection.However, it is possible to obtain tight bounds as well.We start with the unary case.
Theorem 9 For any integers m, n ≥ 1 let A be an m-state and B be an n-state NUFA over the same unary alphabet.Then, max(m, n) + 1 states are sufficient for an NUFA to accept L(A) ∩ L(B).
Moreover, there are minimal m-state NUFAs and minimal n-state NUFAs such that this sufficient number of states is necessary.
Proof According to Theorem 2, L(A) and L(B) belong to one of the types L 1 , L 2 , L 3,k , L 4,k , L 5,k,l , or L 6,k,l for some k ≥ 0 and l > k.Hence, we have to show that each combination leads to an NUFA with at most max(m, n)+1 states.The results of all combinations are summarized in the following table , where We will not consider all combinations in detail, but exemplarily discuss two intersections.First, we consider L 3,k 1 ∩ L 6,k 2 ,l 2 which is Second, we consider L 5,k 1 ,l 1 ∩ L 6,k 2 ,l 2 where necessarily l 1 is odd and l 2 is even.If For the upper bound, we can read off the Finally, if L 5,t 1 ,t 2 or L 6,t 1 ,t 2 is obtained, we know that t 2 states are sufficient for an NUFA to accept the languages.Now, we have t 2 ∈ {l 1 , l 2 , max(l 1 , l 2 )}.Since l 1 = m and l 2 = n, we obtain that Thus, max(m, n) + 1 is an upper bound also for these cases.
For the lower bound, we first consider . We know that L 3,k 1 is accepted with k 1 + 1 = m states due to Lemma 2 and L 6,k 2 ,l 2 is accepted with l 2 = n states due to Lemma 3.Moreover, to accept L 3,max(k 1 ,l 2 ) at least max(k 1 , l 2 ) + 1 = max(m − 1, n) + 1 states are necessary due to Lemma 2. Second, consider the symmetric case is the lower bound.
We show exemplarily that L 5,k 1 ,l For the upper bound, we can read off the table the following cases.If L 1 or L 2 is obtained, we know that one state is sufficient to accept the languages.Hence, 1 ≤ m + n − 1 is an upper bound.If L 3,t or L 4,t is obtained, we know that t + 1 states are sufficient to accept the languages.Now, we have Thus, m + n − 1 is an upper bound also for these cases as well.
For the lower bound, we consider We know that L 3,k 1 is accepted with k 1 + 1 = m states owing to Lemma 2 and L 5,k 2 ,l 2 is accepted with l 2 = n states owing to Lemma 3.Moreover, to accept L 5,k 1 +k 2 ,k 1 +l 2 at least k 1 + l 2 = m − 1 + n states are necessary due to Lemma 2.
Since the reversal of a unary language L is the language L again, the following statement is obvious.

Theorem 11
Let n ≥ 1 be an integer.Then, n states are sufficient for an NUFA to accept the reversal of any language accepted by an n-state NUFA.
Moreover, for any minimal n-state NUFA A, any NUFA accepting the language L(A) R has at least n states.
Finally, we consider the general intersection operation for NUFAs.

123
Theorem 12 For any integers m, n ≥ 1 let A be an m-state and B be an n-state NUFA.Then, m • n states are sufficient for an NUFA to accept the language L(A) ∩ L(B).
Moreover, there are minimal m-state NUFAs and minimal n-state NUFAs such that this sufficient number of states is necessary.
Proof For the upper bound, we can use the usual cross-product construction as in the proof of Theorem 5. Clearly, the resulting automaton is an (m • n)-state NUFA that accepts L(A) ∩ L(B).
For the lower bound, we consider L m = { w ∈ {a, b} * | |w| a ≥ m − 1 } and L n = { w ∈ {a, b} * | |w| b ≥ n − 1 } that are each accepted by an m-state NUFA and n-state NUFA, respectively.Next, we show that any NUFA for L m ∩ L n needs at least m • n states.By way of contradiction, we assume that there is an NUFA C = Q, {a, b}, δ, q 0 , F accepting L m ∩ L n with less than m • n states.Then, consider a i 1 b j 1 and a i 2 b j 2 such that a i 1 b j 1 = a i 2 b j 2 for 0 ≤ i 1 , i 2 ≤ m − 1 and 0 ≤ j 1 , j 2 ≤ n − 1.Without loss of generality, we may assume that i 1 > i 2 or j 1 > j 2 .Since there are m • n such words and |Q| < m • n, we can conclude that the intersection { q ∈ Q | q ∈ δ(q 0 , a i 1 b j 1 ) and δ(q, a m−1−i 1 b n−1− j 1 ) ∩ F = ∅ } ∩ δ(q 0 , a i 2 b j 2 ) is not empty for at least two words a i 1 b j 1 and a i 2 b j 2 .Thus, we obtain for w = a i 2 b j 2 a m−1−i 1 b n−1− j 1 that δ(q 0 , w) ∩ F = ∅, hence, w ∈ L m ∩ L n .Now, if i 1 > i 2 , we obtain that |w| a = i 2 + m − 1 − i 1 < m − 1.On the other hand, if j 1 > j 2 , we obtain that |w| b = j 2 + n − 1 − j 1 < n − 1.In both cases, we conclude that w / ∈ L m ∩ L n which gives the contradiction and concludes the proof of the lower bound.
The results on the deterministic and nondeterministic state complexity obtained are summarized in Table 1.

Conclusions
In this paper, we have introduced deterministic and nondeterministic finite automata with undirected state graphs.It was possible to characterize the languages accepted by such automata in the unary case for deterministic and nondeterministic automata as well as in the binary case for deterministic automata.This characterization enabled us to study the deterministic and nondeterministic operational state complexity in depth and an almost complete picture with tight bounds could be obtained.The deterministic state complexity of the reversal operation as well as the question of whether the language class is closed under reversal are currently open questions.For DUFAs with one accepting state, the construction of a DUFA accepting the reversal is straightforward and needs no additional states.However, the construction cannot directly be generalized to DUFAs with more than one accepting state.
Concerning the operational state complexity, we have investigated so far only those operations under which the corresponding language classes are closed.However, even in the case of non-closure, we still obtain regular languages.Thus, it would clearly be of interest to determine upper and lower bounds for the remaining operations from this point of view.
Since the language classes accepted by DUFAs and NUFAs are subregular, it would be interesting to devise an effective algorithm that decides, given an arbitrary finite automaton A, whether or not L(A) could be accepted by an NUFA or DUFA as well.Naturally, the complexity of such an algorithm is of great interest.In the positive case, such an algorithm should construct an equivalent NUFA or DUFA.Then, the determination of the exact trade-off concerning the number of states between NUFAs and DUFAs as well as arbitrary NFAs and DFAs becomes a challenging task.

Fig. 3
Fig. 3 Possible state graphs of binary deterministic undirected finite automata, where m, n ≥ 1, the letters a and b are interchangeable, x, y ∈ {a, b}, x = a ⇐⇒ x = b, and ȳ = a ⇐⇒ y = b.Accepting states can be anywhere

Fig. 5
Fig. 5 State graph of a minimal nondeterministic undirected finite automaton accepting the language L 5,k,l or L 6,k,l

Theorem 6
and a ∈ .Clearly, C is an (m • n)state DUFA that accepts L(A) ∩ L(B).There are infinitely many integers m, n ≥ 1 with n = 2m − 2 such that A is an m-state DUFA, B is an n-state DUFA, and m • n states are necessary for any DUFA to accept the language L(A) ∩ L(B).Proof For the lower bound, we consider two minimal DUFAs A and B, where A has m states for even m ≥ 4 and B has n = 2m − 2 states.Both DUFAs have the form depicted in Fig. 6.Now, let C be a minimal DUFA accepting L(A) ∩ L(B).First, consider words in L(A) ∩ L(B) that have the form (ab) a for some ≥ 1.Then, the left-hand side of Eq. (1) indicates the length of such words that are accepted by A, whereas the right-hand side of Eq. (1) indicates the length of such words that are accepted by B. According to Lemma 4, there are integers x 1 = m/2, x 2 = m/2 − 2, y 1 = m/2 + 1, and y 2 = m/2 − 2 such that Eqs. (

Table 1
Summary of the state complexities of the operations studied in this paper

Table 2
It is marked by -if an automata class is not closed under the corresponding operation, ?means that the closure property is unknown.The complexities depicted are upper bounds which are tight in the sense that for all m, n there are automata of size m and n for which the upper bound is also necessary.The only exceptions are the intersection and union of DUFAs, where the upper bounds are shown to be tight for infinitely many m, n only Summary of the operational state complexities of DFAs and NFAs, where t is the number of accepting states of the "left" automaton table the following cases.If L 1 , L 2 , or L 8,t is obtained, we know that one state is sufficient to accept the languages.Hence, 1 ≤ max(m, n)+ 1 is an upper bound.If L 3,t or L 4,t is obtained, we know that t + 1 states are sufficient to accept the languages.Now, we have t ∈ {k 1 Theorem 10 For any integers m, n ≥ 1 let A be an m-state and B be an n-state NUFA over the same unary alphabet.Then, m + n − 1 states are sufficient for an NUFA to accept L(A) • L(B).Moreover, there are minimal m-state NUFAs and minimal n-state NUFAs such that this sufficient number of states is necessary.ProofWe show that each combination leads to an NUFA with no more than m + n − 1 states.The results of all combinations are summarized in the following table, where k 1• L 6,k 2 ,l 2 = L 6,k,l , where necessarily l 1 is odd and l 2 is even.All words inL 5,k 1 ,l 1 • L 6,k 2 ,l 2 have a length of at least k 1 + k 2 .Let t 1 = l 1 − k 1 and t 2 = l 2 − k 2 .If t 1 < t 2 ,then all words of length at least l 1 + k 2 belong to the concatenation and all words of length at least k 1 + k 2 and less than l 1 + k 2 have to have odd lengths, sincek 1 + k 2 is odd.If t 2 < t 1 ,then all words of length at least k 1 + l 2 belong to the concatenation and all words of length at least k 1 + k 2 and less than k 1 + l 2 have to have odd lengths, since k 1 + k 2 is odd.Hence, the concatenation yields L 6,k,l by setting t 1 ,t 2 or L 6,t 1 ,t 2 is obtained, we know that t 2 states are sufficient to accept the languages.Now, we have t 2 ∈ {l 1