Cycles of length 3 and 4 in edge-colored complete graphs with restrictions in the color transitions

Let $G$ be an edge-colored graph, a walk in $G$ is said to be a properly colored walk iff each pair of consecutive edges have different colors, including the first and the last edges in case that the walk be closed. Let $H$ be a graph possible with loops. We will say that a graph $G$ is an $H$-colored graph iff there exists a function $c:E(G)\longrightarrow V(H)$. A path $(v_1,\cdots,v_k)$ in $G$ is an $H$-path whenever $(c(v_1v_2),\cdots,$ $c(v_{k-1}v_k))$ is a walk in $H$, in particular, a cycle $(v_1,\cdots,v_k,v_1)$ is an $H$-cycle iff $(c(v_1 v_2),\cdots,c(v_{k-1}v_k),$ $c(v_kv_1), c(v_1 v_2))$ is a walk in $H$. Hence, $H$ decide which color transitions are allowed in a walk, in order to be an $H$-walk. Whenever $H$ is a complete graph without loops, an $H$-walk is a properly colored walk, so $H$-walk is a more general concept. In this paper, we work with $H$-colored complete graphs, with restrictions given by an auxiliary graph. The main theorems give conditions implying that every vertex in an $H$-colored complete graph, is contained in an $H$-cycle of length 3 and in an $H$-cycle of length 4. As a consequence of the main results, we obtain some well-known theorems in the theory of properly colored walks.


Introduction
We assume that the reader is familiar with the standard terminology on graph theory, and for further notation and terminology not defined here, we refer the reader to [5].In this paper we work with simple finite graphs.Whenever G is a graph, V (G) will denote the set of vertices and E(G) the set of edges of G.The order of the graph G is its number of vertices |V (G)|.
A graph G of order n is said to be pancyclic iff it contains a cycle of length l for every l in {3, • • • , n}, and G is called vertex-pancyclic whenever each vertex of G belongs to a cycle of length l for each l in {3, • • • , n}.The pancyclicity and the vertex-pancyclicity in graphs have been deeply studied since 1971, when Bondy conjectured in [6] that almost every non-trivial condition implying that a graph G is hamiltonian, also implies that G is pancyclic.At least 127 papers have been published in these topics, see for example [2], [7] and [8].Bondy's metaconjecture has been verified by adding some extra conditions, and since vertex-pancyclicity implies pancyclicity and pancyclicity implies hamiltonicity, this motivates the research of conditions implying the vertex-pancyclicity in a graph.In [20], Ming-Chu Li et al. proved that determining wheter a graph is pancyclic (or vertex-pancyclic) is an N P -complete problem, even for 3-connected cubic planar graph.
We can think in the following application: a travel agency has offices in n cities, between some of which it is possible to travel directly (avoiding any other city).To offer a large variety of trips, the tourism agency want to determine if for every k in {3, • • • , n} there exists a tour starting and ending in the same city, and passing by each of k cities exactly once in some order.Moreover, they want to determine if this is possible to do it regardless the departure city.Therefore, in terms of Graph Theory, we want to determine whether the graph associated with the problem is pancyclic or vertex-pancyclic.Now we can consider the following application in relation to the means of transportation: for each two consecutive cities on a given tour, there exists several ways to travel (say bus, plane, train, boat, and so on), and according to the customer's preferences, there will be some transport transitions that should be avoided, and some others that will be needed.For example, if from city A to city B the customer traveled by plane, then from city B to city C the travel must be done by train, or another possibility is that the customer prefers to do the tour exclusively by bus.
We can represent this situation with an edge-colored multigraph, where each vertex represents a city, and in order to make more visual the representation of this problem, we will have an edge with color i between two different vertices A and B, whenever we can travel from the city A to the city B directly by the i-th means of transportation.In this modify problem, it does not suffices to find a cycle of length k for every k in {3, • • • , n}, but now we have to find a cycle (tour) of length k according to the restrictions given by the color transitions in the obtained edge-colored multigraph (customer).
In this paper, we work in an edge-colored simple graph G and we deal with the problem of finding conditions implying that, for each vertex x of G there exists an edge-colored cycle of length 3 (respectively 4) containing x with some constraints given in the coloring of the graph.
A walk in an edge-colored graph is a properly colored walk, iff every two consecutive edges have different colors, including the first and last edges when the walk is closed.The theory of properly colored walks has relevance in Graph Theory and Algorithms [18] and [29].The study of applications on properly colored structures starts in 1891, with the remarkable paper by Petersen (see [23]).Properly colored walks have shown to be an effective way to model some real applications in different fields, as we can mention Genetic and Molecular biology [10], [11], [24], Social Sciences [9], Engineering and Computer Science [1], [26], [28], and Management Science [30], [31].There exist some classical results in the theory of properly colored walks, we have for example Kotzig's Theorem [19], which provides a characterization of edge-colored multigraphs, having properly colored closed Euler trails.As closed trails contain cycles, we can ask whether a properly colored trails contain properly colored cycles, and in general, ask for conditions implying the existence of properly colored cycles.Solving this question, in 1983 Grossman and Häggksvit [16] proved Theorem 1.1 when c = 2, and later Yeo proved it for every c ≥ 2. Although the problem of determining the existence of properly hamiltonian cycles, in 2-edge-colored graphs is N P -complete (see [4]), we can check whether an c-edge-colored graph have a properly colored cycle in polynomial time, using a recursive algorithm provided by Yeo's Theorem.Moreover, in [17] the authors proved that a shortest properly colored cycle can be found in polynomial time.For a classical survey in this topic, see chapter 16 in [4], and a more recent survey can be found in [3] and [21].
Theorem 1.1 (Yeo,[32]).Let G be a c-edge-colored graph, c ≥ 2, with no properly colored cycle.Then, G has a vertex z in V (G), such that no connected component of G − z is joined to z, with edges of more than one color.
In view of these theorems, it is natural to ask for conditions implying the existence of colored walks, with restrictions in the color transitions.In [27] is a fixed sequence of colors for some colors c 1 , • • • , c k in C, then P is an orderly colored path, if the colors of consecutive edges in P follow the color sequence defined by O. Notice that, if P is an orderly colored path following the color sequence O, and the length of O equals 2 with the two colors of O different, then P is a properly colored path.For other applications motivating the study of colored paths with constraints in the color sequence, see [27].
The following concepts, which are more general than the previous one, were introduced in a work developed by Linek and Sands in [22], in the context of kernels in arc-colored directed graphs.
Let H be a graph possibly with loops and G be a graph.We say that G is an H-colored graph whenever there exists a function c : ) is a walk in H. Notice that, if H is the complete graph without loops, then an H-path is a properly colored path.Moreover, the concept of H-path generalizes the concept of orderly colored path, because if The study of the existence of certain H-walks in H-colored graphs, began in [14] in a work entitled "Some Conditions for the Existence of Euler H-trails".In [15], the authors extended Theorem 1.1 in the context of H-coloring, so they found structural conditions implying the existence of H-cycles in an H-colored graph, although no information about the length of such a cycles was provided.In [13], the authors gave conditions implying the existence of an H-cycle of length at least |V (G)| 3 + 1 in an H-colored graph G.An interesting auxiliary graph in working with H-colorings was defined by Kotzig in [19] and proved be cumbersome, in [13], [14] and [15]: 19]).Let H be a graph possibly with loops and G be an H-colored graph with a fixed H-coloring c : E(G) −→ V (H).For each non-isolated vertex x of G, we denote by G x the graph defined as follows: Notice that for every non-isolated vertex x in V (G), G x is a simple graph.Let H be a graph possibly with loops, G an H-colored graph, The interest of defining obstruction of a walk and the auxiliary graph G x , is established in the following observation.
Observation 1.1.Let H be a graph possibly with loops, and G be an H-colored graph, such that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Suppose that {ux, vx} is a subset of E(G).The following statements are equivalent: 1. ux and vx are in different parts of the k x -partition of V (G x ).
2. ux and vx are adjacent in G x .

