On the Complexity of Rainbow Coloring Problems

  • Eduard Eiben
  • Robert Ganian
  • Juho Lauri
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9538)


An edge-colored graph G is said to be rainbow connected if between each pair of vertices there exists a path which uses each color at most once. The rainbow connection number, denoted by \({{\mathrm{rc}}}(G)\), is the minimum number of colors needed to make G rainbow connected. Along with its variants, which consider vertex colorings and/or so-called strong colorings, the rainbow connection number has been studied from both the algorithmic and graph-theoretic points of view.

In this paper we present a range of new results on the computational complexity of computing the four major variants of the rainbow connection number. In particular, we prove that the Strong Rainbow Vertex Coloring problem is \(\textsf {NP}\)-complete even on graphs of diameter 3. We show that when the number of colors is fixed, then all of the considered problems can be solved in linear time on graphs of bounded treewidth. Moreover, we provide a linear-time algorithm which decides whether it is possible to obtain a rainbow coloring by saving a fixed number of colors from a trivial upper bound. Finally, we give a linear-time algorithm for computing the exact rainbow connection numbers for three variants of the problem on graphs of bounded vertex cover number.


  1. 1.
    Ananth, P., Nasre, M., Sarpatwar, K.K.: Rainbow connectivity: hardness and tractability. In: FSTTCS 2011, pp. 241–251 (2011)Google Scholar
  2. 2.
    Bodlaender, H.: On linear time minor tests with depth-first search. J. Algorithms 14(1), 1–23 (1993)CrossRefMathSciNetzbMATHGoogle Scholar
  3. 3.
    Bodlaender, H.L., Kloks, T.: Efficient and constructive algorithms for the pathwidth and treewidth of graphs. J. Algorithms 21(2), 358–402 (1996)CrossRefMathSciNetzbMATHGoogle Scholar
  4. 4.
    Chakraborty, S., Fischer, E., Matsliah, A., Yuster, R.: Hardness and algorithms for rainbow connection. J. Comb. Optimizat. 21(3), 330–347 (2009)CrossRefMathSciNetGoogle Scholar
  5. 5.
    Chandran, L.S., Rajendraprasad, D.: Rainbow colouring of split and threshold graphs. In: Gudmundsson, J., Mestre, J., Viglas, T. (eds.) COCOON 2012. LNCS, vol. 7434, pp. 181–192. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  6. 6.
    Chandran, L.S., Rajendraprasad, D.: Inapproximability of rainbow colouring. In: FSTTCS 2013, pp. 153–162 (2013)Google Scholar
  7. 7.
    Chartrand, G., Johns, G., McKeon, K., Zhang, P.: Rainbow connection in graphs. Mathematica Bohemica 133(1), 85–98 (2008)MathSciNetzbMATHGoogle Scholar
  8. 8.
    Chartrand, G., Zhang, P.: Chromatic Graph Theory. CRC Press, Boca Raton (2008)CrossRefGoogle Scholar
  9. 9.
    Chen, L., Li, X., Lian, H.: Further hardness results on the rainbow vertex-connection number of graphs. Theoret. Comput. Sci. 481, 18–23 (2013)CrossRefMathSciNetzbMATHGoogle Scholar
  10. 10.
    Chen, L., Li, X., Shi, Y.: The complexity of determining the rainbow vertex-connection of a graph. Theoret. Comput. Sci. 412(35), 4531–4535 (2011)CrossRefMathSciNetzbMATHGoogle Scholar
  11. 11.
    Courcelle, B.: The monadic second-order logic of graphs I. Recognizable sets of finite graphs. Inf. Comput. 85, 12–75 (1990)CrossRefMathSciNetzbMATHGoogle Scholar
  12. 12.
    Courcelle, B., Makowsky, J.A., Rotics, U.: Linear time solvable optimization problems on graphs of bounded clique-width. Theory Comput. Syst. 33(2), 125–150 (2000)CrossRefMathSciNetzbMATHGoogle Scholar
  13. 13.
    Diestel, R.: Graph Theory. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  14. 14.
    Downey, R.G., Fellows, M.R.: Fundamentals of Parameterized Complexity. Springer, London (2013)CrossRefzbMATHGoogle Scholar
  15. 15.
    Ganian, R., Hliněný, P.: On parse trees and Myhill-Nerode-type tools for handling graphs of bounded rank-width. Discrete App. Math. 158(7), 851–867 (2010)CrossRefzbMATHGoogle Scholar
  16. 16.
    Gottlob, G., Lee, S.T.: A logical approach to multicut problems. Inf. Process. Lett. 103(4), 136–141 (2007)CrossRefMathSciNetzbMATHGoogle Scholar
  17. 17.
    Keranen, M., Lauri, J.: Computing minimum rainbow, strong rainbow colorings of block graphs. Preprint available on arXiv:1405.6893 (2014)
  18. 18.
    Krivelevich, M., Yuster, R.: The rainbow connection of a graph is (at most) reciprocal to its minimum degree. J. Graph Theory 63(3), 185–191 (2010)MathSciNetzbMATHGoogle Scholar
  19. 19.
    Lauri, J.: Further hardness results for rainbow and strong rainbow connectivity. Discrete Appl. Math. (to appear)Google Scholar
  20. 20.
    Li, X., Mao, Y., Shi, Y.: The strong rainbow vertex-connection of graphs. Utilitas Mathematica 93, 213–223 (2014)MathSciNetzbMATHGoogle Scholar
  21. 21.
    Li, X., Shi, Y., Sun, Y.: Rainbow connections of graphs: a survey. Graphs Comb. 29(1), 1–38 (2012)CrossRefMathSciNetzbMATHGoogle Scholar
  22. 22.
    Li, X., Sun, Y.: Rainbow Connections of Graphs. Springer, New York (2012)CrossRefzbMATHGoogle Scholar
  23. 23.
    Robertson, N., Seymour, P.: Graph minors. II. Algorithmic aspects of tree-width. J. Algorithms 7(3), 309–322 (1986)CrossRefMathSciNetzbMATHGoogle Scholar
  24. 24.
    Chandran, L.S., Das, A., Rajendraprasad, D., Varma, N.M.: Rainbow connection number, connected dominating sets. J. Graph Theory 71(2), 206–218 (2012)CrossRefMathSciNetzbMATHGoogle Scholar
  25. 25.
    Uchizawa, K., Aoki, T., Ito, T., Suzuki, A., Zhou, X.: On the rainbow connectivity of graphs: complexity and FPT algorithms. Algorithmica 67(2), 161–179 (2013)CrossRefMathSciNetzbMATHGoogle Scholar
  26. 26.
    Zuckerman, D.: Linear degree extractors and the inapproximability of max clique and chromatic umber. In: STOC 2006, pp. 681–690 (2006)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.TU WienViennaAustria
  2. 2.Tampere University of TechnologyTampereFinland

Personalised recommendations