An Erdős-Gallai type theorem for vertex colored graphs

While investigating odd-cycle free hypergraphs, Győri and Lemons introduced a colored version of the classical theorem of Erdős and Gallai on Pk\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$P_k$$\end{document}-free graphs. They proved that any graph G with a proper vertex coloring and no path of length 2k+1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$2k+1$$\end{document} with end vertices of different colors has at most 2kn edges. We show that Erdős and Gallai’s original sharp upper bound of kn holds for their problem as well. We also introduce a version of this problem for trees and present a generalization of the Erdős-Sós conjecture.


Main results
We denote by P the path of length (that is, containing edges). For a graph G, we denote by E(G) and V (G) the edge and vertex set of G, respectively. We begin by recalling the theorems of Erdős and Gallai about graphs without long paths and cycles. [3]) Let G be an n-vertex graph with no P , then

and equality holds if and only if divides n and G is the disjoint union of n cliques of size .
Theorem 2 (Erdős-Gallai [3]) Let G be an n-vertex graph with no C m for all m ≥ , then and equality holds if and only if − 2 divides n − 1 and G is a connected graph such that every block of G is a clique of size − 1.
In fact, Theorem 1 was deduced as a simple corollary of Theorem 2. In a more recent paper, Győri and Lemons [5] investigated the extremal number of hypergraphs avoiding so-called Berge-cycles. To this end, they introduced a generalization of the theorem of Erdős and Gallai about paths. By a proper vertex coloring of a graph G, we mean a coloring of the vertices of G such that no two adjacent vertices are the same color. Győri and Lemons proved the following. [5]) Let k be a positive integer and G be an n-vertex graph with a proper vertex coloring such that G contains no P 2k+1 with end vertices of different colors, then

