Abstract

Let G be a graph, and \(c: V(G) \rightarrow [k]\) be a coloring of vertices in G. A vertex \(u \in V(G)\) is happy with respect to c if for all \(v \in N_G(u)\), we have \(c(u)=c(v)\), i.e. all the neighbors of u have color same as that of u. The problem Maximum Happy Vertices takes as an input a graph G, an integer k, a vertex subset \(S \subseteq V(G)\), and a (partial) coloring \(c: S \rightarrow [k]\) of vertices in S. The goal is to find a coloring \(\tilde{c}: V(G) \rightarrow [k]\) such that \(\tilde{c}|_S=c\), i.e. \(\tilde{c}\) extends the partial coloring c to a coloring of vertices in G and the number of happy vertices in G is maximized. For the family of trees, Aravind et al. [1] gave a linear time algorithm for Maximum Happy Vertices for every fixed k, along with the edge variant of the problem. As an open problem, they stated whether Maximum Happy Vertices admits a linear time algorithm on graphs of bounded (constant) treewidth for every fixed k. In this paper, we study the problem Maximum Happy Vertices for graphs of bounded treewidth and give a linear time algorithm for every fixed k and (constant) treewidth of the graph. We also study the problem Maximum Happy Vertices with a different parameterization, which we call Happy Vertex Coloring. The problem Happy Vertex Coloring takes as an input a graph G, integers \(\ell \) and k, a vertex subset \(S \subseteq V(G)\), and a coloring \(c: S \rightarrow [k]\). The goal is to decide if there exist a coloring \(\tilde{c}: V(G) \rightarrow [k]\) such that \(\tilde{c}|_S=c\) and \(|H| \ge \ell \), where H is the set of happy vertices in G with respect to \(\tilde{c}\). We show that Happy Vertex Coloring is W[1]-hard when parameterized by \(\ell \). We also give a kernel for Happy Vertex Coloring with \(\mathcal {O}(k^2\ell ^2)\) vertices.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call