1 Introduction

Erdős [12] formulated the following Ramsey type problem: What is the least number f(npq) of colors needed for an edge-coloring of the complete graph \(K_n\) if it has the property that every subset of p vertices spans at least q distinct colors? Initial investigations by Elekes, Erdős, and Füredi reported in [12] were followed by a more systematic study by Erdős and Gyárfás in [13]. A more general variant of the problem was studied by Axenovich, Füredi, and Mubayi [3], where they color the edges of a not necessarily complete graph G and require that every copy of another graph \(H\subseteq G\) receive at least a given number of colors. Axenovich and Iverson [4] investigated the mixed anti-Ramsey numbers that are the maximum and minimum numbers of colors to be used in an edge-coloring of \(K_n\) that avoids both monochromatic copies of a fixed graph G and also totally multicolored copies of another fixed graph H.

Here we initiate the investigation of yet another variant that will also be connected to some of the above versions of the classical Ramsey problem. Let g(nF) denote the minimum number of colors needed in an edge-coloring of \(K_n\) if it contains no monochromatic copy of F, furthermore, it contains at least one totally multicolored copy of F on every subset of |V(F)| vertices.

If F has only two edges then the two conditions coincide and we get well-known numbers: for F being two adjacent edges we need a proper edge-coloring of \(K_n\), while in case of two nonadjacent edges we ask the chromatic number of the complementary graph of the line graph of \(K_n\), or equivalently, the chromatic number of the special Kneser graph \(\mathrm{KG(n,2)}\) (cf. [23]), which is \(n-2\). When F is a triangle, then again, the condition is simply equivalent to give a proper edge-coloring of \(K_n\). (We note that if F is a complete graph on p vertices, then our problem is clearly equivalent to determining \(f(n,p,{p\atopwithdelims ()2})\), that is trivially equal to \({n\atopwithdelims ()2}\) if \(p>3\), cf. [13].) The first meaningful cases of our problem thus belong to graphs F with 3 edges and 4 vertices. Thus the first interesting cases belong to \(F=K_{1,3}\), and \(F=P_4\), the star and the path on four vertices. We will determine \(g(n,K_{1,3})\) and \(g(n,P_4)\) for infinitely many n in Sect. 2.

Completely multicolored edge triples are investigated in a somewhat different context in [22] and also in the subsequent paper [5]. There we have only three colors but we can color in several rounds. Vera T. Sós asked in 1991, how many 3-edge-colorings of \(K_n\) (\(n\ge 3\)) are needed to have every triangle 3-colored in at least one of them. This question was related to a special case of the so-called perfect hashing problem, cf. [15, 19, 20]. In [22] we gave a construction proving that the requested minimum number is at most \(\lceil \log _2n\rceil -1\), while an easy argument shows that it is bounded from below by \(\lceil \log _3(n-1)\rceil \). Different edge triples were also considered in [22], but we did not find meaningful bounds in the case when these edges form a \(P_4\). In Sect. 3 we give upper bounds for the number of 3-edge-colorings needed if we want that at least one \(P_4\) gets 3-colored on every 4 vertices in at least one of our colorings.

Note that if we wanted to only 2-color every triangle in several rounds of 3-edge-colorings then we would need exactly \(\lceil \log _3 k(n)\rceil \) rounds, where \(k(n)=\min \{k: R(3;k)>n\}\), where R(3; k) is the minimum order of a complete graph that cannot be k-edge-colored without creating a monochromatic triangle, i.e., the Ramsey number \(R(3,3,\dots ,3)\) with the number of 3’s being k. (We simply have to encode each color with a ternary sequence to convert the coloring into \(\lceil \log _3 k(n)\rceil \) 3-edge-colorings.) The growth rate of this number is well-known to be closely related to the Shannon (OR-)capacity of triangle-free graphs. Elaborating on this connection we observe, using a result of Cropper, Gyárfás, and Lehel [9], that the answer to a famous question about the growth rate of R(3; k) depends on whether the Shannon (OR-)capacity of Mycielski graphs goes to infinity. As a first modest step towards such investigations we show that the Shannon (OR-)capacity of the Grötzsch graph is strictly more than that of \(C_5\), the cycle of length five. These questions are discussed in the last subsection of Sect. 3.

2 \(K_{1,3}\)- and \(P_4\)-Caring Colorings

Along with introducing some other related parameters, let us repeat the definition of g(nF) that we already defined less formally in the Introduction.

Definition 1

Let F be any fixed graph and \(n\ge |V(F)|\). An edge-coloring of \(K_n\) in which no copy of F is monochromatic and at the same time every subset of |V(F)| vertices contains a totally multicolored (rainbow) copy of F is called F-caring. Let g(nF) denote the minimum number of colors needed for an F-caring coloring of \(K_n\).

Let b(nF) denote the minimum number of colors needed for an edge-coloring of \(K_n\) that contains no monochromatic copy of F.

Finally, let a(nF) denote the minimum number of colors needed for an edge-coloring of \(K_n\) that makes at least one copy of F totally multicolored in every subset of |V(F)| vertices.

