Duality pairs and homomorphisms to oriented and unoriented cycles

In the homomorphism order of digraphs, a duality pair is an ordered pair of digraphs $(G,H)$ such that for any digraph, $D$, $G\to D$ if and only if $D\not\to H$. The directed path on $k+1$ vertices together with the transitive tournament on $k$ vertices is a classic example of a duality pair. This relation between paths and tournaments implies that a graph is $k$-colourable if and only if it admits an orientation with no directed path on more than $k$-vertices. In this work, for every undirected cycle $C$ we find an orientation $C_D$ and an oriented path $P_C$, such that $(P_C,C_D)$ is a duality pair. As a consequence we obtain that there is a finite set, $F_C$, such that an undirected graph is homomorphic to $C$, if and only if it admits an $F_C$-free orientation. As a byproduct of the proposed duality pairs, we show that if $T$ is a tree of height at most $3$, one can choose a dual of $T$ of linear size with respect to the size of $T$.


Introduction
Our main result can be considered in three different contexts. We now present a brief introduction to each of them.
The Roy-Gallai-Hasse-Vitaver Theorem [3,5,13,15] states that a graph is k-colourable if and only if it admits an orientation with no directed path on more than k vertices. This result is a consequence of the fact that a digraph D is homomorphic to the transitive tournament on k vertices, T T k , if and only if the directed path on k + 1 vertices, − → P k+1 , is not homomorphic to D. In terms of duality pairs, ( − → P k+1 , T T k ) is a duality pair in the homomorphism order of digraphs. In [12] Nešetřil and Tardif proved that if (A, B) is a duality pair in the homomorphism order of digraphs, then A is an oriented tree. Moreover, for any oriented tree, T , there is a digraph D T (the dual of T ), such that (T, D T ) is a duality pair in the homomorphism order of digraphs. Their result is actually more general, dealing with relational structures, so, as other authors have done, we consider a restriction for the context of this work. In fact, in [11], the same authors consider the problem restricted to digraphs and, for a given oriented tree T , they construct a digraph D T such that (T, D T ) is a duality pair. Their construction is simple, but of size exponential on |V T |, raising the following question, can one choose D T to be of polynomial size with respect to |V T |? For instance, for the family of directed paths, one can choose D T to be the corresponding dual transitive tournament, and thus D T is of linear size when T is a directed path.
Similar notions of duality have been studied also in the context of digraph homomorphisms. In [9], Hell and Zhu defined the class of B-cycles as special orientations of cycles, and showed that for a fixed B-cycle, C, a digraph D is not homomorphic to C, if and only if there exists a path P homomorphic to D, which is not homomorphic to C. They call this notion of duality path duality.
For a set of oriented graphs F the class of F -graphs is the class of undirected graphs that admit an F -free orientation. In [14], Skrien found a structural characterization for the class of F -graphs when F is a set of oriented paths on 3-vertices. Some of these are proper interval graphs, proper circular-arc graphs and comparability graphs. In [4], Skrien's study of F -graphs is extended to any set of oriented graphs on 3 vertices. Two of these classes are still lacking a complete structural characterization; the so-called perfectly orientable graphs [14], and the transitive-perfectly orientable graphs [4]. In terms of F -graphs, the Roy-Gallai-Vitaver-Hasse Theorem states that, when F is the set of oriented graphs on k + 1 vertices with a hamiltonian directed path, the class of F -graphs is the class of k-colourable graphs. In this case, one can assume that such an orientations is also acyclic. The class of graphs that admit an acyclic F -free orientation is the class of F * -graphs [14]. Another example of such classes are chordal graphs: when F consists of the orientation of the path on 3 vertices such that one vertex has 2 out-neighbours, the class of F * -graphs is the class of chordal graphs. This statement follows from the fact that a graph is chordal if and only if it admits a perfect elimination ordering [2].
Even though we mainly deal with duality pairs in the homomorphism order of digraphs, the whole paper is motivated by the study of characterizations of graph classes as F -graphs, for a finite set F . For each positive integer n, n ≥ 3, we present a finite set of oriented graphs F n such that F n -graphs are precisely C n -colourable graphs, i.e., graphs that admit a homomorphism to the n-cycle. In a way similar to the Roy-Gallai-Vitaver-Hasse Theorem, we use duality pairs as a tool to find such a set F n .
From the viewpoint of oriented cycles and path dualities, it turns out that our result yields another class of cycles, in addition to the B-cycles studied in [9], having path duality. The class we propose, AC-cycles, is somewhat more restrictive, but the result can be strengthened: for any AC-cycle, C, we obtain an oriented path P C , such that a digraph D is not homomorphic to C, if and only if P C is homomorphic to D.
The class of AC-cycles corresponds to the family of duals, D P , for oriented paths P in a special set, for the moment the set Q. Moreover, these AC-cycles are duals of linear size with respect to their corresponding path P . In [8] Hell and Nešetřil showed that the core of any oriented tree of height 3 is a path in Q. Hence, we conclude that for any tree T of height at most 3, one can choose a dual D T of linear size with respect to the core of T , and thus of linear size with respecto to T . The rest of this work is structured as follows. In Section 2, we introduce basic notation, concepts and results needed for later developments. Our main result is stated and proved in Section 3. Finally, in Section 4 we consider the different interpretations of our main result in the three contexts introduced above. Conclusions are briefly presented in Section 5.

