Coloring subgraphs with restricted amounts of hues

Abstract We consider vertex colorings where the number of colors given to specified subgraphs is restricted. In particular, given some fixed graph F and some fixed set A of positive integers, we consider (not necessarily proper) colorings of the vertices of a graph G such that, for every copy of F in G, the number of colors it receives is in A. This generalizes proper colorings, defective coloring, and no-rainbow coloring, inter alia. In this paper we focus on the case that A is a singleton set. In particular, we investigate the colorings where the graph F is a star or is 1-regular.


Introduction
Consider a (not necessarily proper) coloring of the vertices of a graph G. For a set S of vertices, denote by c.S / the number of colors used on the set S . Let F be some fixed graph and let A be some fixed subset of the positive integers (the allowed numbers). We consider colorings of G where for every copy of F in G the number c.V .F // is in the set A. (Note that F is not required to be an induced subgraph.) We call this a coloring with a Restricted Amount of Subgraph Hues, or RASH for short. Below we will simply refer to it as a valid coloring.
This idea has been studied in other contexts. Most obviously, proper colorings are the case that F D K 2 and A D f2g. Thereafter, probably most studied is the case of coloring the vertices without creating some monochromatic subgraph, such as a star; these are often called defective colorings (see for example [1][2][3][4]). Defective colorings correspond to RASH colorings where A D f2; 3; : : : ; jF jg (where we use jF j to denote the order of F ). More recently, at least in the setting of graphs, there is work on no-rainbow colorings [5][6][7], which correspond to RASH colorings where A D f1; 2; : : : ; jF j 1g, and on Worm colorings [8], which correspond to RASH colorings where A D f2; 3; : : : ; jF j 1g. These three types of colorings were already considered and generalized for hypergraphs; see [9,10].
In this paper we will focus on the case that A is a singleton set fag. That is, we consider colorings where every copy of F receives precisely a colors. And especially, we investigate the case that the subgraph F is a star or is 1-regular. We will assume throughout that the graphs are simple and have no isolates.
H isomorphic to F , then we let W C .G; F; A/ denote the maximum number of colors in such a coloring and let W .G; F; A/ denote the minimum number of colors in such a coloring. (In hypergraphs these are the upper and lower chromatic numbers, respectively.) Note that if G has a valid coloring then so does any subgraph; thus these parameters are monotonic. Now, if A contains the integer 1, then the existence is guaranteed and the minimum number of colors in a valid coloring is 1. Similarly, if A contains the integer jF j, then the existence is guaranteed and the maximum number of colors is jGj. In particular, if A contains both 1 and jF j, all three questions are trivial.
This yields two special cases of RASH colorings. Consider the case that A D f1g. Define an auxiliary graph H F .G/ with the same vertex set as G but with two vertices adjacent if and only if they lie in a common copy of F . For example, H P 3 .G/ is the square of G, provided G has no component of order 2. Then in a valid coloring of G, two vertices of G must have the same color if and only if they are in the same component of the auxiliary graph H F .G/. It follows that Consider the case that A D fjF jg. Then, in a valid coloring of G, two vertices of G must have different colors if they are adjacent in the auxiliary graph H F .G/; if they are not adjacent in H F .G/ then they can have the same color or different. It follows that W .G; F ; fjF jg/ is the chromatic number of H F .G/.
The following result is straight-forward. It shows that if F is connected, then we may restrict our discussion to connected graphs G. (However, if F is not connected, then the situation is more complex.) Observation 2.1. Assume F is connected but G is not. Then the existence of a valid coloring of G is equivalent to the existence of such a coloring in all its components G i . Further, the value W .G; F; A/ is the maximum of the values W .G i ; F; A/ over all components G i ; and the value W C .G; F; A/ is the sum of the values W C .G i ; F; A/ over all components G i .
It is not surprising that these parameters are often NP-hard to calculate. For example, W .G; K 2 ; f2g/ is just the ordinary chromatic number of G, while several hardness results for WORM and no-rainbow colorings were shown in [5][6][7][8]11].

