Manuscript Offprint
arXiv:2609.08843Graph-based automata
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We study graph-based automata: nondeterministic finite automata obtained from edge-colored or oriented graphs by taking every vertex as both initial and accepting, and every edge as a pair of opposite transitions. The language of these automata corresponds to the set of edge-colored or oriented paths mapping to their corresponding graphs. We develop an analogous notion for trees and characterise the languages recognised by these models. For tree languages we prove the existence of a unique size-minimal graph and, more generally, a homomorphism-minimal graph for both word and tree languages using duality methods.
In order to further motivate these models, we showcase a few results at the intersection between graph theory and automata theory: We relate graph-based automata to reversible automata, give a decomposition of graph-based languages into reversible languages, and introduce the remanent language of an undirected graph as the intersection of all its orientations. This remanent language captures structural information on the graph such as chromatic number.
1 Introduction
A graph is a system of states together with a system of symmetric relations between them. An automaton is a transition system between states. Therefore, they are conceptually very similar structures. However, automata theory and graph theory have led these objects to evolve in very different directions. The heart of automata theory has created many strong equivalences between languages, monoids, regular expressions and logic, which allow regular languages to be extremely well understood and easy to manipulate. On the other hand, a big part of graph theory consists of considering NP-hard problems that need to be restricted to subclasses to be manageable. For instance, one may restrict to graphs of bounded treewidth or to perfect graphs when computing the chromatic number. It is rather uncommon to obtain characterisations that are as well behaved as regular languages. In this work, we try to take advantage of the tools of automata theory to get structural information about a graph.
A graph morphism is a function between the vertices of two graphs which preserves adjacency. It is a central notion in graph theory, as it encapsulates many parameters, such as the chromatic number and the clique number. Given a fixed graph , by counting the number of homomorphisms from any graph to , we obtain an infinite vector known as the homomorphism profile of . In [7] Lovasz proved that two graphs have the same homomorphism profile if and only if they are isomorphic.
By looking only at the existence of a homomorphism instead of the exact count, we obtain the set of graphs that map into . Two graphs lead to the same set if and only if they are homomorphically equivalent, meaning that there exists a morphism from to and a morphism from to . In each homomorphism-equivalence class of graphs, there exists a unique minimal graph (in terms of the number of vertices and edges), called the core, to which any other one maps surjectively.
By viewing the set of graphs that map into as a language associated to , it is natural to draw a parallel to the existence of a minimal automaton in the context of deterministic finite automata. This similarity is accentuated by the fact that an automaton accepting a word corresponds to the existence of a function from the word , seen as a path, to the states of the automaton, in a way that is coherent with the transition labels. Therefore, it is essentially a morphism from the word to the automaton.
We introduce the notion of graph-based automata, which are nondeterministic finite automata whose language is the set of paths mapping to an edge-colored or oriented graph. In terms of automata, this is equivalent to asking that every state be initial and terminal, and that every transition be bidirectional (in the edge-colored case), or part of a pair of opposite transitions (in the oriented case). This notion should not be confused with graph automata appearing in the literature [2], where automata are used to process graph-structured inputs.
We also introduce the notion of graph-based tree automata, the analogous model where paths are replaced with trees. Those notions have been used before in graph theory, in particular, in works related to homomorphism, either explicitly [4] or implicitly [9], through the study of “bounded path”. But they were used only as tools and not objects of interest.
From the point of view of automata theory, to the best of our knowledge, the class of graph-based automata has not been studied as a subject in its own right. However, its defining features are very natural: asking that every state be both initial and accepting is standard, and so are bidirectional transitions. For this reason, we do not claim novelty for the model itself, but rather for its explicit formulation and study. One of the closest related notion appears to be that of reversible automata and reversible languages: automata where the transition function is injective. A link between the two notions is established in Proposition 30.
In this work, we characterise the languages associated with graph-based (tree) automata and study, for a given language, the possible minimal graph-based (tree) automata associated with it. For graph-based tree automata, we prove the existence of a unique minimal automaton with respect to size. This is particularly surprising since the related automata are highly nondeterministic. There also exists a minimal automaton with respect to the homomorphism order, this is a consequence of a very general duality result by Erdős, Pálvölgyib, Tardif and Tardos [4]. We give a different proof of that result, adapted to our context. For graph-based automata, there is no minimal graph with respect to size, but a unique homomorphism-minimal graph does exist, as a direct consequence of a well-known result by Christian Carrez [1].
Finally, we give some applications at the intersection of automata and graph theory: we give a way to disambiguate a graph-based language by lifting it into a reversible language, and introduce the notion of the remanent language of an undirected graph, which is the language of oriented paths that can map to any orientation of the graph. This language encapsulates considerable structural information about the graph, such as the chromatic number.
2.1 Definition and notations
A graph is a pair of vertices and edges. A graph is said to be oriented if each edge has a beginning and an end, it is said to be edge-colored if each edge is labelled by a set of colors. Except if explicitly mentioned, we allow loops and multi-edges, and graphs are finite.
In this paper, we will mostly consider graphs that are oriented or edge-colored (or both). To have a unified vocabulary, we may refer to them as decorated graphs, or simply as graphs in a context where the additional edge information is not the main focus. Conversely, we say that a graph is plain to emphasise the fact that it is neither oriented nor edge-colored.
In a plain graph, we use to write that and are adjacent. For a decorated graph, we write if is connected to via the color . If the graph is not oriented, then is equivalent to , and if the graph is uncoloured, we may interpret the graph as having . We write for the neighbours of . In a decorated graph, we write for the out-neighbours of via color , and for the in-neighbours, then .
A graph morphism or homomorphism is a function between the vertex sets of two graphs that preserves adjacency. In the context of decorated graphs, a homomorphism must preserve colours and orientation: is a homomorphism if and only if . We write to indicate that there exists a homomorphism from to . In the context of graph homomorphisms, a duality pair (defined by Nešetril and Pultr in [10]) is a pair of graphs, or more generally a pair of sets of graphs , such that for any graph ,
Consider a decorated graph with ( is the set of colors). We construct the automaton based on as the following nondeterministic finite automaton (NFA; see Figure 1):
with :
-
-
. In particular, if is only oriented, we may use and if is only edge-colored, and are equivalent and we may use
-