Preliminary results
When G and H are graphs, we write G → H to denote that G is homomorphic to H. When x and y are vertices of a digraph D, we write x → y to denote that (x, y) is an arc of D. It should always be clear from the context to which interpretation of the symbol → we are referring to. Nonetheless, when speaking of homomorphisms, we will use capital letters for digraphs, and when dealing with arcs in a digraph, we will use small-case letter for vertices.
An oriented path P is a sequence of distinct vertices (p 0 , . . . , p n ) such that, for each i ∈ {0, . . . , n − 1}, either p i p i+1 ∈ A P , or p i+1 p i ∈ A P (but not both), and P has no more arcs. If p i → p i+1 we say that (p i , p i+1 ) is a forward arc; if p i+1 → p i the arc (p i+1 , p i ) is a backward arc. The direction in which P is traversed is emphasized by saying that the initial vertex of P is p 0 and the terminal vertex of P is p n . If all arcs in P are forward (backward) arcs, we say that P is a directed path, with forward (backward) direction and denote it by − → P n+1 ( ← − P n+1 ), where n is the number or arcs of P . An oriented path is alternating if every two successive arcs are oppositely oriented. We denote by A n , the alternating path on n vertices that begins with a forward arc, if n = 1, then A n denotes the single vertex with no arcs. A semi-walk on a digraph D, is a sequence v 1 a 1 v 2 a 2 . . . a n−1 v n , where v i ∈ V D for i ∈ {1, . . . , n}, and a i is an arc with endpoints v i and v i+1 , for i ∈ {1, . . . , n − 1}. An arc a i in a semi-walk is a forward arc if a i = (v i , v i+1 ); otherwise, we say it is a backward arc. A semi-walk is closed if v 1 = v n . The pattern of the semi-walk v 1 a 1 v 2 a 2 . . . v n , is a sequence l 1 . . . l n−1 of symbols in {→, ←}, where l i =→ if a i is a forward arc; l i =← otherwise.
An oriented cycle C is an oriented graph obtained by identifying the initial and terminal vertex of an oriented path P . If all arcs have the same direction, we speak of a directed cycle, and denote it by − → C n . The net length ℓ(X) of an oriented path or oriented cycle, X, is the number of forward arcs minus de number of backward arcs in X. The following statement if proved in [6], but we use the restatement found in [10] for its simplicity. Theorem 1.
[10] For n ≥ 1, an oriented graph G is homomorphic to − → P n , if and only if, every oriented path homomorphic to G has net length at most n.
Theorem 1 shows that directed paths have path duality. Now we introduce another family of oriented graphs, proposed by Hell and Zhu in [9], that have path duality. An oriented path P is minimal if it contains no proper oriented P ′ such that ℓ(P ′ ) = ℓ(P ). An oriented cycle C = (c 0 , . . . , c n , . . . , c m−1 , c 0 ) is a B-cycle, if (c 0 , . . . , c n ) is a forward directed path, and (c 0 , c m−1 , . . . , c n ) is a minimal oriented path of net length n − 1. As mentioned in Section 1, B-cycles have path duality.
A digraph G is balanced if every oriented cycle in G has net length zero. A digraph on n vertices is balanced if and only if D → − → P n−1 (see [7]). Since every directed cycle has positive net length, every balanced digraph must be acyclic, and thus there is at least one vertex with no in-neighbours. Let G be a connected balanced digraph and x ∈ V G such that d − (x) = 0. We define the level of vertex v ∈ V G as the net length of any oriented path from x to v. The fact that the level of every vertex is well-defined follows from the choice of G, i.e. connected and balanced. The maximum level of the vertices in G is called the height of G. For two digraphs G and H, the interval [G, H] consists on all digraphs M such that G → M → H. The following statement is a useful and well-known result about the homomorphism order of digraphs. In this case, we say that H is a dual of G. It is not hard to notice that if such a dual exists, then it is unique up to homomorphic equivalence. The transitive tournament on n vertices is denoted by T T n . A classical example of a family of duality pairs, is given by the following theorem.
We conclude this section with the following straightforward observation that we will use more than once in this work.