Stars
In this section we focus on the case that F is a star. We begin by observing that all the possibilities for F D K 1;2 are trivial or have already been studied. Then we provide a few general results, after which we focus on F D K 1;3 and F D K 1;4 .

The star with two leaves
For P 3 , the star with two leaves, almost all the cases are covered by the above discussion or have been previously studied. The ones where the allowed set A does not contain both 1 and 3 are: Here the minimum number of colors is 1. The maximum number is 2 for K 2 , and 1 in all other connected graphs. A D f2g. This is the WORM coloring number (see for example [8]).
A D f3g. The maximum number of colors is jGj. The minimum number of colors is 1 for K 2 , but for other connected graphs it is the chromatic number of the square of G. A D f1; 2g. This is the no-Rainbow coloring (see for example [7]).
A D f2; 3g. This is equivalent to 1-defective coloring: every vertex has at most one neighbor of its color (see for example [1,3]).
The situation for other subgraphs F with 3 vertices is similar. For example, the auxiliary graph H K 3 .G/ is G minus all edges not in a triangle.
We will look at other small stars shortly, but first some general results.

Arbitrary stars
In [8] it was shown that, if a graph has a coloring where every P 3 receives two colors, then there is such a coloring that uses only two colors. That is, if it exists, W .G; P 3 ; f2g/ Ä 2. Now, this result does not generalize to most other F , such as K 3 (see [11]). But we show next that it does generalize somewhat to other stars.
Theorem 3.1. If graph G has minimum degree at least f and has a coloring where every copy of K 1;f receives 2 colors, then G has such a coloring using only two colors.
Proof. Consider a valid coloring of G. Let E M be the set of edges that are monochromatic; that is, those edges whose two ends have the same color. Note that E M does not contain a copy of K 1;f . Let H be the graph G E M . Since H has no monochromatic edge, it is properly colored. Consider two vertices u and v in H with a common neighbor w. Then since H is properly colored, neither u nor v has the same color as w. Since w has degree at least f in G, it follows that u and v have the same color. It follows that every cycle C in H has even length, since it is properly colored and every pair of vertices two apart in C have the same color. This means that H is bipartite.
It follows that we can (re)color V .H / D V .G/ so that H is properly colored and use only two colors. Now consider this 2-coloring in G. Since the new coloring is a proper coloring in H , every edge that is monochromatic in this new coloring must be in E M . But that means there is no monochromatic copy of K 1;f . That is, every copy of K 1;f receives exactly two colors.
It is unclear what happens if one drops the condition that G have minimum degree at least f .
For another general result, we consider bounds on the maximum degree of graphs that have a valid coloring. This is equivalent to asking which stars have such colorings. and this is realizable for all a and f .
Proof. Since a < f C 1, a vertex v can have at most a 1 new colors among its neighbors. Say v has c neighbors of its own color. Then, the sum of the counts of the most numerous a 2 other colors can be at most f 1 c. Thus, the total number of neighbors is at most f 1 C .f 1 c/=.a 2/. This quantity is maximized at c D 0, where it has the above value. And it is achievable by using a 1 colors on the neighbors divided as equally as possible among them.
More generally one can say the following: For the star F D K 1;f , if the allowed set A contains none of 1, 2 and f C 1, then the maximum degree in graphs G that have valid colorings is bounded.
Proof. For a crude upper bound, we argue that G cannot have a vertex v of degree .f 1/f C 1 or more. For, then either v has f neighbors of the same color (yielding a copy of K 1;f with c Ä 2) or v has f neighbors of different colors each distinct from v's color (yielding a rainbow copy of K 1;f ).
Note that in contrast, if A contains 1 or f C 1 then every graph has a valid coloring. Further, if A contains 2, then there are graphs with arbitrarily large degree that have a valid coloring, such as the complete bipartite graph K m;m .