Thus b(nF) is simply the smallest k for which we have that the Ramsey number \(R_k(F,F,\dots ,F)>n\), where the index k refers to the number of colors used. (So \(R_k(F,F,\dots ,F)\) denotes the smallest order of a complete graph that cannot be k-edge-colored without creating a monochromatic copy of F.) It is immediate from the above definition that \(g(n,F)\ge \max \{a(n,F),b(n,F)\}\). It is a trivial matter to determine \(b(n,K_{1,3})\) exactly, and it is also easy to tell the value of \(b(n,P_4)\) for infinitely many values of n.

Proposition 1

One has \(b(n,K_{1,3})=\left\lceil \frac{n-1}{2}\right\rceil \) for every \(n\ge 4\).

Proof

Any color class that contains no \(K_{1,3}\) must give a graph with maximum degree at most 2, thus it is a collection of vertex-disjoint paths and cycles. It follows that the number of edges in each color class is at most n and thus the lower bound \(b(n,K_{1,3})\ge \lceil \frac{n-1}{2}\rceil \) follows.

On the other hand, it is well-known that if n is odd, then the edge set of \(K_n\) can be partitioned into \(\frac{n-1}{2}\) Hamiltonian cycles, see e.g. [7]. Letting the edges of these cycles form the color classes the Proposition follows for odd values of n.

If n is even, then we can simply take a proper edge-coloring of \(K_n\) with \(n-1\) colors, and pair up the colors in an arbitrary way. For each pair of colors define a new color class, obviously, no vertex will connect to three edges in it. This proves the required upper bound for even values of n. \(\square \)

For the next proposition we need some notions from the theory of block designs. A Steiner triple system (STS for short) is a family of 3-element subsets of a basic set of n elements having the property that every pair of elements belongs to exactly one triple of the family. An STS is called resolvable if it can be partitioned into subfamilies, called parallel classes, in which each element of the basic set belongs to exactly one triple. (That is, in each parallel class the triples are pairwise disjoint and their union is the entire basic set.) Resolvable Steiner triple systems are called Kirkman triple systems (KTS for short) referring to Kirkman’s puzzle in the middle of the 19th century asking for the existence of such a system of triples and their parallel classes for \(n=15\), cf. [31]. In full generality it was proven only more than a hundred years later by Ray-Chaudhury and Wilson [28] that Kirkman triple systems exist for all \(n\equiv 3 \pmod 6\). (It is easy to see that they cannot exist for any other n.) Note that if a KTS exists for n then it has \(\frac{n-1}{2}\) parallel classes.

Proposition 2

If \(n\equiv 3\pmod 6\), then \(b(n,P_4)=\frac{n-1}{2}.\)

Proof

Consider an edge-coloring of \(K_n\) with \(b(n,P_4)\) colors in which no \(P_4\) is monochromatic. Then each color class is a \(P_4\)-free graph, so it must be a collection of vertex-disjoint triangles and stars. This implies that the number of edges in each color class is at most n. So the number of color classes \(b(n,P_4)\ge \frac{n-1}{2}\).

For equality we need a coloring in which all color classes contain only triangles (none of them are stars). As every edge gets exactly one color, this requires that the union of the triangles forming the color classes be a Steiner triple system if we consider the triangles as triples. Furthermore, as each color class should consist of vertex-disjoint triangles, they should form the parallel classes of a Kirkman triple system. Conversely, if a Kirkman triple system on n points exists, then we can use its parallel classes to define color classes of the edges so that each edge is colored with some identifier of the parallel class it belongs to (that is, which contains a triple, that covers this edge). Such a coloring uses \(\frac{n-1}{2}\) colors and it lets no \(P_4\) remaining monochromatic. This proves \(b(n,P_4)\le \frac{n-1}{2}\) whenever \(n\equiv 3 \pmod 6\). \(\square \)

The two propositions above give obvious lower bounds for the value of \(g(n,K_{1,3})\) and \(g(n,P_4)\), respectively. Below we show that these lower bounds are tight.

Proposition 3

If \(n\equiv 3\pmod 6\), then

$$\begin{aligned} g(n,K_{1,3})=\frac{n-1}{2} \end{aligned}$$

Proof

Since \(g(n,F)\ge b(n,F)\) by definition, \(g(n,K_{1,3})\ge \frac{n-1}{2}\) is immediate from Proposition 1. For the reverse inequality take a coloring based on a Kirkman triple system as in the proof of Proposition 2, for the numbers in the statement such a system exists by the result of Ray-Chaudhury–Wilson [28]. We show this is a \(K_{1,3}\)-caring coloring.

