Rainbow coloring

From HandWiki
Short description: Path on an edge-colored graph over which no color repeats
Rainbow coloring of a wheel graph, with three colors. Every two non-adjacent vertices can be connected by a rainbow path, either directly through the center vertex (bottom left) or by detouring around one triangle to avoid a repeated edge color (bottom right).

In graph theory, a path in an edge-colored graph is said to be rainbow if no color repeats on it. A graph is said to be rainbow-connected (or rainbow colored) if there is a rainbow path between each pair of its vertices. If there is a rainbow shortest path between each pair of vertices, the graph is said to be strongly rainbow-connected (or strongly rainbow colored).[1]

Definitions and bounds

The rainbow connection number of a graph G is the minimum number of colors needed to rainbow-connect G, and is denoted by rc(G). Similarly, the strong rainbow connection number of a graph G is the minimum number of colors needed to strongly rainbow-connect G, and is denoted by src(G). Clearly, each strong rainbow coloring is also a rainbow coloring, while the converse is not true in general.

It is easy to observe that to rainbow-connect any connected graph G, we need at least diam(G) colors, where diam(G) is the diameter of G (i.e. the length of the longest shortest path). On the other hand, we can never use more than m colors, where m denotes the number of edges in G. Finally, because each strongly rainbow-connected graph is rainbow-connected, we have that diam(G)≤rc(G)≤src(G)≤m.

The following are the extremal cases:[1]

  • rc(G)=src(G)=1 if and only if G is a complete graph.
  • rc(G)=src(G)=m if and only if G is a tree.

The above shows that in terms of the number of vertices, the upper bound rc(G)≤n−1 is the best possible in general. In fact, a rainbow coloring using n−1 colors can be constructed by coloring the edges of a spanning tree of G in distinct colors. The remaining uncolored edges are colored arbitrarily, without introducing new colors. When G is 2-connected, we have that rc(G)≤⌈n/2⌉.[2] Moreover, this is tight as witnessed by e.g. odd cycles. For every bridgeless graph G with radius r, rc(G)≤r(r+2).[3]

The very strong rainbow connection number (vsrc(G)) is the minimum number of colors required to color the edges of a graph G such that every shortest path between any two vertices is a rainbow path. While approximating vsrc(G) for a general graph G is an NP-hard problem, it can be solved in polynomial time for certain graph classes, such as cactus graphs.[4]

Exact rainbow or strong rainbow connection numbers

The rainbow or the strong rainbow connection number has been determined for some structured graph classes:

  • rc(Cn)=src(Cn)=⌈n/2⌉, for each integer n≥4, where Cn is the cycle graph.[1]
  • rc(Wn)=3, for each integer n≥7, and src(Wn)=⌈n/3⌉, for n≥3, where Wn is the wheel graph.[1]

Complexity

The problem of deciding whether rc(G)=2 for a given graph G is NP-complete.[5] Because rc(G)=2 if and only if src(G)=2,[1] it follows that deciding if src(G)=2 is NP-complete for a given graph G.

Variants and generalizations

Chartrand, Okamoto and Zhang[6] generalized the rainbow connection number as follows. Let G be an edge-colored nontrivial connected graph of order n. A tree T is a rainbow tree if no two edges of T are assigned the same color. Let k be a fixed integer with 2≤k≤n. An edge coloring of G is called a k-rainbow coloring if for every set S of k vertices of G, there is a rainbow tree in G containing the vertices of S. The k-rainbow index rxk(G) of G is the minimum number of colors needed in a k-rainbow coloring of G. A k-rainbow coloring using rxk(G) colors is called a minimum k-rainbow coloring. Thus rx2(G) is the rainbow connection number of G.

Rainbow connection has also been studied in vertex-colored graphs. This concept was introduced by Krivelevich and Yuster.[7] Here, the rainbow vertex-connection number of a graph G, denoted by rvc(G), is the minimum number of colors needed to color G such that for each pair of vertices, there is a path connecting them whose internal vertices are assigned distinct colors.

See also

Notes

  1. ↑ 1.0 1.1 1.2 1.3 1.4 Chartrand et al. (2008).
  2. ↑ Ekstein et al. (2013).
  3. ↑ Basavaraju, M.; Chandran, L. S.; Rajendraprasad, D.; Ramaswamy, A. (2014). "Rainbow connection number and radius". Graphs and Combinatorics 30 (2): 275-285. 
  4. ↑ Chandran, L. S.; Das, A.; Issac, D. (2025). "Algorithms and Bounds for Very Strong Rainbow Coloring". Bulletin of the Malaysian Mathematical Sciences Society 48: 96. doi:10.1007/s40840-025-01876-8. 
  5. ↑ Chakraborty et al. (2011).
  6. ↑ Chartrand, Okamoto & Zhang (2010).
  7. ↑ Krivelevich & Yuster (2010).

References

  • "Rainbow connection in graphs", Mathematica Bohemica 133 (1): 85–98, 2008, doi:10.21136/MB.2008.133947 .
  • "Rainbow trees in graphs and generalized connectivity", Networks 55 (4): NA, 2010, doi:10.1002/net.20339 .
  • Chakraborty, Sourav; Fischer, Eldar; Matsliah, Arie (2011), "Hardness and algorithms for rainbow connection", Journal of Combinatorial Optimization 21 (3): 330–347, doi:10.1007/s10878-009-9250-9 .
  • "The Rainbow Connection of a Graph Is (at Most) Reciprocal to Its Minimum Degree", Journal of Graph Theory 63 (3): 185–191, 2010, doi:10.1002/jgt.20418 .
  • Li, Xueliang; Shi, Yongtang; Sun, Yuefang (2013), "Rainbow Connections of Graphs: A Survey", Graphs and Combinatorics 29 (1): 1–38, doi:10.1007/s00373-012-1243-2 .
  • Li, Xueliang; Sun, Yuefang (2012), Rainbow connections of graphs, Springer, p. 103, ISBN 978-1-4614-3119-0 .
  • Ekstein, Jan; Holub, Přemysl; Kaiser, Tomáš; Koch, Maria; Camacho, Stephan Matos; Ryjáček, Zdeněk; Schiermeyer, Ingo (2013), "The rainbow connection number of 2-connected graphs", Discrete Mathematics 313 (19): 1884–1892, doi:10.1016/j.disc.2012.04.022 .