4.
x is not an obstruction of the path (u, x, v).
As a direct consequence of Observation 1.1 and the definition of H-cycle, we have the following result.
Observation 1.2.Let H be a graph possibly with loops, and G be an H-colored graph, such that for every x in The following statements are equivalent: In [15] was proved that, given any graphs H and G, there exists an H-coloring of G such that, for every x in V (G), either G x is a complete bipartite graph or E(G x ) = ∅.
In this paper, we work with H-colored complete graphs with restrictions given by the auxiliary graph G x .The main results are the following: Theorem 1.2.Let H be a graph possibly with loops and G be an H-colored complete graph of order n, with n ≥ 3, such that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Suppose that 1.For every x in V (G), k x ≥ n+1 2 , 2. G does not contain a cycle of length 4 with exactly 3 obstructions.
Then each vertex of G is contained in an H-cycle of length 3.
Theorem 1.3.Let H be a graph possibly with loops and G be an H-colored complete graph of order n, with 4 ≤ n < 9, such that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Suppose that 1.For every x in V (G), k x ≥ n+1 2 , and 2. G does not contain a cycle of length 4 with exactly 3 obstructions.
Then each vertex of G is contained in an H-cycle of length 4.
Theorem 1.4.Let H be a graph possibly with loops and G be an H-colored complete graph of order n, with n ≥ 9, such that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Suppose that 1.For every x in V (G), k x ≥ n+1 2 , 2. G does not contain a cycle of length 3 with exactly 2 obstructions, and 3. G does not contain a cycle of length 4 with exactly 3 obstructions.
Then each vertex of G is contained in an H-cycle of length 4.
As a consequence of Theorems 1.3 and 1.4 we have the following corollary.
Corollary 1.1.Let H be a graph possibly with loops and G be an H-colored complete graph of order n, with n ≥ 4, such that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Suppose that 1.For every x in V (G), k x ≥ n+1 2 , 2. G does not contain a cycle of length 3 with exactly 2 obstructions, and 3. G does not contain a cycle of length 4 with exactly 3 obstructions.
Then each vertex of G is contained in an H-cycle of length 4.
Let H be a graph possibly with loops and G be an H-colored graph.We say that G is H-pancyclic iff it contains an H-cycle of length l for each l in {3, • • • , n}, and G is said to be H-vertex pancyclic whenever each vertex of G is contained in an H-cycle of length l for every l in {3, • • • , n}.
The main contribution of this paper is to begin the study of H-vertex-pancyclicity for H-colored graphs.Although we are considering small cycle lengths in H-colored complete graphs, our investigations have underlined that these results are not easy to proof.As a matter of fact, several authors agree that, in the investigation of vertex-pancyclicity of a graph, the consideration of small cycle lengths is the most difficult part (see [25]).Moreover, these are the first essential steps in order to obtain a result implying the H-vertex-pancyclicity in an H-colored graph.
This paper is organized as follows: in section 2, we show the basic concepts and notation which will be useful in the developing of this work.In section 3, we exhibit some structural properties on the graph G x , and we introduce the H-dependency property in an H-colored graph, which will be essential in order to prove the main results.In section 4, we prove the main theorems, and we exhibit explicit examples showing that the hypotheses of the first main theorem are tight.Finally, as a direct consequence of the main results, we obtain some classical theorems about the existence of properly colored cycles.
Given a digraph D and a vertex v in V (D), we denote by δ + (v) the out-degree of the vertex v, and by ∆ + (D) the maximum out-degree of D.
We need the following result.