It is clear that no \(K_{1,3}\) is monochromatic, since each vertex has degree 2 only within each graph formed by edges of a color class. Note that if two adjacent edges belong to the same color class, then the edge extending this pair of edges to a triangle should also belong to the same color class. Now consider a set of four points \(\{a,b,c,d\}\). If there is a monochromatic triangle on them formed by, say, vertices abc, then the fourth vertex must be connected to each of ab, and c in a different color. (If two of them were the same, then it would require an edge of the monochromatic triangle to belong to another monochromatic triangle, which is impossible.) Thus the \(K_{1,3}\) spanned by edges dadbdc is rainbow. If there is no monochromatic triangle on our 4 points, then it cannot contain even two adjacent edges with the same color and thus all the four \(K_{1,3}\)’s it contains are rainbow. \(\square \)

In what follows we will use the notation \(a\oplus _nb\) for the modulo n sum of integers a and b.

Theorem 1

If \(n\ge 4\) is a power of 3, then

$$\begin{aligned} g(n,P_4)=\frac{n-1}{2} \end{aligned}$$

.

Proof

Since \(g(n,F)\ge b(n,F)\), we have \(g(n,P_4)\ge \frac{n-1}{2}\) from Proposition 2. Now let \(n=3^t\). For the reverse inequality we show a Kirkman triple system that has the property that every quadruple of vertices contains some \(P_4\) the three edges of which belong to three different parallel classes of the KTS. (In what follows we will often refer to the parallel classes as colors. Colorings defined by the parallel classes of a KTS as color classes will be called KTS colorings. Note that no \(P_4\) can be monochromatic in a KTS coloring according to the argument in the proof of Proposition 2).

It is straightforward to check that if a \(K_4\) is edge-colored with at least 4 colors then it must contain a rainbow \(P_4\). If a \(K_n\) is edge-colored with the parallel classes of a KTS then there is only one way not to have 4 differently colored edges on a fixed set of four vertices, namely when it is colored with three colors and the coloring partitions its edge set into three matchings, each containing exactly two edges. (In other words it is an optimal proper edge coloring of this \(K_4\).) This simply follows from the fact that if two adjacent edges have the same color in a KTS coloring, then the third edge with which they form a triangle must also belong to the same color class. So it is enough to show, for every \(t\ge 2\), a KTS on \(n=3^t\) vertices with the property that the KTS coloring it defines will not partition the edge set of any \(K_4\) into three perfect matchings. Let us call a KTS with this property that it has at least 4 parallel classes intersecting the edge set of any \(K_4\subseteq K_n\) a good KTS.

The smallest non-trivial KTS that exists is on 9 points and is easily shown to have this property as follows. Assume that for a set of four points \(\{a,b,c,d\}\) the coloring it defines colors \(\{a,b\}\) and \(\{c,d\}\) the same color. Then the edges \(\{a,b\}\) and \(\{c,d\}\) belong to disjoint triples of the same parallel class of the KTS. This needs two distinct vertices belonging to those two triples outside the set \(\{a,b,c,d\}\). The same can be said about the other two pairs of edges, so altogether we need six vertices outside \(\{a,b,c,d\}\), but we only have 5 as there are only 9 points altogether. So the KTS on 9 points is a good KTS.

Now we prove the theorem by induction on t. Assume we have a good KTS on \(3^{t-1}\) points, and show that one exists also on \(3^t\) points. Partition our \(3^t\) points into three equal size partition classes \(A_{\ell }\) (that we will call groups to distinguish them from parallel classes of Kirkman triple systems) and label them as \((\ell ,j)\) with \(\ell \in \{0,1,2\}\) referring to their group and \(j\in \{0,1,\dots , 3^{t-1}-1\}\) to their position according to an arbitrary labelling within their group. Take three copies of the existing good KTS on \(3^{t-1}\) points with parallel classes \(C_1, \dots , C_m, m=\frac{3^{t-1}-1}{2}\) on the three groups and consider the union of their ith parallel classes as the ith parallel class of the KTS we are constructing on \(3^t\) points. For \(j=0,1,\dots ,3^{t-1}-1\) we define \(C_{m+j+1}:=\{\{(0,a),(1,a\oplus _{3^{t-1}}j),(2,a\oplus _{3^{t-1}}2j)\}: 0\le a<3^{t-1}\}\). Then \(\{C_1,\dots ,C_{\frac{3^t-1}{2}}\}\) is a Kirkman triple system, we show it is good.