The star with three leaves
We consider next the star K 1;3 with three leaves. There are six cases not covered by general results, or by the colorings described earlier. These are the two singletons A D f2g and A D f3g, and the four pairs A D f1; 2g, A D f1; 3g, A D f2; 4g, and A D f3; 4g.

Colorings where every K 1;3 receives 2 colors
Consider F D K 1;3 and A D f2g. This is equivalent to a coloring where every vertex of degree at least 3 sees at most one color other than itself and has at most two neighbors of its color. We consider first families of planar graphs. Several authors (e.g. [1]) showed that one can partition the vertex set of an outerplanar graph into two forests of maximum degree 2. In particular, it follows that W .G; K 1;3 ; f2g/ exists and is at most 2. But for maximal (outer)planar graphs, one can go a bit further. Proof. (a) We saw above that such a graph has a valid coloring. Since G has maximum degree at least 3, one cannot use only one color. So it remains to show that one cannot use more than two colors.
If G has order 4 then this is easily checked; so assume the order is at least 5. We know that G has minimum degree 2. Consider a vertex u of degree 2 with neighbors v and w, necessarily adjacent. Then at least one of these vertices has degree at least 4, say v. Then, by induction, every valid coloring of G u uses exactly two colors. Since vertex v has degree at least 3 in G u, it must have a neighbor y (possibly w) of different color in G u. It follows that u must have the color of v or y. That is, G has only two colors.
(b) If G is hamiltonian, then it contains a maximal outerplanar graph as a spanning subgraph, and so the result follows from part (a). So assume it is not hamiltonian. Then it has connectivity at most 3 and so there is a cuttriangle T . Let G 1 be the graph formed from G by removing the vertices inside T ; let G 2 be the graph formed by removing the vertices outside T . By induction, the valid coloring of G when restricted to G 1 uses only two colors, and similarly when restricted to G 2 . Let v be a vertex of the triangle. Then, since G 1 and G 2 both have minimum degree at least 3, the vertex v must see both colors in G 1 and both colors in G 2 . Since v can see at most two colors in total, it follows that G 1 and G 2 use the same pair of colors. That is, G has only two colors.
For another graph family, consider cubic graphs. Such graphs always have a valid coloring since they have a coloring with two colors where every vertex has at most one neighbor of its color (a 1-defective 2-coloring [12]). It might be interesting to determine the maximum number of colors in such a coloring: What is the maximum possible number of colors in a coloring of a connected cubic graph of order n where every K 1;3 receives exactly 2 colors?
Note that for regular graphs, the case of F D K 1;f and A D ff 1g also corresponds to what we called a nearinjective coloring; see [13].

Colorings where every K 1;3 receives 3 colors
Consider F D K 1;3 and A D f3g. By Lemma 3.2, the maximum degree of a graph G with a valid coloring is at most 4. So one natural family to consider is the set of 4-regular graphs. Note that a valid coloring must be proper, and every vertex must have two neighbors of one color and two neighbors of another color. It follows that if only three colors are used in total, that each color must be used an equal number of times, and in particular, that the order of G is a multiple of 3. However, there are other orders for which such a coloring exists. For example, consider the direct product of a cycle C n with 2K 1 ; that is, duplicate each vertex of the cycle so that one ends up with a 4-regular graph on 2n vertices. Then a valid coloring is achieved by using n different colors, giving every pair of similar vertices the same color.
Another family of interest is the set of cubic graphs. Computer search shows that all small cubic graphs have such a coloring. What about in general? We conjecture yes.
Conjecture 3.6. Every cubic graph has a coloring where every K 1;3 receives 3 colors.
If the cubic graph G has a matching M none of whose edges are in a triangle, then one has a valid coloring by assigning a different color to each edge in M (and so every vertex has a neighbor of its color but no other repetition). Indeed, computer search suggests that the maximum colors in a valid coloring is always at least n=2. If true, this would be a strengthening of the conjecture from [7] that every cubic graph has a coloring with at least n=2 colors without a rainbow copy of K 1;3 . In contrast, there are cubic graphs that require more than 3 colors, since each color class in such a coloring would be a dominating set, and there are infinitely many cubic graphs of order n with domination number more than n=3 (see e.g. [14]).