Terminology and Notation
Let G be a graph.In the rest of paper we will denote by: N G (u) the neighborhood and of v, δ sets, is said to be a complete k-partite graph iff for every x in A i and for every y in A j , x and y are adjacent in G, for every {i, j} subset of {1, • • • , k}, with i = j.

Previous results
In order to make feasible the proof of the main theorems, we show some structural properties on the graph G x and we introduce some extra notation.Observation 3.1.Let H be a graph possibly with loops, G be an H-colored graph without isolated vertices, and D an induced (by From now on, H is a, possibly with loops, graph and G is an H-colored complete graph with c : Let A be a subset of V (G) and v be a vertex in V (G) − A. We say that A has the H-dependence property with respect to the vertex v iff for every {a, a } subset of A, a is an obstruction of the walk (v, a, a ), or a is an obstruction of the walk (a, a , v).The following lemma follows directly from this definition.Lemma 3.1.Let A be a subset of V (G), A a subset of A and v ∈ V (G) − A. If A has the H-dependence property with respect to the vertex v, then A has the H-dependence property with respect to the vertex v. Proposition 3.1.Suppose that for every x in V (G), G x is a complete k x -partite graph for some k x in N. Let A be a subset of V (G) and v be a vertex in V (G) − A. If A has the H-dependence property with respect to the vertex v, then there exists some vertex a in A such that , and 2. if |A| ≥ 2, then a is an obstruction of the walk (v, a, a ) for some a in N D (a).
Proof.(1) Suppose that |A| = m for some m in N, and give an orientation of E(D) as follows: for every {x, y} subset of A, if x is an obstruction of the walk (v, x, y), then orient the edge from x to y.If x is an obstruction of (v, x, y) and y is an obstruction of the walk (v, y, x), then orient the edge xy arbitrarily.This orientation of the graph D is well-defined since A has the H-dependence property with respect to the vertex v. Let D be such orientation of the graph D. Notice that D is a tournament of order m, hence by Proposition 1.1, . By the construction of the tournament D , we have that for every i in {1, 2, • • • , s}, u is an obstruction of the walk (v, u, x i ), which implies by Observation 1.1 that ux i and uv are in the same set of the k u -partition of V (G u ).Hence, by Observation 3.1, ux 1 , ux 2 , • • • , ux s are in the same set of the l D u -partition of V (D u ), where s ≥ m−1 2 .Finally, as δ D (u) = m − 1, and we have that there exists at most m+1 (2) Let A be a subset of V (G) and v be in V (G) − A. We want to prove that, if A has the H-dependence property with respect to the vertex v, then there exists a vertex a in A such that l D a ≤ |A|+1 2 , where D = G[A], and moreover, if |A| ≥ 2, then a is an obstruction of (v, a, a ) for some a in N D (a).We proceed by induction on |A|, with |A| ≥ 2. First suppose that |A| = 2, say A = {x, y}.Since A has the H-dependence property with respect to the vertex v, hence x is an obstruction of the walk (v, x, y) or y is an obstruction of the walk (v, y, x).Suppose without loss of generality that x is an obstruction of the walk (v, x, y), thus x is the desired vertex, since If a is an obstruction of the walk (v, a, a ) for some a in N D (a), then a is the desired vertex.Suppose now that a is not an obstruction of the walk (v, a, a ) for every a in N D (a).Let A = A \ {a} be.By Lemma 3.1, A has the H-dependency property with respect to the vertex v.Moreover, given that |A | = m − 1 ≥ 2, the inductive hypothesis implies that there exists a vertex a in A such that 2 , where D = G[A ] and such that a is an obstruction of the walk (v, a , b) for some b in N D (a ).Since a is an obstruction of the walk (v, a , b), we have by Observation 1.1 that va and a b are in the same part of the k a -partition of V (G a ).Now, as A has the H-dependency property with respect to the vertex v and {a, a } is a subset of A, it follows that a is an obstruction of (v, a, a ) or a is an obstruction of (a, a , v).However, by our assumption about a, we have that a is an obstruction of the walk (a, a , v), which implies by Observation 1.1 that aa and va are in the same part of the k a -partition of V (G a ).Thus, aa and a b are in the same part of the k a -partition of V (G a ), in particular, by Observation 3.1 we have that aa and a b are in the same part of the l D a -partition of V (D a ).In addition, we have that 2 , and therefore a is the desired vertex.

Main Results
Proof of Theorem 1.2.
Proceeding by contradiction, suppose that there exists a vertex Observation 4.1.For every {i, j} subset of {1, 2, • • • , k v }, for each x in N v i and for any y in N v j , we have that: (1) v is not an obstruction of the cycle (v, x, y, v), and (2) x is an obstruction of the walk (v, x, y) or y is an obstruction of the walk (v, y, x). Proof.
(1) By construction of the sets N v i and N v j , it follows that vx and vy are in different parts of the k v -partition of V (G v ), which implies by Observation 1.1 that v is not an obstruction of the path (x, v, y), that is, v is not an obstruction of the cycle (v, x, y, v).
(2) Proceeding by contradiction, it follows directly from Observations 1.2 and 4.1(1) that (v, x, y, v) is an H-cycle of length 3 in G containing v, which is impossible by our assumption.
Renaming (if necessary) we can assume that  Proof.Recall that G a is a complete k a -partite graph for some k a in N, and P = {P a 1 , P a 2 , • • • , P a ka } is the k apartition of V (G a ) into independent sets.By the Observation 3.1 and given that D is an induced subgraph of G, it follows that Q = {P a i ∩ V (D a ) : ) into nonempty independent sets.Now, in order to prove this upper bound of k a = k G a in terms of l D a , consider the edges incident with a that are not Since a is an obstruction of the walk (v, a, a ) for some a in N D (a), thus va and aa are in the same part of the k a -partition of V (G a ) by the Observation 1.1.Moreover, as aa is in V (D a ), it follows that there exists α in {1, 2, • • • , l D a } such that aa ∈ P a α , so {aa , va} ⊆ P a α , where P a α is already considered in the first l D a parts of P. Hence, when we consider the edge va, we add no extra part in the k a -partition of V (G a ) with respect to the number of parts of the l D a -partition of V (D a ).Next, we will prove that for every j in {r + 1, • • • , k v }, we add at most one part in P with respect to the number of parts in Q.
Let j be an element of {r + 1, • • • , k v } and x be a vertex in N v j .
Case 1. a is an obstruction of the walk (v, a, x).
If a is an obstruction of the walk (v, a, x), then by Observation 1.1, va and ax are in the same set of the k a -partition of V (G a ), and given that va is in P a α , thus ax ∈ P a α , where P a α is already counted in the first l D a parts of P. Therefore, in this case we add no extra part in P with respect to the number of parts in Q.
Case 2. a is not an obstruction of the walk (v, a, x).If a is not an obstruction of the walk (v, a, x), then x is an obstruction of the walk (v, x, a), by Observation 4.1.Moreover, if a is not an obstruction of the walk (v, a, x), then by Observation 1.1, va and ax are in different sets of the k a -partition of V (G a ), with va ∈ P a α .We can assume that ax is in P a β for some β in {l D a + 1, • • • , k a }, otherwise, when we consider the edge ax, it is already counted in the first l D a parts of P.
Claim 3.1.For every y in N v j , ay ∈ P a α or ay ∈ P a β .
Proof.Let y be in N v j , with y = x.
Subcase 2.1 a is an obstruction of the walk (v, a, y).
Proceeding in a similar way as in Case 1, we can prove that va and ay are in the same set of the k a -partition of V (G a ), and given that va is in P a α , we have that ay ∈ P a α , as desired.Subase 2.2 a is not an obstruction of the walk (v, a, y).
Since a is not an obstruction of the walk (v, a, y), it follows that y is an obstruction of the walk (v, y, a) by Observation 4.1, and recall that x is an obstruction of the walk (v, x, a).On the other hand, given that {vx, vy} is a subset of N v j , we have by construction of the set N v j that vx and vy are in the same part of the k v -partition of V (G v ), which implies that v is an obstruction of the walk (x, v, y), by Observation 1.1.Hence, y, x and v are obstructions of the cycle C = (v, x, a, y, v), with (C) = 4, so it follows by the hypothesis 2 of Theorem 1.2 that a is also an obstruction of the cycle C.Since a is an obstruction of the cycle C, we have by Observation 1.1 that ay and ax are in the same part of the k a -partition of V (G a ), and given that ax ∈ P a β , thus ay ∈ P a β , as desired.
So Claim 3.1 is proved.
Since for every y in N v j , ay ∈ P a α with α in {1, 2, • • • , l D a }, or ay ∈ P a β with β in {l D a + 1, • • • , k a }, we have that for every j in {r + 1, • • • , k v } we add at most one part in P with respect to the number of parts in Q (namely . Hence, which is impossible since the hypothesis 1 of Theorem 1.2 establishes that k a ≥ n+1 2 . Therefore v is contained in an H-cycle of length 3 in G.  Observation 4.3.The hypothesis 2 of Theorem 1.2 cannot be dropped as the H-colored complete graph in the Figure 2 shows.Notice that for every a in V (G), G a is a complete 4-partite graph, that is, the hypothesis 1 of Theorem 1.2 is fulfilled; and the vertex r in V (G) is not contained in an H-cycle of length 3, since each one of the 15 cycles of length 3 containing r has the indicated obstruction: (r, x, w, r), obstruction in vertex w; (r, x, v, r), obstruction in vertex x; (r, x, u, r), obstruction in vertex x; (r, x, t, r), obstruction in vertex t; (r, x, s, r), obstruction in vertex s; (r, w, v, r), obstruction in vertex w; (r, w, u, r), obstruction in vertex u; (r, w, t, r), obstruction in vertex t; (r, w, s, r), obstruction in vertex s; (r, w, u, r), obstruction in vertex u; (r, v, u, r), obstruction in vertex u; (r, v, t, r), obstruction in vertex v; (r, v, s, r), obstruction in vertex v; (r, u, t, r) obstruction in vertex r; (r, u, s, r) obstruction in vertex r; (r, t, s, r), obstruction in vertex r.However, the hypothesis 2 of Theorem 1.2 is not satisfied because (r, s, x, t, r) is a cycle of length 4 in G, with exactly 3 obstructions (namely r, s and t).

Proof of Theorem 1.3
If n = 4, then for every x in V (G) we have that k x ≥ 5  2 , and k x ≤ δ(x) = 3, so k x = 3.And hence, for every two edges a and b incident with x, we have that a and b are in different parts of the k x -partition of V (G x ).
If n = 5, then for every x in V (G) we have that k x ≥ 3, and k x ≤ δ(x) = 4, so k x = 3 or k x = 4.Then, for every vertex x in V (G), at most 2 edges incident with x are in the same part of the k x -partition of V (G x ).As a consequence, for each vertex x in V (G), we know that there are at most two cycles of length 4 in G passing through x that are not H-cycles.And we are done.
The case n = 6, can be easily carried as a consequence of the case n = 5, because for each x in V (G), G − x satisfies the hypotheses of Theorem 1.3.
If n = 7, then for every x in V (G), we have that k x ≥ 4. Proceeding by contradiction, suppose there exists a vertex v in V (G) such that v is not contained in an H-cycle of length 4 in G.It follows by Theorem 1.2 that there exists an H-cycle of length 3 containing v, say (v, x, y, v).Thus, by Observation 1.1, we have that yv and xy are in different parts of the k v -partition of V (G v ), vx and yx are in different parts of the k x -partition of V (G x ), and vy and xy are in different parts of the k y -partition of V (G y ).Without loss of generality, suppose that xv ∈ P , which is impossible.We conclude that vw ∈ P w 1 .Therefore {vw, xw, yw} ⊆ P w 1 , and moreover, as G w is a complete k w -partite graph, with k w ≥ 4, it follows that for each t in V (G) − {v, w, x, y}, tw / ∈ P w 1 .
To conclude the proof when n = 7, we consider the two following cases.Both cases lead us to a contradiction.
Case 1. wv / ∈ P v 1 ∪ P v 2 .Without loss of generality, suppose that wv ∈ P v 3 .Given that G v is a complete k v -partite graph, with k v ≥ 4, consider u in V (G) − {v, w, x, y} such that vu ∈ P v 4 ; and since u ∈ V (G) − {v, x, y, w}, it follows by Claim 1 that uw / ∈ P w 1 .Suppose that wu ∈ P u 1 .Claim 2. {vu, wu, xu, yu} ⊆ P u 1 .
Proof.As wu ∈ P u 1 , there remains to prove that {vu, xu, yu} ⊆ P u 1 .First we prove that vu ∈ P u 1 .Proceeding by contradiction, suppose that vu / and wx ∈ P x 3 ∩ P w 1 ), which is impossible by our assumption.Therefore vu ∈ P u 1 .
Next, we prove that xu ∈ P u 1 .Proceeding by contradiction, suppose that xu / When ux / ∈ P x 2 , the previous argument implies that (v, y, x, u, v) is an H-cycle of length 4 in G containing v (since vy ∈ P v 2 ∩ P y 1 , yx ∈ P y 2 ∩ P x 2 , xu / ∈ P x 2 ∪ P u 1 and uv ∈ P u 1 ∩ P v 4 ), a contradiction.We conclude that xu ∈ P u 1 .
Now, we prove that yu ∈ P u 1 .Proceeding by contradiction, suppose that yu / ∈ P u 1 .When uy ∈ P y 2 , Observation 1.2, wv ∈ P w When uy / ∈ P y 2 , it follows from the previous observation that (v, x, y, u, v) is an This concludes the proof of Claim 2. Hence, {vu, wu, xu, yu} ⊆ P u 1 .
Finally, as {vu, wu, xu, yu} is a subset of P u 1 and δ G (u) = 6, we have that k u ≤ 3, which is impossible since by hypothesis k u ≥ 4.

Case 2. wv
By symmetry, suppose without loss of generality that wv ∈ P v 1 , and since G v is a complete k v -partite graph, with k v ≥ 4, we can consider a subset {u, s} of V (G) − {v, w, x, y} such that vu ∈ P v 3 and vs ∈ P v 4 .Given that {u, s} is a subset of V (G) − {v, x, y, w}, it follows from Claim 1 that uw / ∈ P w 1 and sw / ∈ P w 1 .Suppose without loss of generality that wu ∈ P u 1 and ws ∈ P s 1 .Claim 3. {vu, wu, yu} ⊆ P u 1 .
Proof.Since wu ∈ P u 1 , it suffices to prove that {vu, yu} ⊆ P u 1 .First, we prove that vu ∈ P u 1 .Proceeding by contradiction, suppose that vu / ∈ P u 1 , thus by Observation 1.2 and given that yv ∈ P v 2 ∩ P y 1 , vu ∈ P v 3 − P u 1 , uw ∈ P u 1 − P w 1 y wy ∈ P w 1 ∩ P y 3 , we have that (y, v, u, w, y) is an H-cycle of length 4 in G containing v, which is impossible.Therefore vu ∈ P u 1 .
Now, we prove that yu ∈ P u 1 .Proceeding by contradiction, suppose that yu / ∈ P u 1 .When uy ∈ P y 2 , Observation 1.2, vy ∈ P v 2 ∩ P y 1 , yu ∈ P y 2 − P u 1 , uw ∈ P u 1 − P w 1 and wv ∈ P v 1 ∩ P w 1 imply that (v, y, u, w, v) is an H-cycle of length 4 in G containing v, a contradiction.
When uy / ∈ P y 2 , we have from the previous observation that (v, u, y, x, v) is an Proceeding in a very similar way to the proof of Claim 3 (taking s instead of u), we can prove that: The case n = 8, can be easily carried as a consequence of the case n = 7, since for each x in V (G), G − x satisfies the hypotheses of Theorem 1.3.This concludes the proof of Theorem 1.3.

Proof of Theorem 1.4
Let G and H be graphs as in the hypotheses, thus for every x en V (G), k x ≥ 5. Proceeding by contradiction, suppose that there exists a vertex v in V (G) such that v is not contained in an H-cycle of length 4. It follows by Theorem 1.2 that there exists an H-cycle of length 3 containing v, say T = (u, v, w, u).By Observation 1.1, we have that uv and vw are in different parts of the k v -partition of V (G v ), vw and wu are in different parts of the k w -partition of V (G w ), and wu and uv are in different part of the k u -partition of V (G u ).Without loss of generality, suppose that uv ∈ P v 1 and vw ∈ P v 2 , vw ∈ P w 2 and wu ∈ P w 1 , and wu ∈ P u 2 and uv ∈ P u 1 .
The proof of Theorem 1.4 is divided into two cases, depending on whether there exists a vertex x fulfilling certain properties or not.In each case, a series of claims is proven, which will lead us to a contradiction.Case 1.There exists a vertex x in V (G) − {u, v, w} such that • ux and wx are in the same part of the k x -partition of V (G x ), • vx and ux are in different part of the k x -partition of V (G x ), Suppose without loss of generality that {ux, wx} ⊆ P  w, u, v, y, w) is an H-cycle of length 4 in G containing v, which is impossible.We conclude that vy ∈ P y 1 .
Again, proceeding by contradiction, we will prove that vy / ∈ P v 2 .It follows from Observation 1.1 that v is an obstruction of the cycle C = (y, v, w, y), since vw ∈ P v 2 .By the same observation, we have that y is an obstruction of the cycle C (as {vy, wy} ⊆ P y 1 ), and w is not an obstruction of the cycle C (recall that vw ∈ P w 2 and yw / ∈ P w 2 ).Thus, the cycle C has exactly 2 obstructions (namely v and y), with (C) = 3, which is impossible because of the hypothesis 3 of Theorem 1.4.Therefore vy / ∈ P v 2 .
Proceeding by contradiction, we will prove that xy ∈ P Proceeding by contradiction, we will prove that xy / ∈ P x 1 .By Observation 1.1, we have the following assertions: x is an obstruction of the cycle C = (y, x, w, y) (because wx ∈ P x 1 ), y is an obstruction of the cycle C (as {xy, wy} ⊆ P y 1 ), and w is not an obstruction of the cycle C (recall that xw ∈ P w 1 and yw / ∈ P w 1 ).Hence, the cycle C has exactly two obstructions (namely x and y), with (C ) = 3, contradicting the hypothesis 3 of Theorem 1.4.Therefore xy / ∈ P x 1 .
Proceeding by contradiction, we will see that uy ∈ P y 1 .Observe that, under our assumption, uy ∈ P Finally, proceeding by contradiction we will show that uy / ∈ P u 2 .Thus by Observation 1.1, we have the following three assertions: u is an obstruction of the cycle C = (y, u, w, y) (because uw ∈ P u 2 ), y is an obstruction of the cycle C (as {uy, wy} ⊆ P y 1 ), and w is not an obstruction of the cycle C (recall that uw ∈ P w 1 and yw / ∈ P w 1 ).Hence, the cycle C has exactly two obstructions (namely u and y), with (C) = 3, which is impossible because of the hypothesis 3 of Theorem 1.4.Therefore uy / ∈ P u 2 .
This concludes the proof of Claim 1.
Proof.Let y 1 be in Z, and w.l.o.g.assume that uy 1 ∈ P w i for some fixed i, i > 2. We will prove that Z ⊆ N w i .Let y 2 be in Z \ {y 1 }.Given that {y 1 , y 2 } is a subset of Z, we have that y By Claim 1, wy j and uy j are in the same part of the k yj -partition of V (G yj ), for j in {1, 2}, so by Observation 1.1, y j is an obstruction of the path (w, y j , u).Also, as {y 1 , y 2 } is a subset of Z, we have that {uy 1 , uy 2 } ⊆ P u 1 , which implies by the previous observation that u is an obstruction of the path (y 1 , u, y 2 ).Thus u, y 1 and y 2 are obstructions of the cycle C = (w, y 1 , u, y 2 , w).If w is not an obstruction of the cycle C, then the cycle C has exactly 3 obstructions (namely u, y 1 y y 2 ), with (C) = 4, contradicting the hypothesis 2 of Theorem 1.4, so w is an obstruction of the cycle C.Hence, by Observation 1.1, wy 1 and wy 2 are in the same part of the k w -partition of V (G w ), and given that wy 1 is in P w i , it follows that wy 2 ∈ P w i , which implies that y 2 ∈ N w i .Therefore Z ⊆ N w i for some i in {3, • • • , k w }.
Suppose without loss of generality that Z ⊆ N w 3 , and let A = kw i=4 N w i be and S = V (G) − (A ∪ {u, v, w, x}).Notice that |A| = 0, since k w ≥ 5; moreover |A| ≥ 2.
Claim 3. A has the H-dependency property with respect to the vertex v.
Proof.Let {a, a } be a subset of A. As {a, a } is a subset of A, it follows that a / ∈ N w 1 ∪ N w 2 and a / ∈ N w 1 ∪ N w 2 , that is, aw / ∈ P w 1 ∪ P w 2 and a w / ∈ P w 1 ∪ P w 2 .Now, by Claim 1, wa and va are in the same part of the k a -partition of V (G a ), and wa and va are in the same part of the k a -partition of V (G a ).Say that {va, wa} ⊆ P a 1 and {va , wa } ⊆ P a 1 .Proceeding by contradiction, suppose that A has not the H-dependency property with respect to the vertex v, that is, a is not an obstruction of the path (v, a, a ) and a is not an obstruction of the path (v, a , a).This implies, by Observation 1.1, that va and aa are in different parts of the k a -partition of V (G a ), and va and aa are in different part of the k a -partition of V (G a ).Since va is in P a 1 and va is in P a 1 , we have that aa / ∈ P a 1 ∪ P a 1 ; moreover, as wa is not in P w 1 ∪ P w 2 , it follows by Claim 1 that va / ∈ P v 2 .Hence, by Observation 1.2 and given that wa ∈ P a 1 − P w 2 , aa / ∈ P a 1 ∪ P a 1 , a v ∈ P a 1 − P v 2 and vw ∈ P v 2 ∩ P w 2 , it follows that (w, a, a , v, w) is an H-cycle of length 4 in G containing v, which is impossible by our assumption.Therefore A has the H-dependency property with respect to the vertex v.
Given that A has the H-dependency property with respect to the vertex v, we have by Proposition 3.1 that there exists a vertex a in A such that l D a ≤ t+1 2 , where D = G[A] and t = |A|, and a is an obstruction of the path (v, a, a ) for some a in N D (a) (recall that |A| ≥ 2).Since a is in A, it follows that a / ∈ N w 1 ∪ N w 2 , that is, wa / ∈ P w 1 ∪ P w 2 , which implies by Claim 1 that ua, va, wa and xa are in the same part of the k a -partition of V (G a ), and va / ∈ P v 2 .Suppose that va ∈ P a 1 , so {ua, va, wa, xa} ⊆ P a 1 , moreover, as a is an obstruction of the path (v, a, a ), it follows by Observation 1.1 that aa ∈ P that ua / ∈ P u 1 , and given that vu is in P u 1 , we have by the Observation 1.1 that u is not an obstruction of the path (v, u, a).Thus z, v, u and a are not obstructions of the cycle C = (z, v, u, a, z), and by Observation 1.2, C is an H-cycle of length 4 in G containing v, which is impossible.
If vz / ∈ P v 2 , then by Observation 1.2 we have that (w, v, z, a, w) is an H-cycle of length 4 in G containing v (since wv ∈ P v 2 ∩ P w 2 , vz ∈ P z 1 − P v 2 , za / ∈ P z 1 ∪ P a 1 and aw ∈ P a 1 − P w 2 ), a contradiction.We conclude that az ∈ P z 1 ∪ P a 1 .
Since y ∈ S 2 , with wy ∈ P y 1 , we have by Claim 4.3 that ay ∈ P y 1 ∪ P a 1 .If ay ∈ P a 1 , then when we consider this edge, we add no extra part in the k a -partition of V (G a ) with respect to the number of parts of the l D a -partition of V (D a ), as a a ∈ P a 1 , with a ∈ N D (a).Hence, we can assume that ay / ∈ P a 1 , which implies that ay ∈ P y 1 and ay ∈ P a α for some α = 1 (moreover, we can assume that α > l D a , otherwise, the edge ay is already counted in the first l D a parts of the partition of V(G a )).Proceeding in a very similar way to the proof of Claim 4.2 (taking S 2 instead of S 1 and P w 2 instead of P w 1 ) we can prove that: Claim 4.4.For every y in S 2 , ay ∈ P a 1 or ay ∈ P a α .
Since for every y in S 2 , ay ∈ P a 1 or ay ∈ P a α , with α in {l D a + 1, • • • , k a }, we have that, when we consider the edges y a with y in S 2 , we add at most one part in P with respect to the number of parts in Q, namely P a α .Case 4.3.y ∈ S 3 .Thus wy ∈ P w 3 , in particular wy / ∈ P w 2 .To prove the Case 4.1 of Claim 4, we only need that wy / ∈ P w 2 as an extra information.Hence, the proof of this Case 4.3 is exactly the same to the proof of the Case 4.1.Therefore, when we consider the edges ya, with y ∈ S 3 , we add at most one part in P with respect to the number of parts in Q.
This concludes the proof of Claim 4. Now we finish the proof of the Case 1 of Theorem 1.4.By Claim 4, we have that l D a + s ≥ k a , and since k a ≥ n+1 2 (by hypothesis) and t+1 2 ≥ l D a , it follows that Simplifying this inequality we obtain that t + 2s ≥ n, and since n ≥ s + t + 4, we have that t + 2s ≥ s + t + 4, that is, s ≥ 4, which is impossible because s = min{|S|, 3} ≤ 3.