Theorem 3 (Győri-Lemons
We show that the factor of 2 in Theorem 3 is not needed and, thus, recover the original upper bound from the Erdős-Gallai theorem. We also determine which graphs achieve this upper bound.
Theorem 4 Let k ≥ 0 and G be an n-vertex graph with a proper vertex coloring such that G contains no P 2k+1 with end vertices of different colors, then and equality holds if and only if 2k + 1 divides n and G is the union of n 2k+1 disjoint cliques of size 2k + 1.

Proof of Theorem 4
By induction on the number of vertices, we may assume that G is connected and has minimum degree If G is C -free for all ≥ 2k + 1, then by Theorem 2 we have Thus, assume there is a cycle of length at least 2k + 1, and let C be the smallest such cycle with length . Let the vertices of C be v 0 , v 1 , v 2 , . . . , v −1 , v 0 , consecutively.
Addition and subtraction in subscripts will always be taken modulo . We say that an edge e is outgoing if it has one vertex in V (C) and the other in V (G)\V (C). We say a vertex v ∈ V (C) is outgoing if it is contained in an outgoing edge. We will consider cases based on the value of . Observe that = 2k+2 is impossible since v 0 , v 1 , . . . , v 2k+1 is a path of length 2k + 1 but v 0 and v 2k+1 are adjacent, contradiction. Case 1 Suppose ≥ 2k + 4. Since we have chosen to be the length of the smallest C with ≥ 2k + 1, we have v 0 cannot be adjacent to any of v 2 , v 3 , . . . , v −2k nor any of v 2k , v 2k+1 , . . . , v −2 , for otherwise we would have a shorter cycle of length at least 2k + 1. Also note that v 0 is adjacent to v 1 and v −1 .
Observe that v 0 cannot have two consecutive neighbors in the -cycle. Indeed, if v i and v i+1 are neighbors of v 0 , then we have the following (2k + 1)-paths starting at and v 2k+2 would have to be colored the same, but this is impossible since they are neighbors.
If v 0 has a neighbor outside of C, say u 0 , then we have two paths of length 2k + 1: It follows that u 0 and v −1 have the same color. Similarly, u 0 and v 1 have the same color. Thus, v −1 and v 1 also have the same color, and similarly, for every i such that v i is outgoing, we can conclude v i−1 and v i+1 have the same color (Fig. 1).
If = 2k + 4 and there is an outgoing vertex, say v 0 , then v 1 and v 2k+3 have the same color (from the previous paragraph), a contradiction since v 1 and v 2k+2 also have the same color (they are end vertices of a length 2k +1 path along the cycle C). If there is no outgoing vertex in V (C), then C uses all vertices of the graph. Since no vertex of the cycle has two consecutive neighbors, it follows that each degree is bounded by 2 + 2k−5 2 ≤ k and so the number of edges is at most (2k+4)k 2 = nk 2 < nk. If ≥ 2k + 5, we will show that v 0 has an outgoing edge from the -cycle C.
Suppose not, then since v 0 does not have consecutive neighbors, it follows that v 0 has at most neighbors, a contradiction. Thus, v 0 and similarly every other v i has an outgoing neighbor, and it follows that for every i, the vertices v i and v i+2 have the same color.
Hence v 0 and v 2k have the same color, contradicting that v 0 and v 2k+1 have the same color, since they are end vertices of a P 2k+1 .
is a path of length = 2k + 1, and so v i and v i+2 have the same color. Thus, v 0 and v 2k+2 have the same color, but they are adjacent, contradiction. Case 3 Finally, suppose = 2k + 1. If no edge is outgoing, then we are done, since by connectivity the total number of edges in the graph is at most 2k+1 2 = kn. If indeed the total number of edges is kn, then G is a clique. This is the only case when equality holds. From here on, we will assume there is an outgoing edge.
Observe that if u is not a vertex of C, then u cannot have two consecutive neighbors in C, for otherwise we would have a cycle of length 2k + 2. Moreover, u cannot be Fig. 1 The picture on the left shows Case 1, and the other pictures show Case 3 connected to v i and v i+3 , since there would be paths of length 2k + 1 from u to v i+1 and v i+2 . It follows that u can have at most k − 1 neighbors in C and, thus, must have a neighbor outside C.
If there are two consecutive non-outgoing vertices in C, then we may take two such vertices v i and v i+1 , for some index i, so that the next vertex v i+2 is outgoing. Suppose {v i+2 , u} is an outgoing edge. By the previous observation, there is an edge {u, w} where w / ∈ C. So we have a 2k + 1 length path from v i to w. Then v i+1 cannot have two consecutive neighbors from C, since that would also imply that there is also 2k +1 length path from w to v i−1 . Similarly v i cannot have two consecutive neighbors in C, hence v i and v i+1 have degree at most k. By removing these two vertices, we remove 2k − 1 edges, and by the induction hypothesis the resulting graph has at most k(n − 2) edges. So e(G) < kn.
For every i, either v i+1 or v i+2 is an outgoing vertex. Hence the vertex v i has either the same color as v i+2 , if v i+1 is an outgoing vertex, or the same color as v i+4 , if v i+2 is an outgoing vertex. Hence by repeatedly applying this argument we obtain that v 0 has the same color as v 2k or v 1 , contradiction.
We believe that an analogue of Theorem 3 should hold in the setting of trees. Recall that the extremal number ex(n, H ) of a graph H is defined to be the largest number of edges an n-vertex graph may have if it does not contain H as a subgraph. Erdős and Sós made the following famous conjecture about the extremal number of trees. [2]) Let T be a tree with k ≥ 1 edges, then ex(n, T ) ≤ (k−1)n 2 .