Figure 1: A 2-edge-colored graph (left) and an oriented graph (right) above their respective automata. Indicators of initial and final states are omitted. Blue edges are marked with a dot for added readability
We write for the language of the automaton based on . Note that words over the alphabet can be interpreted as oriented and/or edge-labelled paths. Conversely, any path corresponds to two words over this alphabet, depending on which endpoint one starts with.
Definition 1. If , let be the arrow in opposite direction to . We extend the notion for words with (the empty word) and .
For undirected graphs, the inverse of a word is equal to its mirror.
2.2 Basic properties
We start with a few basic properties of graph-based automata.

Figure 2: A 3-edge colored graph and a path mapping to it, finding the correct mapping is left to the reader as a puzzle .
Proposition 2. If , are decorated graphs, then the following are true:
-
is stable by inverse and factors
-
is, up to the path-word correspondence, the set of decorated paths that admit a homomorphism to
-
-
where is the tensor (also called categorical) product
-
If is a cover of , then (see Definition 3)
Definition 3. H is a cover of a graph G if there is a covering map from H to G. A covering map f is a surjection and a local isomorphism: the neighbourhood of a vertex v in H is mapped bijectively onto the neighbourhood of in G.
proof of the proposition. Let , be decorated graphs, based on which we construct the automata and .
- If , then is accepted by a path , by construction of , , therefore, is a valid path in which accepts .
That is stable by factors is a consequence of every state of being initial and terminal.
- Consider a decorated path that admits a mapping to , this mapping induces a walk in with the orientations and colors in matching that of .
In , there must exist a run , with
which accepts a word describing . Since is stable by inverse, both words describing are in . With the same construction in reverse, it is immediate that corresponds exactly to the paths mapping to .
Solution to Figure 2: E2;E3;D3;C3;B3;B2;B1;C1
-
Recall that for a connected graph , then, using the item 2, we get the desired result.
-
Similarly, for a graph , then, using the item 2, we also get the desired result.
-
Suppose is a cover of and let be the covering map from to . Then is a bisimulation. Therefore, and have the same language.
Since and share the same vertex set and accept the same paths/words, we will freely switch between graph-theoretic and automata-theoretic terminology. Thus, a path mapping to a graph may also be viewed as an accepting run over the graph. Similarly, we may view word languages as sets of paths.
We say that an oriented path or cycle is directed if all edges are oriented in the same direction (meaning clockwise or anticlockwise for a cycle).
Proposition 4. If is an uncoloured oriented graph, then if and only if contains a directed cycle.
If is a 2-edge-colored undirected graph, then if and only if contains a color-alternating cycle.
Proof. Consider an uncoloured oriented graph, if contains a directed cycle , every vertex of has in-degree and out-degree 1 in , so every letter ( or ) can be accepted from every vertex and .
Conversely, must accept directed paths of any length, since is finite, there exists two vertices that are mapped to the same vertex in . And therefore, maps to a directed closed walk of . By taking the minimal one, we get a directed cycle.
For 2-edge-colored undirected graphs, the argument is the same, replacing directed, by color-alternating.
Corollary 5. If is an uncoloured oriented graph or a 2-edge-colored undirected graph, implies that there is a vertex such that accepts starting at
Note that this result does not generalize to 3-edge-colored graphs, as shown in Figure 3.
Proposition 6. For any two graph-based languages and any connected decorated graph , or .
Proof. Suppose but . Let and . Let and be two runs in accepting and respectively. Since is connected, there exists a path from to , call the corresponding word . Then