Call a \(K_4\) bad (with respect to a KTS) if its edges belong to only 3 parallel classes of the KTS. Consider any four points, we want to show that they cannot induce a bad \(K_4\) (with respect to the KTS just defined). If the four points are all in the same group \(A_{\ell }\) then they could induce a bad \(K_4\) only if the KTS on \(3^{t-1}\) points we started with would not be a good one, which is not the case. If our four points are in 3 different groups, then exactly one pair of these four points belongs to the same group and thus to a \(C_k\) with \(0\le k\le m\) with m still meaning the value \(\frac{3^{t-1}-1}{2}\). Then this pair of points forms a differently colored edge compared to the complementary two points in our 4-element set, so the edge set of our \(K_4\) cannot be partitioned into three perfect matchings and thus this \(K_4\) cannot be bad. If the four points are in two groups so, that one is in one group, say \(A_{\ell }\), and three of them are in the other group, say \(A_h\) then the three edges of our \(K_4\) that has one endpoint in \(A_{\ell }\) and the other in \(A_h\) all belong to different \(C_k\)’s with \(m<k\) while the remaining three edges all belong to some \(C_k\)’s with \(k\le m\). So again, we have at least 4 colors in our \(K_4\). Lastly, if two of our points are in \(A_{\ell }\) and two are in \(A_h\) with \(\ell \ne h\), then the four edges running between the two groups must belong to at least three different \(C_k\)’s with \(k>m\). This is because only pairs of independent edges among them can have the same color and if \(a,b\in A_{\ell }\), \(c,d\in A_h\), and edges \(\{a,c\}, \{b,d\}\) have the same color, then we have \(c-a\equiv d-b\ (\text {mod}\ 3^{t-1})\). Both \(\{a,d\}\) and \(\{b,c\}\) should then belong to a different color class, and these two may not be equal, otherwise we also have \(c-b\equiv d-a\ (\text {mod}\ 3^{t-1})\), and the last two congruences would imply \(b-a\equiv a-b\ (\text {mod}\ 3^{t-1})\) contradicting that a and b are different. The remaining two edges \(\{a,b\}\) and \(\{c,d\}\) belong to \(C_k\)’s with \(k\le m\), so we again have at least four differently colored edges in our \(K_4\). This completes the proof of the theorem. \(\square \)

Remark 1

We have \(g(n,F)\ge \max \{a(n,F),b(n,F)\}\) for every graph and we have seen above that for \(K_{1,3}\) and \(P_4\) we have \(g(n,K_{1,3})=b(n,K_{1,3})\) and \(g(n,P_4)=b(n,P_4)\) for infinitely many n. In fact, \(a(n,K_{1,3})\) and \(a(n,P_4)\) are indeed strictly smaller than \(b(n,K_{1,3})\) and \(b(n,P_4)\). This can be seen by using that \(a(n,K_{1,3})\le f(n,4,4)\), \(a(n,P_4)\le f(n,4,4)\) (for the meaning of f(npq) see the beginning of the Introduction), and Erdős and Gyárfás’s result from [13] stating that \(f(n,4,4)\le O(n^{2/3})\), improved by Mubayi [25] (via an explicit construction) to \(f(n,4,4)\le n^{1/2}e^{c\sqrt{\log n}}\) with an absolute constant \(c>0\). Nevertheless, \(a(n,F)>b(n,F)\) can also happen. This is trivially so if F is a complete graph, but also for any F with \(|E(F)|>\frac{1}{2}{|V(F)|\atopwithdelims ()2}\) we immediately have \(a(n,F)\ge b(n,F)\). For F being a complete graph minus one edge we also trivially have \(g(n,F)=a(n,F)=f(n,|V(F)|,{|V(F)|\atopwithdelims ()2}-1)\). In particular, \(f(n,4,5)\ge \frac{5}{6}(n-1)\) is proven in [13] implying that for \(F=K_4\setminus \{e\}\) (where e is an edge of \(K_4\)) we have \(b(n,F)\le f(n,4,3)<f(n,4,5)=a(n,F)\).

Remark 2

Although an analogous result to that of Ray-Chaudhury and Wilson [28] about the existence of Kirkman triple systems was proven by Hanani, Ray-Chaudhury, and Wilson [17] for quadraple systems (that is the existence of resolvable so-called balanced incomplete block designs of block size 4 whenever a trivial necessary condition is met), it cannot be directly used for generalizing even Proposition 3 to determine \(g(n,K_{1,4})\). This is because a colouring based on such designs will not guarantee the 4-coloring of a \(K_{1,4}\) subgraph on every 5 vertices.

3 Coloring in Several Rounds

3.1 Relaxations of Perfect Hashing

The perfect hashing problem, investigated in [15, 19, 20] asks for the minimum length of sequences over an alphabet of size \(b\ge k\), such that one can give n such sequences so that for any k of them there is a position where all of these k sequences differ. While the answer is trivially \(\log _bn\) if \(k=2\), for \(k=3\) the answer is not known even for the smallest meaningful alphabet size \(b=k=3\). Denoting the required minimum length by t(nbk) in general, it is known that \(t(n,b,k)=\varTheta (\log n)\) for any fixed pair (bk) and the relevant quantity asked for is \(c_{b,k}=\liminf _{n\rightarrow \infty }\frac{t(n,b,k)}{\log n}\). The best known bounds on \(c_{b,k}\) in general are given in [20], in case of \(c_{3,3}\) their values are

$$\begin{aligned} \frac{1}{\log \frac{3}{2}}\le c_{3,3}\le \frac{4}{\log \frac{9}{5}}, \end{aligned}$$

where, as always in the sequel when not stated otherwise, the logarithms are meant to be on base 2. Numerically the above bounds mean \(1.709\le c_{3,3}\le 4.717.\)