Main results.
We first define the family of oriented paths for which we will find a family of duals. For n ≥ 3 we denote by Q n the oriented path on n vertices (q 0 , . . . , q n−1 ) with the following properties: the first two arcs are forward arcs, the suboriented path (q 1 , . . . , q n−2 ) is an alternating path, and the two final arcs have the same direction. Note that, by the first two conditions, (q 1 , . . . , q n−k ) = A n−(k+1) for 1 ≤ k ≤ (n − 3), and (q n−3 , q n−2 , q n−1 ) = − → P 3 or (q n−3 , q n−2 , q n−1 ) = ← − P 3 , depending on the parity of n. This is illustrated in Figure 1. In particular, Q 3 and Q 4 are the directed paths on 3 and 4 vertices respectively. Observation 6. For every integer n, n ≥ 5, Q n is homomorphic to Q n−2 . In particular, if n is even then Proof. Let n be an integer, n ≥ 5, and let Q n = (q 0 , . . . , q n ). By identifying q 3 with q 1 , and q 4 with q 2 , we obtain a homomorphism from Q n to Q n−2 .
It is also straightforward to calculate the net length of the oriented paths Q n .
Thus, by Observations 6 and 7, and Theorem 1 the following statement holds.
Lemma 8. For every integer n, n ≥ 4, Q n is homomorphically equivalent to − → P 3 if and only if n is odd.
For n ≥ 3, we denote by AC n the oriented cycle obtained from identifying the initial and terminal vertices of the alternating path A n+1 . For this work we will denote the vertices of AC n as (a 0 , a 1 , . . . , a n−1 , a 0 ). Note that, if n is even, every two consecutive arcs have opposite direction, and if n is odd, every pair of consecutive arcs, except for a n−1 → a 0 → a 1 , have opposite direction. In Figure 2 we illustrate A 4 , AC 4 , A 5 and AC 5 .
Lemma 9. For every integer n, n ≥ 4, the cycle AC n is homomorphically equivalent to − → P 2 if and only if n is even.
Proof. Since − → P 2 is an asymmetric arc, then − → P 2 is homomorphic to any non-trivial oriented graph. If n is even, every two consecutive arcs of AC n have opposite direction, thus, the largest directed path of AC n is − → P 2 . But if n is odd, there is a copy of − → P 3 contained in AC n . Therefore, by Theorem 4, AC n is homomorphic to P 2 if and only if n is even. In order to avoid a very long proof for our main result, we attempt to break it down in a reasonable amount of statements. We start with the following one.
Proposition 10. For every integer n, n ≥ 4, the oriented path Q n+1 is not homomorphic to AC n .
Proof. If n is even, the result follows from Lemmas 8 and 9, Observation 5 and Theorem 4. Proceeding by contradiction, suppose that there is an odd integer n ≥ 5 and a homomorphism ϕ : Q n+1 → AC n . We first show that ϕ is not a surjective mapping. Recall that the only vertex in AC n with in-degree and out-degree greater that 0 is a 0 . Note that the only vertices in Q n+1 = (q 0 . . . q n ) with in-degree and out-degree greater than 0, are q 1 and q n−1 . Thus, ϕ(q 1 ) = a 0 = ϕ(q n−1 ), and hence ϕ(q 0 ) = a n−1 = ϕ(q n−2 ) and ϕ(q 2 ) = a 1 = ϕ(q n ). Since |V Qn − {q 0 , q 1 , q 2 , q n−2 , q n−1 , q n }| = n − 5, and (n − 5) + 3 < n = |V ACn |, ϕ is not surjective. Now we observe that the existence of such a non-surjective homomorphism leads to a contradiction. First, it is not hard to verify that AC n − a i is homomorphic to − → P 3 for any i ∈ {2, . . . , n − 2}. Since ϕ is not surjective, and by previous arguments {a n−1 , a 0 , a 1 } ⊆ ϕ[V Q n+1 ], then by composing homomorphisms, Q n+1 is homomorphic to − → P 3 . Which contradicts the fact that ℓ(Q n+1 ) = 4 (Observation 7) and Theorem 1.
Proposition 10 implies that if G is a digraph and Q n+1 → G then G → AC n . To prove the converse implication, for any connected oriented graph G and any odd integer n, n ≥ 5, we will construct an n-ordered cover of V G , i.e., an ordered sequence of n subsets of vertices that cover V G . We recursively define the n-cyclic cover of a connected oriented graph G as follows. If the recursion finishes in the first step, i.e., G has no vertices with in-and out-neighbours, we say that the n-cyclic cover of G is a directed bipartition of G. The following simple properties of the n-cyclic cover account for half the proof of our main result.

