Vertex Colorings Without Rainbow Subgraphs
Vertex Colorings Without Rainbow Subgraphs
Abstract
This paper investigates vertex colorings of graphs such that some rainbow sub-
graph R and some monochromatic subgraph M are forbidden. Previous work focussed
on the case that R = M . Here we consider the more general case, especially the case
that M = K2 .
1 Introduction
Let F be a graph. Consider a coloring of the vertices of G. We say that a copy of F (as
a subgraph) is rainbow (or heterochromatic) if all its vertices receive different colors. We
say that the copy of F is monochromatic if all its vertices receive the same color.
The question of avoiding monochromatic copies of a graph is well studied (see for
example the survey [11]). Less studied, but still common, is the question of avoiding
rainbow copies (especially for edge-colorings); see for example [1, 2, 3]. In [8, 7] we defined
WORM colorings: these forbid both a rainbow and a monochromatic copy of a specific
subgraph. But it is more flexible to allow different restrictions. For graphs M and R, we
define an (M, R)-WORM coloring of G to be a coloring of the vertices of G with neither a
monochromatic subgraph isomorphic to M nor a rainbow subgraph isomorphic to R. Note
that such a coloring is not guaranteed to exist. For example, any G with at least one edge
does not have a (K2 , K2 )-WORM coloring.
1
One special case of WORM colorings has a distinguished history. Erdős et al. [5] defined
the local chromatic number of a graph as the maximum order of a rainbow star that must
appear in all proper colorings. In our notation, this is the minimum r such that the graph
has an (K2 , K1,r+1 )-WORM coloring. For a survey on this parameter, see [10].
One case is trivial: if we forbid a rainbow K2 , then every component of the graph must
be monochromatic. Similarly, if we forbid a rainbow kK1 , then this is equivalent to using
less than k colors. So we will assume that the subgraph R has at least three vertices and
at least one edge. On the other hand, taking M = K2 is equivalent to insisting that the
coloring is proper. Also, taking M = kK1 is equivalent to using each color less than k
times.
Having two competing restrictions leads naturally to considering both the minimum
and maximum number of colors in such a coloring. So we define the upper chromatic
number W + (G; M, R) as the maximum number of colors, and the lower chromatic number
W − (G; M, R) as the minimum number of colors, in an (M, R)-WORM coloring of G (if
the graph has such a coloring). For bounds, it will be useful to also let m− (G; M ) be the
minimum number of colors without a monochromatic M , and r+ (G; R) be the maximum
number of colors without a rainbow R. Note that
2 Preliminaries
We start with some simple observations. If G is bipartite then the bipartition is immediately
an (M, R)-WORM coloring. Indeed, if G is k-colorable with k < |R| , then a proper k-
coloring of G is an (M, R)-WORM coloring. Also:
2
(a) If G has an (M, R)-WORM coloring, then so does G−e where e is any edge and G−v
where v is any vertex. Further, W + (G − e; M, R) ≥ W + (G; M, R) and W + (G − v; M, R) ≥
W + (G; M, R) − 1, with similar results for the lower chromatic number.
(b) If M and R are connected but G is disconnected, then W + (G; M, R) is the sum of
the parameter for the components, and W − (G; M, R) is the maximum of the parameter for
the components.
(d) It holds that W + (G; M, R) ≥ |R| − 1 if G is |R| − 1 colorable (and has at least that
many vertices).
We will also need the following idea from [9]. We say that a set S bi-covers a subgraph H
if at least two vertices of H are in S. For positive integer s, define bF (s) to be the maximum
number of copies of F that can be bi-covered by using a set of size s. (Note that by definition
bF (1) = 0.)
Lemma 2 [9] Suppose that graph G of order n contains f copies of R and that bR (s) ≤
a(s − 1) for all s. Then r+ (G; R) ≤ n − f /a.
2.1 General M
It should be noted that maximizing the number of colors while avoiding a rainbow subgraph
can produce a large monochromatic subgraph. For example:
Observation 3 For all connected graphs M , there exists a graph G such that W + (G; M, P3 ) <
r+ (G; P3 ).
Proof. In [9] we considered the corona cor (G) of a graph G; this is the graph obtained
from G by adding, for each vertex v in G, a new vertex v 0 and the edge vv 0 . It was shown
that r+ (G; P3 ) = |G| + 1. In fact, we note here that if G is connected, then one can readily
show by induction that the optimal coloring is unique and gives every vertex of G the
same color. In particular, it follows that the no-rainbow-P3 coloring of cor (M ) with the
maximum number of colors contains a monochromatic copy of M .
3
3 A Result on Rainbow Paths
We showed [8] that a nontrivial graph G has a (P3 , P3 )-WORM coloring if and only if it
has a (P3 , P3 )-WORM coloring using only two colors. We prove an analogue for general
paths. This result is a slight generalization of Theorem 10 in [12].
Theorem 4 Fix some graph M ; if graph G has an (M, Pr )-WORM coloring, then G has
one using at most r − 1 colors.
Corollary 5 For any graph M and r > 0, graph G has an (M, Pr )-WORM coloring if and
only if m− (G, M ) ≤ r − 1. If so, W − (G; M, Pr ) = m− (G, M ).
On the other hand, Theorem 4 does not extend to stars. For example, Erdős et al. [5]
constructed a shift graph that has arbitrarily large chromatic number but can be properly
colored without a rainbow K1,3 . That is:
4 Proper Colorings
Recall that W + (G; K2 , R) is the maximum number and W − (G; K2 , R) the minimum num-
ber of colors in a proper coloring without a rainbow R.
4
4.1 Two simple cases
Proof. If we have a (K2 , P3 )-WORM coloring, then for each vertex v all its neighbors
must have the same color, which is different to v’s color. It follows that every path must
alternate colors.
In a proper coloring of a graph, all cliques are rainbow. Thus it follows:
Consider first that G is bipartite. Then in maximizing the colors, it is easy to see that one
may assume the colors in the partite sets are disjoint. (If red is used in both partite sets,
then change it to pink in one of the sets.) In particular, unless G is a star, one can use at
least two colors in each partite set. (This result generalizes to R any star.) For example,
it follows that W + (Km,m ; K2 , K1,3 ) = 4 for m ≥ 2.
Observation 9 For any graph G, the parameter W + (G; K2 , K1,r ) is at most the maximum
number of colors in a coloring of ON (G) with every hyperedge receiving at most r−1 colors.
Furthermore, there is equality if G is bipartite.
5
Proof. When G is bipartite, the ON (G) can be partitioned into two disjoint hypergraphs
and so will have disjoint colors in the hypergraphs. It follows that that coloring back in G
will be proper.
Recall that a 2-tree is defined by starting with K2 and repeatedly adding a vertex that
has two adjacent neighbors. For example, this includes maximal outerplanar graphs.
Theorem 11 [10] Determining whether a graph has a (K2 , K1,3 )-WORM coloring is NP-
complete.
We consider next 3-regular graphs. Since cubic graphs (other than K4 ) are 3-colorable,
they have a (K2 , K1,3 )-WORM coloring. And that coloring uses at most three colors.
Further, they have a coloring using two colors if and only if they are bipartite. So the only
interesting question is the behavior of the upper chromatic number.
Proof. Since G is cubic, the hypergraph ON (G) is 3-regular and 3-uniform. Further we
need a coloring of ON (G) where every hyperedge has at least one pair of vertices the same
color. Consider some color used more than once, say red. If there are r red vertices, then
at most 3r/2 hyperedges can have two red vertices. (Each red can be used at most thrice.)
6
It follows that if the ith non-unique color is used ri times, then we need
P
i ri ≥ 2n/3.
Let B be the number of vertices that can be discarded and still have one vertex of each
P
color. Then B = i (ri − 1) and by above B ≥ n/3. It follows that the total number of
colors is at most 2n/3.
Equality in Observation 12 is obtained by taking disjoint copies of K3,3 − e and adding
edges to make the graph connected. See Figure 1.
Consider next the minimum value of W + (G; K2 , K1,3 ) for cubic graphs of order n. We
noted above that bipartite graphs in general have a value of at least 4. Computer search
shows that this parameter is at least 3 for n ≤ 18. Indeed, it finds only three graphs where
the parameter is 3: one of order 6 (the prism), one of order 10, and one of order 14, the
generalized Petersen graph. These three graphs are shown in Figure 2.
7
4.3 Forbidding rainbow P4
We consider proper colorings without rainbow P4 ’s. Theorem 4 applies. That is, a graph
G has a (K2 , P4 )-WORM coloring if and only if G has chromatic number at most 3. In
particular, this means that it is NP-complete to determine if a graph has a (K2 , P4 )-WORM
coloring. Further, if such a coloring exists, then W − (G; K2 , P4 ) is the (ordinary) chromatic
number of G. So we consider only the upper chromatic number here.
Proof. In the smaller partite set, give all vertices the same color, and in the other partite
set, give all vertices unique colors. Note that every copy of P4 contains two vertices from
both partite sets.
Proof. Number the edges of the perfect matching e1 , . . . , en/2 such that for all i > 1, at
least one of the ends of ei is connected to some ej for j < i. Then ei , ej , and the connecting
edge form a P4 . It follows that ej and ei share a color. Thus the total number of colors
used is at most 2 + (n/2 − 1) = n/2 + 1.
For example, equality is obtained in both observations for any connected bipartite graph
with a perfect matching, such as the balanced complete bipartite graph or the path/cycle
of even order. Equality is also obtained in Observation 13 for the tree of diameter three
where the two central vertices have the same degree. Also, there are nonbipartite graphs
that achieve equality in Observation 14; for example, the graph shown in Figure 3.
8
Observation 15 If n is odd, then W + (Cn ; K2 , P4 ) is 3 for n ≤ 5, and (n−1)/2 for n ≥ 7.
Proof. The result for n = 3 is trivial and for n = 5 is easily checked. So assume n ≥ 7.
For the lower bound, color red a maximum independent set, give a new color to every
vertex with two red neighbors, and color each vertex with one red neighbor the same color
as on the other side of its red neighbor. For example, the coloring for C13 is shown in
Figure 4 (where the red vertices are shaded).
4 2
5 1
5 1
We now prove the upper bound. Two same-colored vertices distance 2 apart bi-cover
two copies of P4 , while two same-covered vertices distance 3 apart bi-cover one copy. It
follows that if a color is used k times, it can bi-cover at most 2(k − 1) copies of P4 , except
if the vertices of that color form a maximum independent set, when it bi-covers 2k − 1
copies. Since there are n copies of P4 in total, by Lemma 2 it follows that the total number
of colors is at most n/2, unless some color is a maximum independent set. So say red is
a maximum independent set. Let b and e be the two red vertices at distance 3; say the
portion of the cycle containing them is abcdef . By considering the a–d copy of P4 , it follows
that a must have the same color as c or d. Similarly, f must have the same color as c or d.
Thus the total number of colors is at most 1 + (n − (n − 1)/2) − 2 = (n − 1)/2.
In contrast to Observation 13, we get the following:
Proof. Note that every triangle is properly colored. We show that every triangle receives
the same three colors. Consider two triangles T1 and T2 . If T1 and T2 share two vertices,
9
then the third vertex in each share a color. Consider the case that T1 and T2 share one
vertex. Then by considering the four P4 ’s using all vertices but one, it readily follows that
the triangles must have the same colors.
Now, assume that T1 and T2 are disjoint but joined by an edge e. Suppose they do not
have the same three colors. Then there is vertex u1 in T1 and u2 in T2 that do not share
a color with the other triangle. If u1 and u2 are the ends of e, then any P4 starting with e
is rainbow. If u1 and u2 are not the ends of e, then there is a P4 whose ends are u1 and u2
and that P4 must be rainbow. Either way, we obtain a contradiction.
Since the graph is connected, it follows that every triangle is colored with the same
three colors. Since this includes all the vertices, the result follows.
For example, it follows that if G is a maximal outerplanar graph, then it follows that
W + (G; K2 , P4 ) = 3.
There are many cubic graphs with W + (G; K2 , P4 ) = 3. These include, for example, the
claw-free cubic graphs (equivalently the ones where every vertex is in a triangle). See
Theorem 16.
Certainly, by Observations 13 and 14 (and the fact that regular bipartite graphs have
perfect matchings), that value is obtained for all bipartite graphs.
10
Proof. Consider two triangles sharing an edge. Then to avoid a rainbow C4 , the two
vertices not on the edge must have the same color. It follows that all triangles have the
same three colors.
In particular, we again look at cubic graphs. The parameter W − (G; K2 , C4 ) for a cubic
graphs G is uninteresting: the 3-coloring provides such a WORM coloring, and so the
parameter is determined by whether G is bipartite or not. Further, the upper bound for
W + (G; K2 , C4 ) is trivial: one can have a cubic graph without a 4-cycle.
Computer evidence suggests that:
This lower bound is achievable. Define a prism as the cartesian product of a cycle
with K2 . For n even, a Mobius ladder is defined by taking the cycle on n vertices and
joining every pair of opposite vertices. Note that a prism is bipartite when n is a multiple
of 4, and a Mobius ladder is bipartite when n is not a multiple of 4.
Proof. We first exhibit the coloring. Let m = n/2. Say the vertices of the prism are
u1 , . . . , um and v1 , . . . , vm , where ui has neighbors ui−1 , ui+1 , and vi (arithmetic modulo m)
and similarly for vi . Then for 1 ≤ i ≤ m, give vertices ui and vi+1 color i.
Say the vertices of the Mobius ladder are w1 , . . . , wn where wi has neighbors wi−1 , wi+1 ,
and wi+m (arithmetic modulo n). Then for 2 ≤ i ≤ m, give vertices wi and wi+m−1 color
i, give vertex w1 color 1 and give vertex wn−1 color 2. For example, the coloring for the
case n = 12 is shown in Figure 5.
Now, for the upper bound, consider a color that is used r times. A color bi-covers
a copy of C4 if it contains vertices from consecutive rungs (where a rung is an edge in
two C4 ’s). Since the graph is not bipartite, the color cannot be present in every rung. It
follows that it can bi-cover at most r − 1 copies of C4 . Now, there are m copies of C4 (note
that the prism of C4 is bipartite so excluded). It follows from Lemma 2 that the number
of colors is at most n − n/2 = n/2.
It appears that this extremal graph is unique for all orders.
11
1 2 3 4 5 6
2 3 4 5 6 2
5 Other Results
The natural strategy to color a long path without a rainbow Pr yields the following:
Proof. Give the first r − 1 vertices different colors, then the next vertex the same color
as the previous vertex, then the next r −2 vertices different colors, and so on. This coloring
has a monochromatic P2 but not a monochromatic P3 , and is easily seen to be best possible
(as every copy of Pr must contain two vertices of the same color).
Next we revisit the case that G, M , and R are bicliques. For n ≥ b it was proved that
W + (Kn,n ; K1,b , K1,b ) = 2b − 2 in [8] and that W + (Kn,n ; Kb,b , Kb,b ) = n + b − 1 in [7]. The
case for stars is special, but it is straight-forward to generalize the latter:
Proof. Consider a coloring Km,n without a rainbow Ka,b and assume there are at least
a + b colors. If one partite set has at least a colors and the other partite set has at least b
12
colors, then one can choose a colors from the one and b from the other that are disjoint
and thus obtain a rainbow Ka,b . So: either (1) there is a partite set that has at most a − 1
colors, or (2) both partite sets have at most b − 1 colors. In the first case, the maximum
number of colors possible is a + n − 1. In the second case, the maximum number of colors
possible is b − 1 + min(m, b − 1). The theorem follows.
Note that in the above proof, the optimal number of colors can be achieved by making
the sets of colors in the two partite sets disjoint. Thus, one obtains a similar value for
W + (Km,n ; M, Ka,b ) where M is any nontrivial biclique.
We conclude this section with a result about forbidden 4-cycles. This result establishes a
conjecture proposed in [7]. Let Gm,n denote the grid formed by the cartesian product of
Pm and Pn .
Observation 21 For any grid and s > 0, bC4 (s) ≤ 2(s − 1).
Proof. We prove this bound by induction. Let S be a set of s vertices. The bound is
immediate when S is contained in only one row. Now suppose S intersects at least two
rows. Let S1 be a maximal set of consecutive vertices of S in the topmost row of S. By
the induction hypothesis, the number of C4 ’s that contain at least two vertices in S \ S1
is at most 2(|S| − |S1 |) − 2. Further, the number of C4 ’s that contain at least one vertex
in S1 and least two vertices in S is at most 2|S1 |: there are |S1 | − 1 possible copies above
S1 and at most |S1 | + 1 copies below. Hence, the number of C4 ’s that S bi-covers is at
most 2(|S| − |S1 |) − 2 + 2|S1 | = 2|S| − 2.
In [7] a (C4 , C4 )-WORM coloring is given and it is conjectured that this is best possible.
This we now show:
Theorem 22 For Gm,n the m × n grid, it holds that W + (Gm,n ; C4 , C4 ) = b(m + 1)(n +
1)/2c − 1.
Proof. The lower bound was proved in [7]. The upper bound follows from Lemma 2 and
Observation 21: There are (m − 1)(n − 1) copies of C4 , and so r+ (Gm,n ; C4 ) ≤ mn − (m −
1)(n − 1)/2 = (m + 1)(n + 1)/2 − 1.
13
6 Other Directions
We conclude with some thoughts on future directions. Apart from the specific open prob-
lems raised here, a direction that looks interesting is the case where M and R are both
stars. Also of interest is where the host graph is a product graph.
References
[2] Cs. Bujtás, E. Sampathkumar, Zs. Tuza, C. Dominic, and L. Pushpalatha, Vertex
coloring without large polychromatic stars, Discrete Math. 312 (2012), 2102–2108.
[3] Cs. Bujtás, E. Sampathkumar, Zs. Tuza, M.S. Subramanya, and C. Dominic, 3-
consecutive C-colorings of graphs, Discuss. Math. Graph Theory 30 (2010), 393–405.
[4] Cs. Bujtás and Zs Tuza, K3 -worm colorings of graphs: Lower chromatic number and
gaps in the chromatic spectrum, arXiv:1508.01759.
[5] P. Erdős, Z. Füredi, A. Hajnal, P. Komjáth, V. Rödl, and Á. Seress, Coloring graphs
with locally few colors, Discrete Math. 59 (1986), 21–34.
[6] L. Eroh, Constrained Ramsey numbers of matchings, J. Combin. Math. Combin. Com-
put. 51 (2004), 175–190.
[7] W. Goddard, K. Wash, and H. Xu, WORM colorings forbidding cycles or cliques,
Congr. Numer. 219 (2014), 161–173.
[9] W. Goddard and H. Xu, Vertex colorings without rainbow subgraphs, to appear in
Discussiones Math. Graph Theory.
[10] G. Osang, The local chromatic number, Master’s thesis, University of Waterloo, 2013.
[11] Zs. Tuza, Graph colorings with local constraints—a survey, Discuss. Math. Graph
Theory 17 (1997), 161–228.
14
[12] Zs. Tuza and V. Voloshin, Uncolorable mixed hypergraphs, Discrete Appl. Math. 99
(2000), 209–227.
[15] H. Xu, Generalized colorings of graphs, Ph.D. thesis, Clemson University, 2016.
15