We remark that the upper bound is implicit in Elias [11], and that for \(c_{4,4}\) some improvements were found recently by Dalai, Guruswami, and Radhakrishnan [10]. From now on we are focusing here only on the \(b=k=3\) case.

While this problem is notoriously difficult, it is interesting to look at relaxations where we do not require all triples of our sequences being pairwise different at some position (this is the relation we called “trifference” in [22]) but only a selected collection of all triples should have this property. Such a selected collection is most naturally defined by some underlying structure. This explains what could be the motivation for Vera T. Sós in 1991 for asking how long our sequences should be if the basic set is identified to the edge set of \(K_n\) and only those triples should be trifferent at some position that form a triangle. In other words: How many 3-edge-colorings of \(K_n\) are needed to make every triangle 3-colored in at least one of them? Though we still do not know the exact answer to this question, it indeed seems to be more easily tractable than the problem of \(c_{3,3}\), because here we could at least give an explicit construction (see [22]) that implies a \(\lceil \log _2n\rceil -1\) upper bound on the length of sequences needed, while an obvious lower bound is \(\lceil \log _3(n-1)\rceil \). These two bounds differ first at \(n=9\) for which Blokhuis, Faudree, Gyárfás, and Ruszinkó [5] proved that the upper bound is tight. For a completely solved variant involving orientations in place of colorings, see [18]. (For the general trifference problem the best known upper bounds on \(c_{3,3}\) are obtained via the probabilistic method, that is, they are not constructive.) If instead of the edges of triangles we want the 3 edges of every \(K_{1,3}\) or every 3 independent edges to become trifferent in at least one coloring, then the required minimum number of colorings will be \(c_{3,3}\log n+o(\log n)\), see [22]. (The reason is simple: In case of \(K_{1,3}\), we have to make all the \((n-1)\) edges incident to a fixed vertex have the property that any three of them is trifferent at some coloring, while encoding the \((n-1)\) or n colors of an optimal proper edge-coloring this way will do the job; and a similar reasoning works for three independent edges.)

We did not find non-trivial bounds in [22] for the triples given by the edge sets of \(P_4\)’s. A trivial upper bound is \(2c_{3,3}\log n+o(\log n)\), since with that many colorings we can make all the \({n\atopwithdelims ()2}\) edges having the property that any triple is trifferent at some coloring. We also have \(\log _3(n-1)\) as a trivial lower bound as any two edges incident to the same fixed vertex should get a different color in some coloring as they appear together in some \(P_4\). (Note that in this kind of problems it is typically the constant multiplier of \(\log n\) that we are seeking for.)

A consequence of Erdős and Gyárfás’s [13] and of Mubayi’s result [25] already mentioned in the first remark at the end of the previous section is that if we require only that the three edges of at least one \(P_4\) of every \(K_4\) subgraph get trifferent in some 3-edge-coloring then the number of colorings we need is strictly less than the above mentioned trivial upper bound.

Definition 2

Let p(n) denote the minimum number of 3-edge-colorings of \(K_n\) needed if we want that for all 4 vertices the edge set of some \(P_4\) subgraph on those 4 vertices gets totally multicolored in at least one of these colorings.

Proposition 4

$$\begin{aligned} p(n)\le \frac{1}{2}c_{3,3}\log n+o(\log n). \end{aligned}$$

Proof

Color the edges of \(K_n\) with \(m:=n^{1/2}e^{c\sqrt{\log n}}=n^{1/2+o(1)}\) colors with Mubayi’s method so that at least 4 colors appear on every \(K_4\) subgraph. This means that at least one \(P_4\) of each \(K_4\) is totally multicolored. Now encode each color with a ternary sequence of length t(m, 3, 3) so that any 3 sequences are trifferent in at least one coordinate. Now substituting every color in the previous coloring with a sequence of 3-colorings according to the ternary codes of colors, we will get a required sequence of 3-colorings, since any three edges that received three different colors in the first coloring must get three different colors in the 3-coloring that belongs to the position where the codewords of those 3 colors are trifferent.

Since \(t(m,3,3)=c_{3,3}\log m+o(\log m)=c_{3,3}\frac{1}{2}\log n+o(\log n)\) the result follows. \(\square \)

Remark 3

A \(K_4\) that is edge-colored with 4 colors contains at least 4 totally multicolored \(P_4\)’s out of the altogether 12 ones. It would be interesting to see whether one could apply Mubayi’s coloring 3 times in such a way that all \(P_4\)’s get 3-colored in at least one of them. If this would be possible, then the argument in the proof of Proposition 4 would give that with \(\frac{3}{2}c_{3,3}\log n+o(\log n)\) 3-edge colorings of \(K_n\) one can totally multicolor all its \(P_4\)’s thus providing a strictly better upper bound than the trivial \(2c_{3,3}\log n+o(\log n)\).

In the following theorem we use a variation of an idea from [22] to give an explicit construction that provides another upper bound for p(n). Because of the lack of our knowledge of the value of \(c_{3,3}\), we do not know whether this upper bound is better or worse than the one provided by the previous proposition.