If there is no vertex with in-and out-neighbours, let
Lemma 11. Let n be an odd integer, n ≥ 5, and let G be a connected oriented graph with n-cyclic cover (A 0 , A 1 , . . . , A m , D m , D m−1 , . . . , D 1 ). Proof. The statements of this lemma are clear when the n-cyclic cover is a directed bipartition, so will assume that the vertices in A 0 have both in-and out-neighbours. Since every vertex in V G − A 0 has either empty out-neighbourhood or empty in-neighbourhood, then, by definition of D 1 (A 1 ), every vertex in D 1 (A 1 ) has an out(in)-neighbour in A 0 , so it has an empty in(out)-neighbourhood. For i ∈ {2, . . . , m} the first statement follows inductively.

For every
To prove the second item, first note that G is connected, and thus, the sets (A 0 , A 1 , . . . , A m , D m , D m−1 , . . cover V G . By construction of these sets, if 1 ≤ i < j ≤ m, the following intersections are empty: A i ∩ D j , A i ∩ A j , D i ∩ D j , and D i ∩ A j . By the first statement, for every i ∈ {1, . . . , m}, we have that A 0 ∩ D i , A 0 ∩ A i and A i ∩ D i are empty as well. Hence  (A 0 , A 1 , . . . , A m , D 1 , . . . , D m ) is a cover of V G with pairwise disjoint sets, i.e., a partition of V G with possible empty sets.
For the third statement, note that for i ∈ {1, . . . , m}, the existence of an arc within a set A i (D i ) would imply that there is a vertex in A i (D i ) with in-and out-degree at least one, which contradicts the fact that A i , D i ⊆ V G − A 0 . Thus A i and D i are independent sets for i ∈ {1, . . . , m}. Hence, the sets of the n-cyclic cover of G are independent if and only if A 0 is an independent set.
Finally, for a vertex x ∈ V G , denote by i(x) the index of the partition class to which x belongs to. Notice that by the BFS style of constructing the elements of the cover, if (x, y) ∈ A G , then |i(x) − i(y)| ≤ 1. By the first statement, for i ∈ {1, . . . , m − 1} there are no arcs between classes D i and A i+1 , nor between A i and D i+1 . Therefore the last statement holds.
For an oriented graph G we denote by Cyc(n, G) its n-cyclic cover. If Cyc(n, G) is not a directed bipartition, we choose two functions, l n , r n : A 0 → V G , such that l n (x) and r n (x) are in-and out-neighbours of x, respectively. Similarly, we choose p n : Theorem 12. Let n be an odd integer, n ≥ 5, and G an oriented graph. Then, the following statements are equivalent: • Cyc(n, G) induces a homomorphism of G to AC n , • for every even integer l, 4 ≤ l ≤ n + 1, and a semi-walk W in G, W does not follow the same pattern as Q l , and Proof. Clearly the second item implies the first one, and by Proposition 10 the first item implies the fourth one. Suppose that the negation of the third item holds, i.e., there is a positive integer l, 4 ≤ l ≤ n + 1, and a semi-walk W in G, such that W follows the same pattern as Q l . Then there is a homomorphism ϕ : Q l → G, so by Observation 6 there is a homomorphism ϕ : Q n+1 → G. So by contrapositive, the fourth item implies the third one.
Before showing that the third statement implies the second one, we state the following claim.
Claim 1. If A 0 is an independent set, and there are no arcs between A i and D i for any i ∈ {1, . . . , m − 1}, then Cyc(n, G) induces a homomorphism of G to AC n .
If A 0 is an independent set, then by Lemma 11.3 every set in Cyc(n, G) is independent. Moreover, if there are no arcs between D i and A i for any i ∈ {1, . . . , m − 1}, by Lemma 11.4 every arc in G has endpoints in consecutive sets of (A 0 , A 1 , . . . , A m , D m , . . . , D 1 ). Hence, the function ϕ : G → AC n defined by ϕ(x) = a i if x ∈ A i , and ϕ(x) = a n−i if x ∈ D i , is a homomorphism between the underlying graphs of G and AC n . The fact that ϕ also preserves orientations follows from Lemma 11.1. Now, we proceed to prove that the third statement implies the second one by contrapositive. By Claim 1 it suffices to show that if there is an arc with either both endpoints in A 0 , or one in D i and the other in A i for some i ∈ {1, . . . , m − 1} then there is positive integer l, 4 ≤ l ≤ n + 1, and a semi-walk in G that follows the same pattern as Q l . Suppose that there is an arc (x, y) ∈ A G with x, y ∈ A 0 , and let W = l n (x)xyr n (y). By the choice of l n (x) and r n (y), and the fact that x → y, we conclude that W follows the same pattern as Q 4 .
Assume that there is an integer k ∈ {1, . . . , m − 1} and an arc with endpoints a k ∈ A k and d k ∈ D k . We construct two paths as follows; let W a = a −1 a 0 a 1 · · · a k , where a k = a, a −1 = l n (a 0 ) and for i ∈ {1, . . . , k −1}, a i = p n (a i+1 ); and First note that the number of vertices (with possible repetitions) in W is 2k + 4. Clearly, 2k + 4 is even, and since k < n−1 2 and n + 2 is odd, then 2k + 4 ≤ n + 1. The fact that W follows the same pattern as Q 2k+4 , is a consequence of Lemma 11.1, the properties of l n , r n and p n , and the choice of W a and W d , i.e., a i−1 = p n (a i ), d i−1 = p n (d i ), a −1 = l n (a 0 ), and d −1 = r n (d 0 ). Therefore, if Cyc(n, G) does not induce a homomorphism of G to AC n , there is a semi-walk in G that follows the pattern of Q l for some even integer l, 4 ≤ l ≤ n + 1.
It is straightforward to verify that if a digraph D has a symmetric arc, then every oriented tree is homomorphic to D. Also, if G is an oriented graph, then D is not homomorphic to G. So if T is an oriented tree, and D T any of its duals, then D T is an oriented graph, T → D, and D → D T . For this reason, we state and prove the following theorem for oriented graphs only, but clearly it also holds for general digraphs.
Theorem 13. Let n be an integer, n ≥ 4, an oriented graph G is homomorphic to AC n if and only if Q n is not homomorphic to G. In other words, the ordered pair (Q n+1 , AC n ) is a duality pair.
Proof. If n is even, by Lemma 8, Q n+1 is homomorphically equivalent to − → P 3 , and by Lemma 9 AC n is homomorphically equivalent to − → P 2 . Thus, by Observation 5, if n is even, (Q n+1 , AC n ) is a duality pair if and only if ( − → P 3 , − → P 2 ) is a duality pair. The later statement holds since − → P 2 ∼ = T T 2 , and ( − → P 3 , T T 2 ) is duality pair (Theorem 4). If n = 3, we conclude by Theorem 4. Finally, if n ≥ 5 is odd, we conclude by Theorem 12.
In Figure 3 we exhibit two of the duality pairs described in Theorem 13.

Implications
We say that an oriented cycle C is an AC-cycle if C ∼ = AC n for some positive integer n. The following result is a weaker version of Theorem 13.
Corollary 14. Let C be an AC-cycle. A digraph D is homomorphic to C, if and only if every oriented path homomorphic to D is also homomorphic to C.
Thus, in terms of path dualities, we can extend Theorem 2 with this corollary as follows.
Theorem 15. Any oriented cycle C that is a B-cycle or an AC-cycle, has path duality, i.e., a digraph G is homomorphic to C, if and only if every path homomorphic to G is also homomorphic to C.
Recall that a digraph is a core, if and only if it is not homomorphic to any proper subgraph. The following statement is a well-known result in homomorphism order of digraphs.
, then G is homomorphically equivalent to Q n for some even integer n ≥ 4. Moreover for every even integer, n ≥ 4, the path Q n is a core. Now, we give a partial answer to the problem of determining if one can choose a dual, D T , of an oriented tree, T , of polynomial size with respecto to |V T |.
Theorem 17. Let T be an oriented tree of positive height at most 3, and P T its core. One can choose a dual D T of T of linear size with respect to |V P T |. Since |V P T | ≤ |V T |, then D T is of linear size with respect to |V T |.
Proof. If T 1 is a tree of height 1, then − → P 2 is homomorphically equivalent to T 1 . When T 2 is a tree of height 2, then T 2 is homomorphically equivalent to − → P 3 . So by Theorem 4, (T 1 , T T 1 ) and (T 2 , T T 2 ) are duality pairs.
If T 3 is a tree of height 3, then by Propositions 3 and 16, T 3 is homomorphically equivalent to a path P , and P ∼ = Q n+1 for an odd integer n, n ≥ 3. Thus, by Theorem 13, (T 3 , AC n ) is a duality pair. For a tree T in any of these cases, the size of the chosen dual is linear with respecto to the core of T .
Finally, we connect our result to the study hereditary graph properties characterized as the class of F -graphs for a finite set F . For n ≥ 4 an even integer, denote by F n , the set of surjective homomorphic images of Q n . Clearly, F n is a finite set since the order of any oriented graph in F n is bounded by n.
Theorem 18. Let G be a graph, n ≥ 4 an even integer, and C the cycle on n − 1 vertices. Then G is C n−1 -colourable if and only if G is an F n -graph. That is, there is an orientation of G with no induced oriented graph in F n .
By Observation 6, the directed path on 4 vertices belongs to F n for an even integer n ≥ 4. Thus, it is straightforward to notice that the directed 3-and 4-cycles also belong to F n . Thus, from the previous corollary we obtain the following one.
Corollary 19. Let G be a graph, n ≥ 4 an even integer, and C the cycle on n − 1 vertices. Then G is C n−1 -colourable if and only if G is an (F n − { − → C 3 , − → C 4 }) * -graph. That is, there is an acyclic orientation of G with no induced oriented graph in F n − { − → C 3 , − → C 4 }.
In particular, F 6 consists of the eight oriented graphs depicted in Figure 4. Corollary 20. The following statements are equivalent for a graph G.
• G is homomorphic to the 5-cycle, • G admits an orientation that has no semi-walk with pattern →→←→→,

Conclusions
Consider an odd integer n, n ≥ 5, and an oriented graph G. Note that by the recursive definition of Cyc(n, G) and the proof of Theorem 12, we obtain a polynomial-time certifying algorithm that determines if an oriented graph G is homomorphic to AC n . The yes-certificate is the cover Cyc(n, G) that induces a homomorphism ϕ : G → AC n , and the no-certificate is a semi-walk W with l arcs of G, such that l is even, 4 ≤ l ≤ n + 1, and W follows the same pattern as Q l .
As a nice consequence, we obtain that graphs admitting a homomorphism to an odd cycle can be characterized as those graphs having an orientation avoiding a well defined finite set of oriented graphs.
Theorem 17 seems to suggest that the existence of a dual for an oriented tree, which is linear on the order of the tree, is not such a rare phenomenon. Although the evidence for an affirmative answer is sparse, we finish this work by proposing the following questions.
Question 21. Is it true that for any oriented tree T , there is a dual D T of T of linear size with respect to |V T |?
In the event that the answer to Question 21 results negative, from the results obtained in the present work, the following question still makes sense.
Question 22. Is it true that for any oriented path P , there is a dual D P of P of linear size with respect to |V P |?