This concludes the Case 1.
Case 2. There exists no vertex x in V (G) − {u, v, w} with the following properties • xu ∈ P u 2 , xw ∈ P w 1 , • ux and wx are in the same part of the k x -partition of V (G x ), • vx and ux are in different part of the k x -partition of V (G x ), Claim 5.For every x in V (G) − {u, v, w}, if vx / ∈ P v 1 ∪ P v 2 , then 1. ux, vx y wx are in the same part of the k x -partition of V (G x ), 2. wx / ∈ P w 2 and ux / ∈ P u 1 .
Proof.Let x be a vertex in V (G) − {u, v, w} such that vx / ∈ P v 1 ∪ P v 2 .Suppose without loss of generality that vx ∈ P x 1 ∩ P v 3 , thus the item (1) can be rewritten as follows: {ux, vx, wx} ⊆ P x 1 .
To prove Claim 5, first we establish the two following claims.

Notation 3 . 1 .
If D is an induced subgraph of G without isolated vertices, then for every x in V (D) we write l D x instead of l x , where l x is the one referred in Observation 3.1.
such that A has the H-dependency property with respect to the vertex v and |A | ≤ m−1, then there exists a vertex a in A such that l D a ≤ |A |+1 2 , where D = G[A ], and moreover, if |A | ≥ 2, then a is an obstruction of the walk (v, a , b) for some b in N D (a ).Now take a set A having the H-dependency property with respect to the vertex v and |A| = m, with m > 2. By the proof of the part (1), we have that there exists a vertex a in A such that l D a ≤ |A|+1 2 , where D = G[A].
it follows directly from Observation 4.1(2) the following claim.