Theorem 2

$$\begin{aligned} p(n)\le 2\lceil \log _2 n\rceil . \end{aligned}$$

Proof

First we give \(\lceil \log _2 n\rceil \) 4-colorings of the edges of \(K_n\) with the property that any 4-element subset of the vertex set contains a \(P_4\) subgraph that is totally multicolored in at least one of them.

Label the n vertices with the binary form of the numbers \(0,1,\dots , n-1\) padded with 0’s at the beginning if necessary to make all these binary sequences having the same length \(t:=\lceil \log _2 n\rceil \). This way each vertex is attached a different \(0-1\) sequence of length t.

Let uv be two distinct vertices and \(u_i,v_i\) be the ith coordinate in the binary sequences attached to u and v, respectively. We define a coloring of edge uv for every \(1\le i\le t\) as follows. Color the edge \(\{u,v\}\)

  • blue if \(u_i=v_i=0,\)

  • green if \(u_i=v_i=1,\)

  • red if \(u_i\ne v_i\) and \(\forall j<i: u_j=v_j,\)

  • yellow if \(u_i\ne v_i\) and \(\exists j<i: u_j\ne v_j.\)

Consider any set of 4 vertices abcd. If there is any coordinate i where exactly two of \(a_i, b_i, c_i, d_i\) are 0 and two are 1, then we have two nonadjacent edges one of which is blue, while the other is green, and the remaining 4 edges of the \(K_4\) with vertices abcd are all red and yellow. So those \(P_4\)’s (there are 4 of them), that contain the blue and green edges are totally multicolored.

If there is no such coordinate where exactly two of these four sequences are 0, then there are at least three such coordinates where one of the values is different from the other three. Without loss of generality we may assume that \(a_i\ne b_i=c_i=d_i, b_j\ne a_j=c_j=d_j\), and \(c_h\ne a_h=b_h=d_h\), where we may also assume \(i<j<h\) and that these ijh are the smallest coordinates where the above relations hold. Then the coloring rule gives that in the jth coloring the edge \(\{a,b\}\) is yellow, \(\{b,c\}\) is red, and \(\{c,d\}\) is either blue or green, thus giving a totally multicolored \(P_4\). In fact, also the \(P_4\) with edges \(\{a,b\}, \{b,d\}, \{c,d\}\) is totally multicolored in the jth coloring, while two other \(P_4\)’s will be totally multicolored in the hth coloring, so altogether we can guarantee at least 4 different totally multicolored \(P_4\)’s on any given quadruple of vertices.

Since \(t(4,3,3)=2\) (just take the 2-length sequences 00, 01, 12, 22, any three of these are trifferent in at least one of the two coordinates), we can encode the 4 colors with two-length ternary sequences that make any three of them trifferent in at least one coordinate. Thus replacing each of the 4-colorings in the previous construction with two appropriate 3-colorings (just identifying the colors blue and green in one and the colors yellow and red in the other), we obtain \(2\lceil \log _2 n\rceil \) 3-edge colorings satisfying that for every 4 vertices some \(P_4\) on them is totally multicolored by at least one of these colorings. In fact, we have seen, that at least 4 out of the 12 \(P_4\)’s on any given four vertices will be rainbow at some coloring. \(\square \)

Naturally, a similar remark to that of Remark 3 above could be formulated concerning the coloring used in the proof of Theorem 2.

It should be clear from the proof of Theorem 2 that if we label the vertices of \(K_n\) with t-length binary sequences so, that for any four of them there is a coordinate where exactly two of these four sequences contain a 1, then \(p(n)\le t\). (We could simply use the same coloring strategy but identifying colors red and yellow.) Alon, Körner, and Monti [1] investigated the maximum number of binary sequences of some given length with this property. Their results give, that if \(\mu (n)\) is the minimum t for which n such t-length sequences can be given, then \(\frac{1}{0.78}\log _2 n+o(\log n)\le \mu (n)\le \frac{3}{\log _2\frac{8}{5}}\log _2 n+o(\log n)\approx 4.425\log _2 n+o(\log n)\). In a similar manner one can obtain an upper bound on the minimum number of 3-colorings needed to make every \(P_4\) totally multicolored in at least one of them if we use so-called (2, 2)-separated binary sequences that means a set of sequences with the property that for any two disjoint pairs of them, there is a coordinate where both sequences of the first pair contain a 0 and both sequences of the other pair contain a 1. The problem of maximum cardinality of such a set of binary sequences of some fixed length is considered, for example, in [15] and [21].

An immediate consequence of Proposition 4, Theorem 2, and the discussion in the previous paragraph is the following. Since we do not know whether \(c_{3,3}\) is smaller or larger than 4 (cf. the bounds quoted at the beginning of this section for \(c_{3,3}\)), and the value of \(\mu (n)\) is also unknown, we do not know which expression achieves the minimum in the statement.

Corollary 1