Other restrictions on K 1;3
In each of the remaining cases (where A is a doubleton), the coloring is guaranteed to exist since A contains either 1 or 4. But note that these situations are different to the associated singletons. For example, let F D K 1;3 . Let G be a graph that has a valid coloring for A D f3g and H be a graph that does not. Then their disjoint union has W C .G [ H; K 1;3 ; f1; 3g/ 4.

The star with four leaves
Finally in this section we briefly consider the star K 1;4 with the allowed set A a singleton.
Consider the case that A D f4g. By Lemma 3.2 above, the maximum degree is at most 4. Clearly, vertices with degree smaller than 4 pose no constraints as centers of stars. So a natural class to consider is 4-regular graphs. Let K 2;2;2 denote the 4-regular graph of order 6. Computer search shows that all 4-regular graphs through order 12 have such a coloring, except for K 2;2;2 . This raises the question: Problem 3.7. Does every connected 4-regular graph, apart from K 2;2;2 , have a coloring where every K 1;4 receives exactly 4 colors?
Consider the case that A D f3g. By Lemma 3.2 above, the maximum degree can be as high as 6. It is not true that every 6-regular graph has a valid coloring; for example through order 11 only the complete multipartite graph K 3;3;3 has one. Nor is it true that every 5-regular graph has a valid coloring; for example only 3459 of the 7848 5-regular graphs of order 12 have one. But computer search shows that all 4-regular graphs through order 12 have a valid coloring. This raises the question:

Stripes
In this section we consider colorings where F is 1-regular. We begin by studying the case where F D 2K 2 .

Colorings where every 2K 2 receives 2 colors
Let M denote the set of graphs that do not contain two disjoint edges. That is, M is the set of all stars and K 3 together with isolates.
Theorem 4.1. A graph G has a coloring where every 2K 2 receives 2 colors if and only if (i) V .G/ has a bipartition .R; S / such that R and S both induce graphs of M, or (ii) G is the disjoint union of stars and K 3 's.
Proof. First observe that such a graph has the requisite coloring. In case (i), color every vertex in R red and every vertex in S sapphire. Then since there is no monochromatic 2K 2 , every copy of 2K 2 receives both colors. In case (ii), color every component monochromatically with a different color.
Suppose now that the graph G has a valid coloring. If every edge is monochromatic, then the graph is the disjoint union of stars and K 3 's, with each component monochromatic, and we are in case (ii) of the characterization.
So, assume there is a proper edge, say rs with r red and s sapphire. Suppose there is another color present; say vertex t is taupe. Then all edges out of t must go to fr; sg. If t has degree 2, then fr; s; t g is an isolated triangle; and indeed no other edge possible. So assume that t has degree 1; say with neighbor s. By similar argument, vertex r has degree 1 too. Indeed, any vertex x that is not sapphire must have degree 1 with s as its only neighbor. Then, if we change all non-sapphire vertices to be red, we will still have a valid coloring.
That is, we may assume that the coloring uses only two colors. It follows that we are in case (i) of the characterization.
It is straight-forward to argue that one can recognize such graphs in polynomial-time and calculate the minimum and maximum number of colors used. For a crude algorithm, simply consider all possible stars and triangles and check whether what remains after their edges are removed is bipartite. If we are in case (ii) with two or more components, then the number of colors used equals the number of components. If we are in case (i), then the minimum number of colors used is at most 2, as we argued in the above proof; we can only use more than two colors if there is a vertex s with multiple leaf neighbors and the rest of the graph has a suitable structure. We omit the details.

Colorings where every 2K 2 receives 3 colors
We consider next the case that every 2K 2 has 3 colors. Like the above result, the characterization is that the graph G must be "nearly bipartite".
Define the following graphs and graph classes. Let H 1 be the set of graphs that contain two adjacent vertices x and y such that every other edge is incident to x or y. Let H 2 be the graphs that contain a triangle x; y; z such that every other vertex is a leaf with a neighbor in fx; y; zg.
Let F 1 be the graph that is obtained from the disjoint union of K 4 and K 2 by identifying a vertex of each. Let F 2 be the graph that is obtained from K 4 e by picking a vertex x of degree 3 and a vertex y of degree 2 and adding a leaf adjacent only to x and one only to y. Let F 3 be the graph that is obtained from the disjoint union of K 4 e and P 3 by identifying a minimum-degree vertex of each. Let F 4 be the graph that is obtained from P 6 W v 1 ; v 2 ; : : : ; v 6 by adding edge v 3 v 5 . We draw these in Figure 1.
For a graph G, we define the reduced version of G by considering every vertex in turn and, if it has more than one leaf neighbor, discarding all but one of these neighbors. It is immediate that a graph has a valid coloring if and only if its reduced version has, because we may assume all leaves at a vertex are the same color.  Proof. These graphs each have a valid coloring. In case (i), color all vertices in one partite set red and give all remaining vertices unique colors. In case (ii), let x be the vertex that was identified. Color it and all other vertices in its partite set of H red, color its two neighbors in the K 3 sapphire, and then give all remaining vertices unique colors. In case (iii), color the subgraph H as shown in the above picture and color the subgraph M monochromatically with color 4. In case (iv), color the graphs with three colors as shown in the above picture. We turn to the proof that these are all the graphs. So assume G has a valid coloring. Proof. We claim first that there cannot be two consecutive vertices of the same color. Consider a portion of the cycle abcdef (where possibly a D f ) where c and d have the same color, say 1. Then, by considering the pair bc; de, without loss of generality b has color 2 and e has color 3. By considering the pair cd; ef , the vertex f must have a color other than 1 and 3. By considering pair bc; ef , it follows that vertex f has color 2. By similar argument, a has color 3 (and in particular a ¤ f ). But then pair ab, ef is a contradiction. Now suppose there are vertices at distance three of the same color. Consider a portion of the cycle abcdef (where possibly a D f ) where b and e have same color, say 1. Then by considering bc; de, without loss of generality c has color 2 and d has color 3. By considering pair cd; ef , vertex f must have a color from f1; 2; 3g. By the lack of consecutives of the same color, f cannot be color 1; by considering pair bc; ef , vertex f cannot be color 2. Therefore f has color 3. Similarly, vertex a has color 2. In particular a ¤ f , and so there is another vertex next to f , say g. Then by considering pair bc; fg, vertex g must have a color from f1; 2; 3g. But it can easily be checked that each choice leads to a contradiction.
So we have shown that there cannot be two consecutive vertices of the same color nor two vertices at distance three. Now consider again a portion of the cycle abcdef (where possibly a D f ). There must be a duplicate color at distance two within abcd . Say a and c have color 1, with b of color 2 and d of color 3. Then consider the pair bc; de. Since vertices b and d have different colors, it must be that vertices c and e have the same color. Then f must have a color different from c, d and e. Further, it cannot have the same color as b, by the pair ab; ef . By repeated application of this, it follows that every alternate vertex on the cycle has color 1. In particular the cycle has even length.
If the graph G is bipartite, we are done. So assume there is a triangle T . Claim 4.4. If T is properly colored, then we are in case (iii) or have reduced graph F 1 or F 2 .
Proof. Say triangle T has vertex a of color 1, vertex b of color 2, and vertex c of color 3. Suppose there is another color present, say vertex d has 4. Then consider an edge incident with d . If it goes to triangle T , we have a contradiction. So say it is de. By considering the pairs formed by de and each edge of T , it follows that e cannot have a new color, nor can it have color from f1; 2; 3g. Thus e has color 4. That is, the edges incident with the vertices not colored from f1; 2; 3g are monochromatically colored; and indeed must induce a component from M colored 4.
So consider the vertices with color from f1; 2; 3g. We cannot have an edge disjoint from the triangle, since if it is monochromatic one can pair it with an edge of T that includes that color, and if proper one can pair it with the edge of T that is identically colored. So all such edges have (at least) one end in the triangle. If the component containing T is in H 1 , then we are done. So assume the component containing T is not in H 1 . That is, every vertex of T has a neighbor outside the triangle. Consider the possibilities.
One possibility is that the three vertices of T have a common neighbor v. By the above, v must have one of their colors, say 1. If not just K 4 , there is another vertex, say w. This vertex cannot be incident with either a or v, so say incident with vertex c. Then w must be color 2 and must be a leaf. One can check that all remaining edges must be similarly incident with c. Further, the edge va being monochromatic implies that there is no monochromatic edge of color 4. That is, the reduced version of G is F 1 or K 4 .
A second possibility is that a; b have a common neighbor v while c has neighbor w. Suppose that w has color 3. Then considering the pair va; cw it follows that v must be color 2, but then the pair vb; cw is not validly colored. Thus vertex w has color 1, say. By considering the pair va; cw, it follows that the vertex v has color 2. Any other neighbor x of a must have color 2 because of ax; cw but not color 2 because of vb; ax, so a has no other neighbor. Any other neighbor y of b must have color 3 because of the pair av; by. And, any other neighbor z of c must have color 1 because of the pair bv; cz. Further, the edge vb being monochromatic means that there is no monochromatic edge of color 4. That is, the reduced version of G is F 2 or F 2 with one/both of the leaves deleted.
A third possibility is that a, b, and c have only distinct neighbors outside the triangle. That is, the component containing T is in H 2 .
So we can assume that there is no properly colored triangle T . So assume second there is an edge ds disjoint from T . Since one can pair it with ab, edge ds must be properly colored and neither end is color 1. Since one can pair it with ac, one end must have color 2. Further, no isolated vertex w of G T can have color 1 or 2, since V .T / [ fwg contains a 2K 2 . In particular, G T is bipartite with bipartition .D; S /, where d and every other vertex in D has color 2, while s and every other vertex in S has color distinct from f1; 2g.
Note that none of fa; b; cg can have a neighbor in D. Therefore, if neither a nor b has a neighbor in S , then we are in case (ii). So assume one of them, say a, has a neighbor e in S, say of color 3. Note that possibly e D s.
Then consider any vertex v other than fa; b; c; d; eg. Suppose it has a color not in f1; 2; 3g. By potential pairing with ae or ac, it follows that all neighbors of v have color 1 (so in particular v ¤ s) and then there is a contradiction from pairing with ds. That is, all vertices other than a; b have colors from f2; 3g.
It follows that the nontrivial component in G fa; bg is a star. Now, note that if both b and c have degree 2, we are in case (ii) of the theorem. So either b is adjacent to d , or c is adjacent to s. In the first case we get the reduced graph F 3 or possibly with edge removed so that it is just K 4 e [ K 2 (in which case G is covered by case (iii)). In the second case we get F 4 . And one can check that all remaining vertices are clones of existing leaves.
Finally suppose that all triangles are monochromatic. Then there can be only one. Indeed it must be an isolated component, while the remainder of the graph is bipartite, so that we are in case (iii).
This completes the proof of Theorem.

General stars
Consider colorings where every copy of f K 2 has a colors.
We start with the case that a D 2. Theorem 4.1 showed that if G is connected and a valid coloring exists, then W .G; 2K 2 ; f2g/ Ä 2. (We do need the connectivity, since the disjoint union of copies of K 3 has a valid coloring but each triangle must have a different color.) The analogue of Theorem 4.1 for more edges turns out to be simpler. Theorem 4.6. Let f > 2. A graph G has a coloring where every f K 2 receives two colors if and only if G has a bipartition .R; S/ such that both R and S induce subgraphs with matching number less than f .
Proof. If G has such a bipartition then that coloring is a valid coloring. So, consider a graph G that has a valid coloring. In particular, consider a valid coloring of G that uses the fewest total number of colors, and suppose that total is more than two.
Then G has vertices of three colors, say colors 1, 2, and 3. Consider recoloring every vertex of color 2 with color 1. This cannot increase the number of colors in any copy of f K 2 , but by minimality this coloring is invalid. That means that in G there must be a copy F 12 of f K 2 with colors 1 and 2.
Consider a vertex v of color 3 with neighbor w say. If w is disjoint from F 12 , then we can take vw, an edge of F 12 containing color 1 and an edge of F 12 containing color 2 and f 3 more edges of F 12 , and so obtain a bad fK 2 . So w must be in F 12 . In particular, there is no edge where both ends are color 3.
By similar logic, there is no monochromatic edge of any color. But that means every edge of F 12 is properly colored. And so vw and f 1 disjoint edges of F 12 produces a bad f K 2 , a contradiction. Thus, G has a valid coloring using only two colors.
We end with some comments about the general case. Proof. The colorings are as follows. For a D 1 give all vertices the same color; for a D 2 properly color each edge with red and sapphire; for a D f color all edges monochromatically but with different colors; for a D f C 1 color all edges properly with one end red and the other end a unique color; and for a D 2f give all vertices different colors.
Now consider a coloring of mK 2 for m large. One can obtain arbitrarily large collection of edges such that are either all edges are monochromatic or all are properly colored. In the former case we can further find large collection of edges that either are all the same color or are all different colors. Thus for the coloring to be valid we need a 2 f1; f g.
So assume all the edges in the collection are properly colored. Again we can find a large collection such that either all have the same pattern or all have different patterns. In the former case it follows that a D 2. So assume the latter case. We can then find a large collection where every edge e i has (at least one) end of color i . For the other end, we can again assume that they are all the same color or all different colors. In the former case we need a D f C 1.
In the latter case we can again prune so that each color appears on only one edge, and so a D 2f .
We saw in the proof of Theorem 4.2 that the 5-cycle does not have a coloring where every 2K 2 receives three colors. This can be generalized. Lemma 4.8. Consider colorings where every f K 2 has a colors. One can color all odd cycles if and only if a 2 f1; 2; 2f g. One can color all even cycles if and only if a 2 f1; 2; f C 1; 2f g.
Proof. The result is clear for a D 1 and a D 2f (color all vertices the same or all different). To do a D 2 (assuming f > 1), color every alternate vertices with red and sapphire except that possibly one pair of adjacent vertices receive the same color. To do a D f (assuming f > 2) in a large cycle, every edge must have a different monochromatic coloring, which is impossible. To do a D f C 1 (assuming f > 1) in a large cycle, every edge must have the same color pattern but be properly colored. So the cycle length must be even.
For example, for F D 3K 2 the above lemma shows that the cycle length is bounded for colorings where a 2 f3; 5g. If every 3K 2 receives three colors, then the longest cycle colorable is the 10-cycle: color red a vertex v and the two vertices at distance two from it, color sapphire the vertex v 0 opposite v and the two vertices at distance two from it, and color the remaining vertices taupe. If every 3K 2 receives five colors, then the only cycle of length more than 6 that can be colored is the 8-cycle: color red a vertex u and the vertex u 0 opposite u, color sapphire the two vertices adjacent to neither u nor u 0 , and give the remaining vertices unique colors. It can also be shown that the cycle length is bounded even if A D f3; 5g.