Claim 2 . 2 = r+1 2 ,
V (D) has the H-dependency property with respect to the vertex v. Now the H-dependency property of V (D) (with respect to the vertex v) and Proposition 3.1, imply that there exists a vertex a in V (D) such that l D a ≤ |V (D)|+1 and moreover, since r ≥ 2, it follows that a is an obstruction of the walk (v, a, a ) for some a in N D (a).By construction, we know that N v i = {a} for some i in {1, 2, • • • , r}.Claim 3. k a ≤ l D a + s (see Notation 3.1).

Observation 4 . 2 .
H-colored complete graphs, showing that the hypotheses of Theorem 1.2 are tight.The hypothesis 1 of Theorem 1.2 cannot be dropped.Notice that in the H-colored complete graph G of the Figure 1, we have that for every x in V (G), G x is a complete 2-partite graph, where 2 < |V (G)|+1 2 , thus the hypothesis 1 of Theorem 1.2 is not fulfilled.Also, the cycle (a, b, c, d, a) has no obstructions, the cycle (a, b, d, c, a) has 2 obstructions (namely a and c), and the cycle (a, d, b, c, a) has 2 obstructions (namely b and d), therefore the hypothesis 2 of Theorem 1.2 is satisfied.Nevertheless, the vertex a in V (G) is not in an H-cycle of length 3 in G, since a is an obstruction of the cycle (a, b, c, a), c is an obstruction of the cycle (a, c, d, a), and d is an obstruction of the cycle (a, b, d, a).