$$\begin{aligned} p(n)\le \min \left\{ 2\lceil \log _2 n\rceil , \frac{1}{2}c_{3,3}\log n+o(\log n), \mu (n)\right\} . \end{aligned}$$

\(\square \)

It is rather annoying that we do not even know whether \(p(n)=\Omega (\log n)\) is true. Since \(p(n)\ge \log _3 a(n,P_4)\) and \(a(n,P_4)\ge f(n,4,3)\), this would immediately follow if we knew a lower bound \(f(n,4,3)\ge n^{\varepsilon }\) for any constant \(\varepsilon >0\). This is, however, not known, in fact, the behavior of f(n, 4, 3) is mentioned as a most annoying open problem in [13], where a \(c\sqrt{n}\) upper bound is given for it, while the authors also mention that they could not even prove that \(\frac{f(n,4,3)}{\log n}\) tends to infinity.

3.2 Bicoloring the Triangle and Shannon Capacity

It is rather trivial to see that if we want to two-color only certain subgraphs in several rounds then the problem of determining the minimum number of rounds is equivalent to some of those problems discussed in Sect. 2, in particular in determining the value b(nF). Indeed, if we can use a fixed number b of colors in several rounds and we want that each subgraph F gets at least two colors in at least one of the rounds, then the minimum number of rounds needed is exactly \(\lceil \log _b b(n,F)\rceil \).

Propositions 1 and 2 show that in case of \(F=K_{1,3}\) and \(F=P_4\) we have \(\log b(n,F)=\varTheta (\log n)\). The situation is rather different, however, for \(F=K_3\), because \(b(n,K_3)=\min \{k: R(3;k)>n\}\) and the growth rate of R(3; k) is at least exponential in k. This means that the minimum number of colorings (even with two colors) making every triangle bicolored in at least one of them is bounded from above by \(O(\log \log n)\). On the other hand, it is not known, whether the growth rate of R(3; k) is exponential or even faster in k. This is a famous open problem of Erdős, who, according to [8] (see Chapter 2.5) offered $250 for determining the limit \(\lim _{k\rightarrow \infty }R(3;k)^{1/k}\) and $100 for deciding whether it is finite. (The best lower bound on this limit I know about is 3.199 given in [32].) This question is well-known to be equivalent to a question about Shannon capacity, cf. [2, 14, 27].

Definition 3

Let G and H be two graphs. Their OR-product \(G\otimes H\) is defined as follows.

$$\begin{aligned} V(G\otimes H)=V(G)\times V(H) \end{aligned}$$

and

$$\begin{aligned} E(G\otimes H)=\{\{(g_1,h_1).(g_2,h_2)\}: (g_1,g_2)\in E(G) {\mathrm{or}} (h_1,h_2)\in E(H)\}. \end{aligned}$$

\(G^t\) denotes the t-fold OR-product of graph G with itself.

Definition 4

The Shannon OR-capacity of graph G is defined as the always existing limit

$$\begin{aligned} C_{\mathrm{OR}}(G)=\lim _{t\rightarrow \infty }\root t \of {\omega (G^t)}, \end{aligned}$$

where \(\omega \) stands for the clique number.

Shannon capacity is most often defined by another graph product (the so called AND-product) and via independence numbers, see [24, 30], but the two notions are essentially the same as the Shannon OR-capacity of a graph G we defined here is simply the more usual Shannon capacity (the “Shannon AND-capacity”) of the complementary graph \({\bar{G}}\). We use this less often used version because certain statements are more natural in this language and it is more convenient for our goals. (This approach also appears in several papers, cf. for example [16, 29].) It is well-known that \(\omega (G)\le C_{\mathrm{OR}}(G)\le \chi (G)\), where \(\chi (G)\) is the chromatic number of G. In general, Shannon (OR)-capacity is very hard to determine, the only odd cycle longer than 3 for which it is known is \(C_5\), and the determination of \(C_{\mathrm{OR}}(C_5)\) was a major result of Lovász [24]. It was also a sort of breakthrough when Bohman and Holzman [6] proved with an ingenious construction that the Shannon OR-capacity of every odd cycle is strictly larger than its trivial lower bound 2, i.e., \(C_{\mathrm{OR}}(C_{2k+1})>2\) for every positive integer k. Erdős, McEliece, and Taylor [14] (and independently but later Alon and Orlitsky [2], cf. also [27]) showed, that the supremum of the possible Shannon OR-capacities a triangle-free graph can have is equal to \(\lim _{k\rightarrow \infty }\root k \of {R(3;k)}\). That is, Erdős’s question whether this limit is infinite is equivalent to the question, whether a triangle-free graph can have arbitrarily large Shannon OR-capacity. Based on a nice observation by Cropper, Gyárfás, and Lehel [9] we claim that to decide this, it would be enough to know the Shannon OR-capacity of the well-known Mycielski graphs [26] that we define below.

Definition 5

For any graph G on vertex set \(\{v_1,\dots ,v_n\}\) its Mycielskian M(G) is defined as follows.