Figure 3: A graph whose language is
. Since and are stable by factors, and thus , so .
From the preceding propositions, the reader might be tempted to think that the class of graph-based languages is trivial or not as rich as regular languages. We therefore show that, up to a simple encoding, any regular language can be expressed as a graph-based language. This construction is also useful for translating noteworthy automata into graphs.
Proposition 7. Any regular language over an alphabet can be obtained as
Where is an edge colored graph with colors \Omega = \{\, a, b, #}$ and is a transducer independent of .
Proof. Let , for the -th letter of , let . Then, let be a transducer that writes when it reads and writes after reading \ or #GA = (Q, \Omega, \delta, I, F)L(A) = L$:
We define , with a set of auxiliary vertices.
For , we add a loop q \xrightarrow{\} ,
for , we add a loop ,
for , we add a path , with the s being auxiliary vertices used for that transition only.
Now, it remains to verify that corresponds indeed to . The fact that is relatively immediate, because, the definition of is such that the run in will naturally translate to a run in between \ and #c\phi(c)$.
For the other direction, we need to prove that any word in between \ and #\phi(w)w \in Lq \in Q \subset V(G)\phi(c)q'\delta(q, c) = q'q, x_1, \ldots, q'\phi(c)\phi(c)ax_1\delta(q,c')abc'=cq'=\delta(q,c)\square$
We also give another construction that doesn't need a transducer.
Proposition 8. For a regular language over the alphabet and there exists a \Sigma \cup \{\, #})-edge-colored graph such that \{w \mid \w# \in L(G)|w|=k}={w \in L \mid |w|=k}$.
Proof. Let be an automaton recognising . Take , where is the automaton corresponding to a path of length , with its initial and final states at the two endpoints, and accepting between two adjacent states.
Then create from by adding a loop to the initial states and a #-loop to the final states.
2.3 Generalisation to trees
In this section, we introduce the notion of graph-based tree-language. This is particularly useful for graph theory, because the trees of a graph are, arguably, more important and meaningful than its paths.
The standard notions of tree automata (top-down automata, bottom-up automata, hedge automata) are not well suited for describing decorated trees of arbitrary arity with unordered children. Therefore, we do not describe an explicit tree automaton, instead, we directly discuss regular languages of decorated trees. We will, however, do so in the bounded-degree case. We follow the definitions and basic properties of [4].
Fix a set of colors, we call the set of oriented -edge-colored trees. For and in , let . Let be the tree obtained by joining and and identifying and , the new vertex will typically be called . If , we write .
If is a tree and is a neighbour of , let be the subtree containing (as its root), , and all descendants of . (See Figure 4.)

Figure 4: Illustration of the operations on trees
Given a family of trees, let . For a family of trees (possibly ), we write for the corresponding rooted trees, that is: . We write if . We say that a set of decorated trees is regular if the number of equivalence classes of is finite.
The following property is folklore, it can be found in a similar language in [4, Corollary 3.4]
Proposition 9. Given a decorated graph , the set of decorated trees mapping to is regular.
We write this set .
Proof. Let be the different possible images of via a morphism from to . Then for . Furthermore, . Thus the equivalence class of for is only a function of and the number of equivalence classes is at most and is regular.

Figure 5: A decorated graph and a tree from its language
Proposition 2 generalises to tree.
Proposition 10. If , are decorated graphs, then the following are true:
-
is stable by subtree
-
-
-
If is a cover of , then
Proof. All of those are proved in the same way as in the proof of Proposition 2, as consequences of Proposition 9
Proposition 11. If is a decorated graph, then if and only if contains a subgraph where every vertex has in and out degree at least 1 in every color.
Proof. If is a subgraph of with in and out degree at least 1 in every color, then a mapping of a decorated tree into can be found by mapping from the top down, choosing only from edges inside .
Conversely, if . Let be the decorated tree of depth where every internal node has in and out degree at least 1 in every color. We call the central node of , which we view as a root. must map to via a morphism . If is large enough, then, in every path from the root to a leaf, there must be two vertices mapping to the same vertex of . Consider the subtree obtained by trimming is order that every leaf of admits an ancestor such that .
Then, let , must have in and out degree at least 1 in every color as this is the case for every internal node of and that the leaves have their image equal to that of a non-leaf.
Proposition 10, contrasting with Proposition 4 which only applies if , illustrates how graph-based tree-automata can have tamer properties than graph-based automata, this will also be seen in Theorem 22.
In a context when we have trees with bounded degree, we can use more standard and constructive notions for regular sets, we will use the following :
Definition 12 (Bottom-up decorated tree automaton). Let be a finite set of states and a set of accepting states. A bottom-up tree automata is a tuple where is a finite set of transitions of the form
where , and is an decorated rooted star whose root is labelled by and whose leaves are labelled by .
A run of on an decorated rooted tree is a state assignment to the vertices such that, for every vertex, the corresponding edge-colored star belongs to . Leaves are handled by transitions of the form
We say that is accepted if it admits a run in which the root is assigned a state in . The language of , denoted by , is the set of accepted trees.
In this paper, we will consider trees with unordered children, this is why we used a star in the transition rather than a tuple of decorated edges.
Also, the transitions may equivalently be viewed as grammar rules, with describing the local replacement of a vertex in state by an edge-colored star whose leaves are in states .
Lemma 13. Given a graph-based tree-language , the set of minimal trees (for inclusion) not in , is a regular set of trees with bounded degree.
Proof. Let be a graph such that . Let be the set of minimal trees outside . For a (non-empty) rooted tree , we consider . Let be another non-empty rooted tree. Let be the possible images of via a morphism from to , and (actually, it will be enough to only consider the to be leaves). Then if and only if the following are true:
-
There exists no morphisms from to : .
-
There exists a morphism if we remove one vertex (not st) from :
and similarly .
- There exists a morphism if we remove from : This is actually a consequence of 2. because is not a leaf and thus a cut vertex of .
Thus is characterised uniquely by and . Since there are at most possibilities for and for , is regular.
Furthermore, if has a vertex of degree , say , then, for to be minimal, we must have but . Basic set theory implies that this can only happen if the ground set (here ) has size at least . Therefore the trees of have maximum degree at most .
Note that using the possibilities for and as states, we can construct an explicit automata for .
3 Characterisation of graph-based automata
3.1 Path languages
Definition 14. Fix a regular language . For , let us define
For a state of an automaton recognizing , let be the language of words starting from . Then let . (We might write and if is not clear from the context.)
By Myhill-Nerode, since is regular, we get that there is a finite set of possible values for the (even if is a state from an infinite automata).
Lemma 15 (adding epsilon transitions). Let be a (possibly infinite) automata and , be two states verifying . Then, if is obtained from by adding the -transition , we have . Furthermore, is unchanged from to .
Proof. Since is a sub-automata of , so we just need to prove . We do so by induction on the (minimum) number of times the new -transition is used to accept a word.
Let . If is accepted without using the -transition, then . Otherwise suppose is accepted by the path . With using a minimal number of -transitions. Observe that, in , , therefore, there exists such that . In particular . Since , we have , thus . But observe that this new path uses one less -transition, so by induction which implies that .
Furthermore, with the same reasoning, starting with , we get that . Then, by monotonicity of , .
Lemma 16 (quotient of infinite automata). If is a possibly infinite automata accepting a regular language, then there exists a finite automata with the same language obtained by identifying states from .
Proof. Fix a language and let be obtained from by identifying all states with the same value for . Using Lemma 15, we know we can add (bi-directional) epsilon transitions between all of those states, which is equivalent to merging them. Note that this is well defined because adding the -transitions does not change the values of .
Theorem 17 (characterisation of graph-based languages). is the language of a graph-based automaton if and only if:
• is a regular language
• is stable by factor:
• verifies the "back and forth" property:
Proof. If is a graph-based automata accepting , suppose , then and are valid paths and therefore the corresponding words are in .
Fix a regular language satisfying the properties of the theorem. For , let be the graph-based automaton in the form of a path whose labels correspond to the letters of . In other words, . Observe that . First, we prove that every word in can be obtained using the subword and back and forth operation (possibly multiple times) starting with . Let , and let be the path accepting with . This path can be extended to .
Let . Observe that is a factor of . We now show that can be obtained from by iteration of the back and forth property. We do it by induction on the size of .
-
If : is accepted by a path starting at and ending at . Since these two states are at distance in , we conclude .
-
If : We call a path on a segment if all transitions go in the same direction, meaning going all toward (right) or all away from it (left). Note that a right-going segment from to accepts while a left-going one accepts .
Decompose the path accepting into its (maximal) segments: , accepting the words note that and must be going right and two consecutive segments must go in opposite directions (otherwise they could be merged in a bigger one). Since the path cannot go left of nor right of , we have that and . Let be a segment of minimal length, by the previous observation, we can choose . Observe that contains as a factor. Let be obtained from by replacing that occurrence of by . is still in so by induction is obtained from by iteration of the back and forth operation, and is obtained from by a back and forth operation, which yields the desired result.
Therefore
Now let . We must have that . Note that is a graph-based automata and is, in general, infinite.
Using Lemma 16, one deduces the existence of a finite automaton such that , and is obtained from by identifying states. Therefore, is also a graph-based automaton.
The above proof gives a way to construct a canonical graph-based automaton from a graph-based language. But, as usual for nondeterministic automata, this graph is not necessarily minimal, and there is no unique minimal graph-based automaton in general. See Figure 6 for an example of two minimal graphs accepting the same language.

Figure 6: Two minimal graphs for the same language, colours indicate the labels .
The two graphs accept the same language , which can be defined through forbidden factors:
with \Sigma = \{\, #, a, b, c, d}F = {$, $c, $d, a#, b#, $ad#}$. They are minimal in terms of size because a graph needs at least 3 different states: the states accepting #ac#bd#ad#$.
3.2 Tree languages
Now we give a characterisation similar to Lemma 15 for tree automata.
Lemma 18. If is an infinite graph accepting a regular tree language, then there exists a finite graph with the same tree-language obtained by identifying vertices from .
Proof. Fix a regular tree language , for , let
For a vertex of a graph recognising , let be the language of trees starting from , then let . We claim that identifying all vertices of with the same value for , will yield a finite graph with .
In order to be able to describe the trees in based on the vertices in , we add -labeled edges between all pairs of identified vertices in , we write , we have . Then, edges of lift to edges of and vertices of lift to -labeled cliques of . (see Figure 7).
Since is obtained from identifying vertices of , we have . Now, we prove . Consider some tree , for the following analysis, in a slight abuse of notation, we will consider the -edges used in the accepting run as edges of the tree itself (as in Figure 7, top right).
If is accepted without using the -edges, then . Otherwise, let such that:
-
is -adjacent to some vertex .
-
does not use any -edges,
-
,
Since and are -adjacent, we must have in : , therefore, there exists such that:
In , the edge , has to be a pendant edge. This edge is thus useless for the language of and we can therefore remove it.
Repeating the procedure, we end up with a tree of such that . Thus .

Figure 7: A lift of a path after identification of vertices

Figure 8: Illustration of the proof of Lemma 18
Theorem 19 (characterisation of graph-based tree-languages). is a graph-based tree-language if and only if:
-
is a regular tree-language
-
is stable by subtree
-
is stable via "doubling": if and , then .
Lemma 20. For a tree , is exactly the language obtained from by repeating the operations of subtrees and doubling.
Proof. First, observe that and, if (meaning ), then for a subtree of , , furthermore, for , . Thus, all trees obtained from by the subtree and doubling operations are in .
For the other direction, let , we want to show that can be obtained using the doubling and subgraph operation. We will start with the following observation: if and are subtrees of and respectively, via the embeddings and , and for and , then is a subtree of with mapped to . (*)
We actually show a stronger result: if , then there exists obtain by repeated doublings of such that is a subgraph of (meaning that the subtree embedding maps to ).
If is at most an edge, then is a subgraph of and convene. Otherwise, let be a non-leaf of with neighbours and consider the subtrees . By induction, each is a subgraph of some obtained via doublings of . Then, using, (*), we get that is a subtree of which can be obtained via doublings of (and taking a subtree).
Now we can prove the Theorem 19, in a similar way to Theorem 17
proof of Theorem 19. If is a graph accepting , and . In Lemma 20, we saw that the set of trees accepted by , is exactly the trees obtained by the subtrees and doubling operations. Since is equivalent to , by transitivity of morphisms, we get that is stable by subtree and doubling.
Fix a regular language verifying the properties of the theorem. Now let . For any , by Lemma 20, is exactly the set of trees obtained by doubling and subtree starting from , but since is stable by those operations, we must have that . Note that is a graph and is, in general, infinite.
Using Lemma 18, one deduces the existence of a finite automaton such that , and is obtained from by identifying states. Therefore, is also a graph-based tree automaton.
Lemma 21 (maximal simplices). If is a set and is a set of finite subsets of , which is downward closed, meaning , then there exists a set verifying with every element of being maximal, meaning that adding anything to it will induce a finite subset outside .
Furthermore, when is finite, it is the unique minimum set in terms of cardinality such that .
Proof. What we have defined is a simplicial complex, whose maximal elements are called maximal faces. In that context, this result is well-known. Note that, for arbitrary infinite sets, it follows from Zorn's Lemma. The second part of the proof follows from the observation that the maximal faces are uniquely defined and must be part of each finite solution.
We have found a characterisation for graph-based languages and tree-languages. This proves, given a suitable language, the existence of a graph recognising it. We now show that, in the case of tree automata, there also exists a unique minimal one.
Theorem 22. For a graph-based tree-language , there exists a unique minimal graph that accepts (with respect to the number of vertices).
Proof. Let be a graph-based tree-language. Two rooted trees and are said to be compatible if . Note that, if and are accepted starting from the same vertex in a given graph recognising , then and must be compatible. Similarly, we say that a finite set of rooted trees is compatible if the join of all of them is still in . Let be the maximal compatible sets obtained from Lemma 21. By maximality, the 's are stable by joining over and taking subtrees (still containing ).
Consider the graph whose vertex set is and if for every , the rooted tree obtained by adding a new root to is in . Note that, by compatibility, this is the same as saying that, for all we have and the same tree rooted at in . This presentation manifests the fact that .
We now claim two things: (1) and (2) Every graph accepting has more vertices than .
(1): We prove that the language of starting at a vertex is at least . We do so by induction on the depth of a rooted tree . Trees of depth 0 can map anywhere in . If is of depth , let the 's be the neighbours of and . By definition of , there must exist some such that . Then let , note that we have by compatibility between and .
We prove that is a compatible set. Given a finite family in , with each , then let , and . Observe that and are in . By doubling on , repeating times, we obtain a tree containing as a subtree, which therefore must be in (see the two rightmost trees in Figure 9). This proves that is a compatible set. By definition of , there must exists some .
Given a , we have

Figure 9: Example of trees for the proof of Theorem 22
Therefore , thus . However, by induction, implies that accepts starting on , thus, putting everything together, we get that accepts starting on .
Now, it remains to show that does not accept any tree outside . If it were the case, consider the minimal tree (with respect to size) such that , let be a leaf of with (without loss of generality) and be a mapping of into . Let . Then is accepted by starting at . By minimality of , . Then would imply .
This ends the proof of (1).
(2): Let be a (possibly infinite) graph such that . Let be the languages of corresponding to the trees accepted by each vertex of . They must correspond to compatible sets since any two trees accepted from the same vertex can be glued together. We have , but the correspond to the minimal such configuration (in terms of the number of sets), thus . Now, if , since is finite, by Lemma 21, , and thus
Note that the heart of the proof relies on the fact that trees can be joined together at a specific vertex, which is the fundamental difference from paths. In order to find a canonical graph for a given graph-based path language, we suggest two options. The first is to lift the word language to a tree language (see Proposition 23) and use minimisation there. Alternatively, Corollary 27 establishes the existence of a homomorphism-minimal graph for a given language.
Proposition 23. For a graph-based path-language, the union of all graph-based tree-languages whose restriction to paths is is a (regular) graph-based tree-language.
Proof. The language we construct can be characterised by: for any graph-based tree-language , where is the complement of within path languages. Note that is regular in the usual sense of word automata. Applying Theorem 25 (which will be proven shortly) on , there exists a graph such that .
4 Homomorphism duality
In the study of the homomorphism ordering, a duality between two objects is a pair that satisfies a relation of the form . For graphs, the only duality pair is . For planar graphs, Reza Naserasr showed that is a duality pair, where is the Clebsch graph. Note that it is not planar. Since duality pairs are rare, we also call a duality any "well-behaved" set of obstructions to a mapping, that is a pair such that . The most famous example is , which corresponds to the well-known fact that a graph is bipartite if it does not contain an odd cycle.
A central result for duality pairs is that, for oriented graphs, every oriented tree (meaning a tree, with an arbitrary orientation on the edges) is in a duality pair [11]. This result actually generalises to more general finite structures [4].
Theorem 24. If is an edge-colored, oriented tree (allowing bidirections), then there exists such that, for any edge-colored oriented graph:
This, in terms of languages, means:
We omit this proof because this is a special case of Theorem 25, which will be proven shortly.
This in particular means that is the largest graph-based language which does not contain , and that is the minimal automata (from a homomorphism point of view) that accepts that language. We can view this as an alternative to a complementation : we just consider the largest graph-based language in . For any finite set , we can construct which verifies . The Theorem 25 generalises this to any regular tree language. This result was originally proven by Erdős, Pálvölgyib, Tardif and Tardos in [4] in the context of arbitrary -structures. We give here a different proof, tailored to our context.
Theorem 25. If is a regular set of trees recognised by the regular tree automata , then there exists a graph such that for any edge colored oriented graph :
Proof. We start by defining an infinite graph of functions mapping each tree-vertex to a neighbour. We write for the set of all vertices from trees in .
For a tree , let be the degeneracy ordering on , that is, the ordering of the vertices obtained by successively removing the leaves of the tree. It verifies that, for each vertex there is at most one neighbour such that (*)
For , , we call the local configuration around , the information of: the states of and its neighbours, with a corresponding rule of . For , , we say that and are locally similar around , if the local configuration of around is equal to the local configuration of around . We write , since a local similarity induces an isomorphism between the neighbourhoods, we may add neighbours of and their isomorphic image in the notation: . Note that a characteristic of regular tree languages is that they have a finite set of local configurations.
Let be a graph such that no map to it. We construct as follows:
Where means that there is a homomorphism from to mapping to . Intuitively, is a function that indicates, for each tree vertex, the direction in that tree that must lead to an obstruction. Observe that, since the number of different local configurations are finite, and only considers the configuration around , there is only a finite number of different possibilities for , we call the corresponding finite subgraph .
We now show that, in the definition, the minimum is well defined. Suppose the set is empty, then for all neighbours of , there exists , verifying . Since all branches around are independent, we can find such that and for each , , thus
Merging all the homomorphisms together, we get that , which is a contradiction, thus, is well defined.
Now, we show that is a homomorphism from to . Again, towards a contradiction, suppose that but . Call them and . Then there exists and verifying and . Recall the property (*) of the elimination order in . Without loss of generality, we can assume which implies for every neighbour of . By definition of , is minimal, and therefore, for every there exists , such that . Again, we can construct such that and for any , , thus . Furthermore, and , so we can extend any homomorphism with unmapped and mapped to , by mapping to .
Merging all the homomorphisms together, we get that , which contradicts .
Finally, we show that no admits a homomorphism to . Suppose otherwise, and consider the function . Since it is a function from a tree to itself that maps any vertex to a neighbour, by the pigeonhole principle, there must exist two adjacent vertices that have been sent across the same edge, thus, to each other. But this contradicts the definition of .
By applying Lemma 13 and Theorem 25 to the complement of a tree language, we get the following :
Corollary 26. For every graph-based tree-language , there exists a homomorphism-minimal graph accepting . Meaning that for any ,
By choosing the regular set of trees to be a regular set of paths, we obtain the same result for automata over words.
Corollary 27. For every graph-based path language , there exists a homomorphism-minimal graph accepting . Meaning that for any ,
Note that Corollary 27, is in fact a consequence of the existence of a (homomorphism) minimal automata for (trimmed) NFAs. (Proposition 28, [1]) Then, for graph-based automata, it is enough to restrict the universal target to initial and terminal states and their bi-directional transitions.
Proposition 28 (Christian Carrez, 1970). A (trim) automaton recognises a subset of a rational language iff there is a homomorphism of into .
5 Structure from the language
In this section, we present two results showcasing how the notion of graph-based language sits at the intersection between graph and automata theory.
The first part compares graph-based languages with languages from reversible automata and studies how one decomposes into the other. We will use the graph structure to get information about the language.
The second part introduces the notion of the remanent language of a (plain) graph, here, we use the language to get information about a graph.
5.1 Decomposition into reversible automata
Reversible automata are a well-studied class of automata. In this section, we compare reversible automata with graph-based automata and show how the two notions interact. We show that any graph-based language can be obtained as the projection of the language of a reversible automaton, and furthermore, the alphabet needed has size at most , where is the maximum degree in colour . In the literature, similar kinds of decompositions have been studied with local languages, see Medvedev's theorem [8] and [3].
Definition 29. A reversible automaton is a finite (possibly incomplete) automaton in which each letter induces a partial one-to-one map from the set of states into itself.
We link this notion with graph-based automata corresponding to undirected edge-colored graphs.
Proposition 30. For an undirected edge-colored graph , the following are equivalent:
-
corresponds to a reversible automaton
-
is properly edge-colored
Proof. Having two edges of colour sharing a vertex is forbidden in both notions. Conversely, a proper edge colouring will ensure that, for a given colour, the out- and in-degree of every vertex are either both 0 or both 1.
Theorem 31. If is an undirected edge-colored graph, with the maximum degrees in colour being , then is the direct image of a reversible language under a letter-to-letter morphism. Furthermore, uses an alphabet of size at most .
Proof. Consider the graph with the colour partition of its edges. We will refine into in a way that the degree of each vertex in is at most 1. Thus will correspond to a proper colouring of the underlying graph of and therefore to a reversible language. The associated letter-to-letter morphism is the one mapping every colour of to its original colour in .
Now, we show how to get from . Consider a colour and , the subgraph induced by the edges of colour . By definition, has maximum degree . Using Vizing's theorem, there exists a or proper edge-colouring of . We call the newly coloured graph . Furthermore, if is bipartite, then is also bipartite and, by König's Line colouring theorem, we have a proper edge colouring.
Suppose is bipartite. Then, putting all s together and using distinct colours every time, we get a graph with colours that is properly edge-colored. Therefore, is reversible.
If is not bipartite, then consider the double cover of , denoted , whose vertices are the , and verifying if and . The double cover of is a cover of in the sense of Definition 3, therefore but is bipartite, therefore the previous argument applies.
This kind of decomposition is useful because it provides an unambiguous language for describing paths in a graph (or more precisely, paths in the language of the graph). The Figure 10 shows an 8-edge-colored graph , whose maximum degree in color is 7. From Theorem 31, we would expect that a decomposition of into reversible languages to use an alphabet of size 14. However, there exists a graph, , with the same language as (when are interpreted as ), that admits a decomposition into reversible languages using only an alphabet of size 10. is constructed based on the line-point incidence graph of the Fano plane.

Figure 10: A graph with with a reversible decomposition of the language using 10 colours instead of 14.
5.2 Remanent language
Most of the paper deals with decorated graphs. In this section, we discuss how we can get information about an plain graph (monochromatic and undirected) by studying all of its possible orientations.
Definition 32. Given a plain graph , the remanent language of is where spans all possible orientations of .
Recall from Proposition 4 that only acyclic orientations have , therefore, it is enough to consider acyclic orientations only. The remanent language of is a graph-based language, therefore, there is an oriented graph, , whose language is the remanent language of .
The main motivation for remanent languages is the following property.

Figure 11: The acyclic orientations of (left) and (right)
Proposition 33. If is a duality pair (as in Theorem 24) between an oriented path and a graph, with is the underlying graph of :
Proof. For an orientation of , the definition of a duality gives us: . By intersecting over all possible , we get that if and only if no orientation of can map to , which is equivalent to the fact that does not map to .
Using the duality between the directed path and the transitive tournament , we get:
Corollary 34. For a plain graph and integer
Proposition 33 raises the question of which undirected graphs correspond to some . The question for tree families was studied by Hell, Nešetril and Zhu in [6]. And in [5], it is proved that some orientation of the odd cycle was in duality pair with the oriented path .
The height of an oriented path or cycle, denoted , is the (absolute) difference between the number of forward and backward edges.
Proposition 35. There are oriented paths of arbitrarily large height in .
Proof. We start by recalling the following fact :
If and are two oriented odd cycles, then contains an oriented odd cycle.
This is a consequence of where is the Poljak-Rödl function for oriented graphs [12, Thm 3.3] Iterating the result, we get that there is an odd cycle in the product where ranges over all orientations of . Since is odd, it must have odd, and thus non-zero, height. Let be an oriented path that winds around an arbitrary number of times. Then has arbitrarily large height and satisfies . Thus, .
We say that is trivial if for some oriented path .
Theorem 36. is trivial if and only if if and only if is bipartite.
Proof. If contains no arc, then the result is trivial, so we assume to contain an arc, in particular .
If is bipartite, then , and there exists an orientation of such that . Then . We have that is trivial.
If is non-bipartite, then it contains an odd cycle, so by Proposition 35, contains oriented paths of arbitrarily large height. But, observe that homomorphisms preserve height, in the sense, that if for two oriented paths and , then . So contains only oriented paths of bounded height. Thus cannot be trivial.
Acknowledgements: I would like to thank Marie Fortin and Daniela Petrisan for their guidance and exchanges. I would also like to thank Killian Barbé, Samuel Coulomb and Luc Passemand for their interest and the discussions we had together.
References
[1] André Arnold, Anne Dicky, and Maurice Nivat. A note about minimal non-deterministic automata. Bull. EATCS, 47:166–169, 1992.
[2] Symeon Bozapalidis and Antonios Kalampakas. Graph automata. Theoretical Computer Science, 393(1):147–165, 2008.
[3] Stefano Crespi-Reghizzi and Pierluigi San Pietro. From regular to strictly locally testable languages. Int. J. Found. Comput. Sci., 23(8):1711–1728, 2012.
[4] Péter L. Erdős, Dömötör Pálvölgyi, Claude Tardif, and Gábor Tardos. Regular families of forests, antichains and duality pairs of relational structures. Comb., 37(4):651–672, 2017.
[5] Santiago Guzmán-Pro and César Hernández-Cruz. Duality pairs and homomorphisms to oriented and unoriented cycles. The Electronic Journal of Combinatorics, 28(3), Jul. 2021.
[6] P. Hell, J. Nešetřil, and X. Zhu. Duality and polynomial testing of tree homomorphisms. Transactions of the American Mathematical Society, 348(4):1281–1297, 1996.
[7] László Miklós Lovász. Operations with structures. Acta Mathematica Academiae Scientiarum Hungarica, 18:321–328, 1967.
[8] Yu. T. Medvedev. On a class of events representable in a finite automaton. MIT Lincoln Laboratory Group Report, 34-73, 1958. Translated by J. J. Schorr-Kon. Originally published in Russian in Automaty (Automata Studies), C. E. Shannon and J. McCarthy (Eds.), Moscow, 1956.
[9] Reza Naserasr and Cyril Pujol. On core of categorical product of (di)graphs. CoRR, abs/2505.07463, 2025.
[10] Jaroslav Nešetril and Aleš Pultr. On classes of relations and graphs determined by subobjects and factorobjects. Discrete Mathematics, 22(3):287–300, 1978.
[11] Jaroslav Nešetril and Claude Tardif. Duality theorems for finite structures (characterising gaps and good characterisations). Journal of Combinatorial Theory, Series B, 80(1):80–97, 2000.
[12] S. Poljak and V. Rödl. On the arc-chromatic number of a digraph. Journal of Combinatorial Theory, Series B, 31(2):190–198, 1981.