Conjecture 1 (Erdős-Sós
A proof of Conjecture 1 for sufficiently large trees has been announced by Ajtai, Komlós, Simonovits and Szemerédi [1]. We introduce a new variation of the extremal function ex(n, T ) in the case of trees. Let ex c (n, T ) denote the maximum number of edges possible in an n-vertex graph G with a proper vertex coloring (using any number of colors), such that in every copy of T in G the leaves of T are all the same color.

Theorem 5 Let T be a tree with k edges such that in the (unique) proper vertex 2-
coloring of T all leaves are not the same color, then ex c (n, T ) ≤ (k − 1)n.
Proof There is a path of odd length in T with end vertices which are leaves. Let G be an n-vertex graph with more than (k − 1)n edges with a proper vertex coloring. We may find a subgraph G of G with average degree at least that of G and minimum degree greater than k − 1. The proper coloring of G induces a proper coloring of G and so applying Theorem 3 for any odd ≤ k, we may find a copy of P in G with end vertices of distinct colors. We may now build up the rest of the tree in a greedy fashion as every degree in G is at least k and T has k + 1 vertices. Thus, we have found a copy of T in the graph G with leaves of at least two colors.

Theorem 6
Let T be a tree with k edges such that in the proper vertex 2-coloring of T all leaves are the same color, then ex c (n, T ) = n 2 4 , provided n is sufficiently large.

Proof
The fact that all leaves are colored the same by a 2-coloring implies that all paths between pairs of leaves have even length. We add an edge e to T connecting an arbitrary pair of leaves, and let G be the resulting graph. Since G has an odd cycle, its chromatic number is clearly 3, and the deletion of e yields a 2-chromatic graph. It follows from a theorem of Simonovits [7] that if n is sufficiently large, the extremal number of G is precisely ex(n, G) = n 2 4 . Thus, in any n-vertex graph with more than n 2 4 edges we have a copy T with two adjacent leaves, and so in any proper coloring of this graph we have a copy of T with leaves of at least 2 colors. It follows that ex c (n, T ) ≤ n 2 4 , and this bound is realized by the complete bipartite graph K n 2 , n 2 .

Remark 1
The paths of even length P 2k are a special case of Theorem 6. Here better bounds on n are known to exist. For example, the result of Füredi [4] on the extremal number of odd cycles implies that n ≥ 4k is sufficient.
We believe that a strengthening of Conjecture 1 should hold for trees whose 2coloring yields two leaves of different colors.

Conjecture 2
Let T be a tree with k ≥ 1 edges such that in the proper vertex 2-coloring of T all leaves are not the same color, then ex c (n, T ) ≤ (k−1)n 2 .
One would hope that Conjecture 2 could be deduced directly from Conjecture 1, but unfortunately this does not seem to be the case. We take a first step towards Conjecture 2 by proving it in the case of double stars.  Fig. 2, left). We have ex c (n, S a,b ) ≤ a+b 2 n.
Proof Let G be a vertex colored graph with |E(G)| > |V (G)| a+b 2 . Without loss of generality, suppose a ≤ b. We may assume by induction that δ(G) > a+b 2 ≥ a. Since ex(m, S a,b ) = m a+b 2 (see, for example [6]), it follows that G contains a copy of S a,b . Suppose this copy is defined by the edge {u, v} together with the disjoint sets A ⊆ N (u), B ⊆ N (v) with |A| = a, |B| = b. Now, if there is more than one color in A ∪ B, then we are done. So suppose the color of all vertices in A ∪ B is the same. Hence A ∪ B is an independent set.
If u is not adjacent to some w ∈ B (see Fig. 2, middle), since |N (w)| ≥ a + 1, we can pick C ⊆ N (w)\{u, v} of size a. So the edge {v, w} together with the sets B = (B ∪ {u})\{w} and C define an S a,b where the colors of all vertices in C are different from the colors of B \{u}.
If u is adjacent to all w ∈ B, then fix x ∈ B (see Fig. 2, right). Since |N (x)| ≥ a +1, we can pick C ⊆ N (x)\{u} of size a. Let y ∈ A and define B = (B ∪ {y})\{x}. Observe that B ⊆ N (u), and the edge {u, x} together with the sets B and C defines an S a,b , where again the color of the vertices in C is different from the color of vertices in B .