Parameterized complexity of happy coloring problems

Akanksha Agrawal, N. R. Aravind, Subrahmanyam Kalyanasundaram, Anjeneya Swami Kare, Juho Lauri, Neeldhara Misra, I. Vinod Reddy

Research output: Contribution to journalArticlepeer-review

4 Scopus citations


In a vertex-colored graph, an edge is happy if its endpoints have the same color. Similarly, a vertex is happy if all its incident edges are happy. Motivated by the computation of homophily in social networks, we consider the algorithmic aspects of the following MAXIMUM HAPPY EDGES ( k-MHE ) problem: given a partially k-colored graph G and an integer ℓ, find an extended full k-coloring of G making at least ℓ edges happy. When we want to make ℓ vertices happy on the same input, the problem is known as MAXIMUM HAPPY VERTICES ( k-MHV ). We perform an extensive study into the complexity of the problems, particularly from a parameterized viewpoint. For every k≥3, we prove both problems can be solved in time 2nnO(1). Moreover, by combining this result with a linear vertex kernel of size (k+ℓ) for k-MHE, we show that the edge-variant can be solved in time 2nO(1). In contrast, we prove that the vertex-variant remains W[1]-hard for the natural parameter ℓ. However, the problem does admit a kernel with O(k22) vertices for the combined parameter k+ℓ. From a structural perspective, we show both problems are fixed-parameter tractable for treewidth and neighborhood diversity, which can both be seen as sparsity and density measures of a graph. Finally, we extend the known [Formula presented]-completeness results of the problems by showing they remain hard on bipartite graphs and split graphs. On the positive side, we show the vertex-variant can be solved optimally in polynomial-time for cographs.

Original languageEnglish
Pages (from-to)58-81
Number of pages24
JournalTheoretical Computer Science
StatePublished - 2 Oct 2020


  • Computational complexity
  • Happy coloring
  • Parameterized complexity

ASJC Scopus subject areas

  • Theoretical Computer Science
  • General Computer Science


Dive into the research topics of 'Parameterized complexity of happy coloring problems'. Together they form a unique fingerprint.

Cite this