Figure 1 :
Figure 1: The hypothesis 1 of Theorem 1.2 cannot be dropped.
, Szachniuk et al. introduced what they called the Orderly Colored Longest Path problem (OCLE), that is: if G is an edge-colored graph with colors in C, P {vs, ws, ys} ⊆ P s 1 .G (u) = 6, so k u ≤ 3, which is impossible.When us ∈ P s 1 , Claim 4 implies that {vs, ws, xs, us} ⊆ P s 1 .Since δ G (s) = 6, it follows that k s ≤ 3, a contradiction.Therefore every vertex in G is contained in an H-cycle of length 4, whenever |V (G)| = 7.
By Claim 5, we have that us ∈ P u 1 or us ∈ P s 1 .When us ∈ P u 1 , we have by Claim 3 that {vu, wu, xu, su} ⊆ P u 1 .Moreover, δ x 1 , vx ∈ P x 2 and xv ∈ P v 3 .
, we have that (w, v, x, y, w) is an H-cycle of length 4 in G containing v, which is impossible.Hence, by Observation 1.2, (x, y, v, w, x) is an H-cycle of length 4 in G containing v (as xy ∈ P x 2 −P y 1 , yv ∈ P y 1 −P v 2 , vw ∈ P v 2 ∩P w 2 and wx ∈ P w 1 ∩P x 1 ), a contradiction.Therefore xy ∈ P y 1 .
u 1 .Otherwise, if uy / ∈ P u 1 , then by Observation 1.2, we have that (w, v, u, y, w) is an H-cycle of length 4 in G containing v (recall that wv ∈ P v 2 ∩ P w 2 , vu ∈ P v