$$\begin{aligned} V(M(G))= & {} V(G)\cup \{u_i: v_i\in V(G)\}\cup \{z\}, \\ E(M(G))= & {} E(G)\cup \{\{u_i,v_j\}: \{v_i,v_j\}\in E(G)\}\cup \{\{u_i,z\}: v_i\in V(G)\}. \end{aligned}$$

By the kth Mycielski graph \(M_k\) we mean the result of the \((k-2)\)th iteration of the operation M(.) defined above when starting with \(M_2:=K_2\). The vertex \(u_i\) we refer to as the twin vertex of \(v_i\).

We index \(M_k\) as defined here, because as is well-known, the Mycielski construction increases the chromatic number by 1 (while not changing the clique number) and this way \(M_k\) denotes the k-chromatic Mycielski graph. Note that \(M_3\) is just \(C_5\) and \(M_4\) is the graph also called Grötzsch graph.

Theorem 3

$$\begin{aligned} \lim _{k\rightarrow \infty }\root k \of {R(3;k)}=\lim _{r\rightarrow \infty }C_{\mathrm{OR}}(M_r). \end{aligned}$$

Proof

By the result of Erdős-McEliece-Taylor [14] and Alon-Orlitsky [2] already quoted above we know that

$$\begin{aligned} \lim _{k\rightarrow \infty }\root k \of {R(3;k)}=\sup \{C_{\mathrm{OR}}(G): G\ \mathrm{contains\ no\ triangle}\}. \end{aligned}$$

Cropper, Gyárfás, and Lehel [9] observed that every triangle-free graph is an induced subgraph of \(M_r\) if r is large enough. Since \(C_{\mathrm{OR}}(G)\) is obviously monotone in the sense that \(F\subseteq G\) implies \(C_{\mathrm{OR}}(F)\le C_{\mathrm{OR}}(G)\) and the graphs \(M_r\) are triangle-free themselves, we have that

$$\begin{aligned} \sup \{C_{\mathrm{OR}}(G): G \;{\mathrm{contains\ no\ triangle}}\}=\lim _{r\rightarrow \infty }C_{\mathrm{OR}}(M_r) \end{aligned}$$

and thus the statement of the theorem. (Note that the existence of the limit follows from \(M_{r-1}\subseteq M_r\) and thus \(C_{\mathrm{OR}}(M_r)\ge C_{\mathrm{OR}}(M_{r-1})\) being true for every r.) \(\square \)

We do not know how to show that the Shannon OR-capacity of Mycielski graphs does or does not go to infinity. As a modest step forward we give a lower bound on the Shannon OR-capacity of the Grötzsch graph that is strictly larger than \(C_\mathrm{OR}(C_5)=\sqrt{5}\), i.e, the Shannon OR-capacity of the previous Mycielski graph.

Theorem 4

$$\begin{aligned} C_{\mathrm{OR}}(M_4)\ge \root 4 \of {28}. \end{aligned}$$

Proof

As \(C_{\mathrm{OR}}(G)\ge \root t \of {\omega (G^t)}\) for any finite t, it is enough to present a clique of size 28 in the 4th OR-power of the Grötzsch graph \(M_4=M(C_5)\). This is what we do. We denote the vertices of \(C_5\) by 0, 1, 2, 3, 4, where every vertex is connected to the vertices labeled by neighboring integers, plus \(\{0,4\}\) is also an edge. The corresponding twin vertices (cf. Definition 5) are labeled \(0',1',2',3',4'\), respectively, and the eleventh vertex of \(M(C_5)\) is labeled z as in Definition 5.

We claim that the following 28 vertices form a clique in \([M(C_5)]^4\). Indeed, it is enough to observe, that the 25 vertices listed in the first five rows below are created from Shannon’s well-known 5-element clique of \(C_5^2\) in [30] given as 00, 12, 24, 31, 43 by taking its second power and then “lifting” some vertices to their twins in such a way that at least one connection still remained between any two of our sequences. All sequences except five have a lifted element in the last two coordinates and for the five exceptional ones (see them put diagonally) both of the first two coordinates are lifted. Thus all these sequences will be connected with the three in the last row that are also connected to each other.

$$\begin{aligned} \begin{array}{lllll} 0'0'00&{}\quad 120'0&{}\quad 2400'&{}\quad 3100'&{}\quad 430'0\\ 001'2&{}\quad 1'2'12&{}\quad 241'2&{}\quad 3112'&{}\quad 4312'\\ 0024'&{}\quad 122'4&{}\quad 2'4'24&{}\quad 312'4&{}\quad 4324'\\ 0031'&{}\quad 1231'&{}\quad 243'1&{}\quad 3'1'31&{}\quad 433'1\\ 004'3&{}\quad 1243'&{}\quad 2443'&{}\quad 314'3&{}\quad 4'3'43\\ &{}\quad 0'zzz&{}\quad z0'zz&{}\quad zzzz&{}\\ \end{array} \end{aligned}$$

Thus we have \(\omega ([M(C_5)]^4)\ge 28\) and the statement follows. \(\square \)