Reducing Graph Parameters by Contractions and Deletions

We consider the following problem: for a given graph $G$ and two integers $k$ and $d$, can we apply a fixed graph operation at most $k$ times in order to reduce a given graph parameter $\pi$ by at least $d$? We show that this problem is NP-hard when the parameter is the independence number and the graph operation is vertex deletion or edge contraction, even for fixed $d=1$ and when restricted to chordal graphs. We give a polynomial time algorithm for bipartite graphs when the operation is edge contraction, the parameter is the independence number and $d$ is fixed. Further, we complete the complexity dichotomy on $H$-free graphs when the parameter is the clique number and the operation is edge contraction by showing that this problem is NP-hard in $(C_3+P_1)$-free graphs even for fixed $d=1$. When the operation is edge deletion and the parameter is the chromatic number, we determine the computational complexity of the associated problem on cographs and complete multipartite graphs. Our results answer several open questions stated in [Diner et al., Theoretical Computer Science, 746, p. 49-72 (2012)].


Introduction
Blocker problems are a type of graph modification problems which are characterised by a set O of graph modification operations (for example vertex deletion or edge contraction), a graph parameter π and an integer threshold d ≥ 1.The aim of the problem is to determine, for a given graph G, the smallest sequence of operations from O which transforms G into a graph As in the case of regular graph modification problems, we often consider a set of operations consisting each of a single graph operation, typically vertex deletion, edge contraction, edge addition or edge deletion.Amongst the parameters which have been studied are the chromatic number χ (see [16]), the matching number µ (see [18]), the length of a longest path (see [5,14]), the (total or semitotal) domination number γ (γ t and γ t2 , respectively) (see [9][10][11]), the clique number ω (see [15]) and the independence number α (see [3]).
In this paper, the set of allowed graph operations will always consist of only one operation, either vertex deletion, edge contraction or edge deletion.Given Table 1: The table of complexities for some graph classes.Here, P means solvable in polynomial time, whereas NP-h and NP-c mean NP-hard and NP-complete, respectively.A question mark means that the case is open.Everything in bold are new results from this paper, all other cases are referenced in [8], where an older version of this table is given for every H except H = C 3 + P 1 .We show that this case is NP-hard even when d = 1 and complete hence the dichotomy.For the problem Edge Deletion Blocker(χ), the authors of [8] observe that the complexity of the problem is known for H-free graphs for all H except H = P 4 and H = P 2 + P 1 .We show that Edge Deletion Blocker(χ) is NP-complete on (P 1 + P 2 )-free graphs (and thus, for P 4 -free graphs as well).For P 4 -free graphs, we show that the problem is solvable in polynomial time when the difference between d and the chromatic number of the input graph is bounded.We can also solve d-Edge Deletion Blocker(χ) on P 4 -free graphs in polynomial time for any fixed d.

Preliminaries
Throughout this paper, we assume that all graphs are connected unless stated differently.
We refer the reader to [7] for any terminology not defined here.
For any natural number n, we denote by [n] the set {1, . . ., n} and by [0..n] the set {0, . . ., n}.For a graph G we denote by V (G) the vertex set of the graph and by E(G) its edge set.For two graphs G and H we denote by G + H the disjoint union of G and H.For two graphs G and H with disjoint vertex sets, we denote by G × H the graph with vertex set V (G) ∪ V (H) and edge set E(G) ∪ E(H) ∪ {uv|u ∈ V (G), v ∈ V (H)}.For two vertices u, v ∈ V (G), we denote by dist G (u, v) the distance between u and v, which is the number of edges in a shortest path between u and v.For two sets of vertices U, W ⊆ V (G), the distance between U and W , denoted by dist G (U, W ), is given by min u∈U,w∈W dist G (u, w).For a set of edges S ⊆ E(G) we denote by V (S) the set of vertices in V (G) which are endpoints of at least one edge of S. Let v ∈ V (G), then the (open) neighbourhood of v, denoted by N G (v), is the set {u ∈ V (G) : dist G (u, v) = 1}.The closed neighbourhood of v, denoted by N G [v], is the set N G (v) ∪ {v}.For a set U ⊆ V (G), we define the (open) neighbourhood of U as N G (U ) = v∈U N (v) and the closed neighbourhood of U as N G [U ] = N G (U ) ∪ U .If the graph G is clear from the context, we can omit the index.For a vertex v ∈ V (G) and a set of vertices U ⊆ V (G), we say that v is complete to U if v is adjacent to every vertex of U .Let G be a graph and S ⊆ E(G).We denote by G S the graph whose vertex set is V (G) and whose edge set is S.For any U ⊆ V (G), we denote by G[U ] the subgraph of G induced by U .For any U ⊆ V (G), we denote by G − U the graph G[V (G) \ U ].For any vertex v ∈ V (G), we denote by G − v the graph G − {v}.
Let S ⊆ E(G).We denote by G − S the graph with vertex set V (G) and edge set E(G) \ S. Further, we denote by G/S the graph whose vertices are in one-toone correspondence to the connected components of G S and two vertices u, v ∈ V (G/S) are adjacent if and only if their corresponding connected components A, B of G S satisfy dist G (V (A), V (B)) = 1.This is equivalent to the regular notion of contracting the edges in S.However, this definition allows us to make the notation in the proofs simpler and less confusing.
An h-colouring of G is a map from V (G) to [h].For an h-colouring c of G and a set U ⊆ V (G), we denote by c(U ) the set v∈U c(v).
We say that a set I ⊆ V (G) is independent if the vertices contained in it are pairwise non-adjacent.We denote by α(G) the size of a maximum independent set in G.The decision problem Independent Set takes as input a graph G and an integer k and outputs Yes if and only if there is an independent set of size at least k in G.We say that a set U ⊆ V (G) is a clique if every two vertices in U are adjacent.We denote by ω(G) the size of a maximum clique in G.We call a set U ⊆ V (G) a vertex cover, if for every edge uv ∈ E(G) we have that u ∈ U or v ∈ U .The decision problem Vertex Cover takes as input a graph G and an integer k and outputs Yes if and only if there is a vertex cover of size at most k in G.We denote by τ (G) the size of a minimum vertex cover in G. Furthermore, we call a graph M a matching of a graph and each vertex in M has exactly one neighbour in M .We say that a matching is a maximum matching if it contains the maximum possible number of edges and denote this number by µ(G).Observe that we did not use the standard definition of a matching as a set of non-adjacent edges.This was done in order to simplify the notation in the proofs.However, the edge set of a matching in our definition follows the conventional definition.
A graph without cycles is called a forest and a connected forest is a tree.It is well-known that a tree has one more vertex than it has edges.Let T be a tree.We call a vertex of T a leaf if it has exactly one neighbour.A vertex which is not a leaf is called an interior vertex of T .A tree T is called rooted if there is a designated vertex called the root of T .The children of a vertex v ∈ T are those neighbours of v whose distance to the root s is larger than dist(v, s).A rooted binary tree is a rooted tree in which every interior vertex has exactly two children.A graph is said to be chordal, if it has no induced cycle of length at least four.A graph G is bipartite, if we can find a partition of the vertices into two sets V (G) = U ∪ W such that U and W are both independent sets.For a given graph H, we say that the graph G is H-free, if it does not contain H as an induced subgraph.
A graph G is called complete multipartite, if we can partition the vertex set V (G) into disjoint independent sets I 1 , . . ., I ℓ and G is isomorphic to We call the independent sets I 1 , . . ., I ℓ the parts of G.It is well known that complete multipartite graphs are exactly the (P 2 + P 1 )-free graphs.
A graph G is called a cograph if one of the following conditions holds: A graph is a cograph if and only if it is P 4 -free ( [6]).
Let T be a rooted binary tree with root s whose interior (or non-leaf) vertices are labelled either 0 or 1.We call the vertices of T nodes and the interior vertices 0-or 1-node, according to their label.To every node p of T we associate a cograph T p as follows: if p is a leaf, then T p = K 1 , -if p is a 0-node with children q and r, then T p = T q + T r , -if p is a 1-node with children q and r, then T p = T q × T r .
If T s is isomorphic to a cograph G, then we say that T is a cotree corresponding to G.For a node p ∈ V (T ), we denote by T p the vertex set V (G) \ V (T p ).It was shown in [4] that every cograph has a corresponding cotree.Let p be a node of a cograph T with children q and r.It is easy to see that χ(T p ) = max {χ(T q ), χ(T r )} if p is a 0-node and χ(T p ) = χ(T q ) + χ(T r ) if p is a 1-node.
For a positive integer i, we denote by P i and C i the path and the cycle on i vertices, respectively.We call the graph which is given in Figure 1 a paw.
We will use the following two results.The first one is due to Kőnig, the second one is well-known and easy to see.
Lemma 2. Let G be a graph and let I ⊆ V (G) be a maximum independent set.Then V (G) \ I is a minimum vertex cover and hence τ In [17] it was shown that Independent Set is NP-complete in C 3 -free graphs.This and Lemma 2 imply the following corollary.
Corollary 1. Vertex Cover is NP-complete in C 3 -free graphs.

Algorithms
In this section we give a polynomial-time algorithm for d-Contraction Blocker(α) in bipartite graphs.
Proof.Let G be a bipartite graph with |V (G)| ≥ 2d+2 and α(G) ≥ d+1.Let M be a maximum matching of G. Since G is connected, M is non-empty.Consider the following algorithm which constructs a tree T , which is a subgraph of G.

Algorithm 1
Input: A bipartite graph G, a maximum matching M in G, an integer d ≥ 1 Output: A tree T Choose an arbitrary edge uu ′ ∈ E(M ).
Choose two vertices w ∈ N G (T ) \ V (T ), and We claim that the resulting graph T is a tree.Indeed, the initial graph is a single edge and thus a tree.Further, observe that every time there are vertices and edges added to T in lines 7 or 8, the resulting graph remains connected and the number of added vertices and added edges is the same.It follows that T is connected and has exactly one more vertex than it has edges and is thus a tree.It is easy to see that T has 2d or 2d + 1 edges.
We consider the graph G ′ = G−V (T ).For every v ∈ V (M )∩V (T ) the unique vertex u ∈ V (M ) with uv ∈ E(M ) is also contained in V (T ) and uv ∈ E(T ).Thus, there are at most |V (T )| 2 edges in E(M ) which have an endvertex in T .
Applying Lemma 1 and Lemma 2, we get for the independence number of G ′ : Let G * = G/E(T ).Observe that G E(T ) contains exactly one connected component, say A, which has more than one vertex, namely the connected component corresponding to Let β = 0. Let G ′ = G/S.

4:
end if end for 10: end if end for 14: return No Theorem 2. d-Contraction Blocker(α) is solvable in polynomial time in bipartite graphs.
Proof.Let G be a bipartite graph and k a positive integer.If |V (G)| ≤ 2d + 1 there are at most 2 d(d+1) subsets of E(G) and at most 2 2d+1 subsets of V (G).We can check for every subset S ⊆ E(G) if α(G/S) ≤ α(G) − d in constant time by computing the graph G/S and checking for each subset of V (G/S) if it is independent.Thus, we can check in constant time if G is a Yes-instance for d-Contraction Blocker(α).
Since contracting edges in a non-empty graph cannot reduce the number of vertices to zero, it follows that if α(G) ≤ d it is not possible to reduce α(G) by d via edge-contractions.Hence, we can assume that |V (G)| ≥ 2d + 2 and α(G) ≥ d + 1.By Theorem 1, we know that for k ≥ 2d + 1, it is always possible to contract at most k edges to reduce the independence number of G by at least d, so we can further assume that k ≤ 2d.
Consider now Algorithm 2 which takes as input G, k and d and outputs Yes or No. Algorithm 2 considers every subset S ⊆ E(G) of edges of cardinality at most k and computes α(G/S).If there is some S such that α(G/S) ≤ α(G) − d then we return Yes, and No otherwise.In order to compute α(G/S) for such a subset S of edges, we first set G ′ = G/S and consider the set of vertices U ⊆ V (G ′ ) which have been formed by contracting some edges in S (see line 4 of the algorithm).Observe that . Thus, we can find the independence number of G ′ by considering every independent subset U ′ of U and computing α( ) can be computed in polynomial time, see Lemma 2 and [1].
The number of subsets of E(G) of cardinality at most ).For any such subset S, the number of subsets U ′ ⊆ U is at most 2 k ≤ 2 2d .Thus, the running time of Algorithm 2 is polynomial.

Hardness proofs
In this section, we answer several questions asked in [8].Indeed, Theorem 3 settles the missing case of [8,Theorem 24] and completes the complexity dichotomy for H-free graphs, which is given after the theorem.We further settle the computational complexity of 1-Contraction Blocker(α) in chordal graphs, which is an open case in Table 1.
Proof.We use a reduction from Vertex Cover in C 3 -free graphs which is NPcomplete due to Corollary 1.Let (G, k) be an instance of Vertex Cover where G is a C 3 -free graph.Since Vertex Cover is trivial to solve on a graph without edges, we can assume that E(G) is non-empty.We construct an instance (G ′ , k) In other words, we add a universal vertex w to G in order to obtain G ′ .
Since G is C 3 -free, every copy of C 3 in G ′ has to contain w.Furthermore, since w is adjacent to every other vertex in V (G ′ ), it follows that every vertex of G ′ has distance at most one to every copy of C 3 .Thus, G ′ is (C 3 + P 1 )-free.Also, note that ω(G ′ ) = 3 and that every maximum clique in G ′ is a copy of C 3 which contains w and exactly two vertices of V (G).
Let us assume that (G, k) is a Yes-instance of Vertex Cover.Let {v 1 , . . ., v k } ⊆ V (G) be a vertex cover of G. Set S = {v i w : i ∈ {1, . . ., k}} and let G * = G ′ /S.We claim that S is ω-contraction-critical.Notice that the contraction of an edge vw ∈ S is equivalent to deleting the vertex v, since the new vertex remains adjacent to all other vertices.Thus, For the other direction, assume that We construct a set U of vertices of G as follows: For the connected component T of G ′ S that contains w, add every vertex of V (T ) except w to U .For every other connected component T of G ′ S we add to U all vertices of V (T ) except one, which can be chosen arbitrarily.We claim that U is a vertex cover of G of size at most k.
To In order to show that U is a vertex cover, suppose for a contradiction that there is an edge uv ∈ E(G) for which neither u nor v is contained in U .Consider the connected components A u , A v and A w of G ′ S which contain u, v and w, respectively.It follows from the construction of U that in every connected component T of G ′ S there is at most one vertex of T which is not contained in U .Hence, A u = A v .We have that w ∈ U by construction, so the same argument can be used to show that A u = A w and A v = A w .Thus, A u , A v , A w correspond to three different vertices in G * and since the components are pairwise at distance one, their corresponding vertices induce a C 3 in G * , a contradiction to S being ω-contraction-critical.Thus, U is a vertex cover in G and (G, k) a Yes-instance of Vertex Cover.Theorem 4. Let H be a graph.If H is an induced subgraph of P 4 or of the paw, then Contraction Blocker(ω) is polynomial-time solvable for H-free graphs, otherwise it is NP-hard or co-NP-hard for H-free graphs.
In order to simplify the notation of the proof of the following theorem, we restate Vertex Cover as a satisfiability problem.

Weighted Positive 2-SAT
Instance: A variable set X, a clause set C in which all clauses contain exactly two literals and every literal is positive, as well as an integer k.Question: Is there a truth assignment of the variables (that is, a mapping f : X → {true, false}) such that at least one literal in each clause is true and there are at most k variables which are true.
Let G be a graph and S, S ′ ⊆ E(G) such that for every connected component Then, G/S = G/S ′ and thus we get the following corollary.
Corollary 2. Let G be a graph and S ⊆ E(G) a minimal α-contraction-critical set of edges.Then, G S is a forest.
Proof.It was shown in [13] that Independent Set can be solved in polynomial time for chordal graphs.Since the family of chordal graphs is closed under edge contractions, for a given chordal graph G and a set S ⊆ E(G), it is possible to check in polynomial time whether S is α-contraction-critical.It follows that 1-Contraction Blocker(α) is in NP for chordal graphs.In order to show NP-hardness, we reduce from Weighted Positive 2-SAT, which was shown to be NP-hard above.Let Φ = (X, C, k) be an instance of Weighted Positive 2-SAT.We construct a chordal graph G such that (G, k) is a Yes-instance for 1-Contraction Blocker(α) if and only if Φ is a Yes-instance for Weighted Positive 2-SAT, as follows: For every variable x ∈ X, we introduce a set of vertices G x with G x = {v x } ∪ K x , where K x is a set of 2k + 1 vertices which induce a clique.We make v x complete to K x .For every clause c ∈ C, we introduce a vertex v c .We define K C = c∈C {v c }.We add edges so that G[K C ] is a clique.For every clause c ∈ C, c = (x ∨ y), we make v c complete to K x and K y (see Figure 1 for an example).
Observe first that the graph G is indeed chordal: if a cycle of length at least four contains at least three vertices of K C , it follows immediately that the cycle cannot be induced, since K C induces a clique.Otherwise, such a cycle contains at most two vertices of K C .If there are two vertices w and w ′ of the cycle which are contained in G x and G y , respectively, with x, y ∈ X, x = y, then the cycle has to contain a chord in G[K C ] and is thus not induced.If all vertices of the cycle are in K C ∪ G x for some fixed x ∈ X, then there are at least two vertices w and w ′ contained in K x .Hence, the cycle cannot be induced since w and w Fig. 2: This is the graph corresponding to the instance of Weighted Positive 2-SAT given by the variables w, x, y, z and the clauses c 1 = w ∨ x, c 2 = x ∨ y and the vertices contained in it induce a clique.Every set K i induces a clique and the lines between a vertex and a set K i mean that this vertex is complete to K i .
are adjacent and have the same neighbourhood.It follows that G cannot have any induced cycle of length at least 4 and is thus chordal.Since G x induces a clique for every x ∈ X, it can contain at most one vertex in any independent set; the same applies to Let us assume that Φ is a Yes-instance of Weighted Positive 2-SAT.Let X + be the set of positive variables of a satisfying assignment of Φ.For each x ∈ X + , let e x be an edge incident to v x and let S = {e x |x ∈ X + }.Let G ′ = G/S.We claim that α(G ′ ) < α(G).To see this, observe first that for any x ∈ X + , contracting e x is equivalent to deleting the vertex v x , since N G (v x ) = K x induces a clique.Therefore, we have that G ′ ≃ G − {v x : x ∈ X + }.Suppose for a contradiction that there is an independent set Furthermore, the inequalities above all have to be equalities.By the choice of X + , it follows that there is For the other direction, assume that Φ ′ = (G, k) is a Yes-instance of 1-Contraction Blocker(α).Let S be a minimum α-contraction-critical set of edges such that |S| ≤ k.By Corollary 2, the graph G S is a forest.
For any x ∈ X, there is a vertex u x ∈ K x \ V (S).This follows from the fact that k edges can be incident to at most 2k vertices and Suppose for a contradiction that there is a connected component T of H such that for every , and thus T is also a connected component in G S .For every x ∈ X the set {u x } is a connected component in G S , that is, u x is not incident to any edge in S. Further, for every is a set of connected components of G S which correspond to vertices in G/S who are pairwise at distance at least two.In other words, I corresponds to an independent set in G/S of cardinality |X| + 1, a contradiction to the assumption that S is α-contraction-critical.It follows that there is no connected component T of H such that for every We can obtain a truth assignment of the variables satisfying Φ as follows: Set every x to true for which G x ∩V (S) is non-empty.For every clause c = (x∨y) ∈ C for which both G x ∩ V (S) and G y ∩ V (S) are empty, set one of its variables to true.This assignment is clearly satisfying, it remains to show that we set at most |S| ≤ k variables to true.Consider a connected component T of H. Recall that T is a tree, and so its number of vertices is one more than its number of edges.We have shown that there is a vertex for which both G x ∩ V (S) and G y ∩ V (S) are empty.This implies that for every connected component T of H we set at most |E(T )| variables to true.Further, the number of variables x ∈ X which we set to true because G x ∩ V (S) = ∅ is at most the number of edges of S which are not contained in G[K C ].This shows that, in total, we set at most |S| variables to true, which concludes the proof.

Vertex Deletions
In this section, we settle another open case of Table 1.Interestingly, 1-Deletion Blocker(α) and 1-Contraction Blocker(α) are equivalent on the instance Φ ′ constructed in the proof of Theorem 5 and thus the same construction can be used to show NP-hardness of 1-Deletion Blocker(α) in chordal graphs.Theorem 6. 1-Deletion Blocker(α) is NP-complete in chordal graphs.
Proof.It has been shown in [13] that it is possible to determine the independence number of chordal graphs in polynomial time.Since chordal graphs are closed under vertex deletion, it is possible to check in polynomial time whether the deletion of a given set of vertices reduces the independence number.Hence 1-Deletion Blocker(α) is in NP for chordal graphs.
In order to show NP-hardness, we reduce from Weighted Positive 2-SAT.Let Φ be an instance of Weighted Positive 2-SAT, Φ = (X, C, k).Let Φ ′ = (G, k) be the instance of 1-Contraction Blocker(α) which is described in Theorem 5 and which has been shown to be equivalent to Φ. Further, let K x , G x and v x for each x ∈ X, K C , and v c for each c ∈ C be as in the proof of Theorem 5. Recall that we have shown that α(G) = |X| + 1 and that G is chordal.
We show that Φ ′ is a Yes-instance of 1-Deletion Blocker(α) if and only if Φ is a Yes-instance of Weighted Positive 2-SAT.
Assume first that Φ is a Yes-instance of Weighted Positive 2-SAT and that X + is the set of positive variables in a satisfying assignment of Φ.We have shown in the proof of Theorem 5 that α(G−{v Conversely, assume that Φ ′ is a Yes-instance of 1-Deletion Blocker(α) and let W be an α-deletion-critical set of vertices of cardinality at most k.For every x ∈ X there is For every clause c ∈ C with v c ∈ W we choose one of the variables contained in c and add it to Z ′ .We claim that setting the variables of Z ∪Z ′ to true yields a satisfying assignment of Φ. Observe first that |Z ∪ Z ′ | ≤ |W | ≤ k by construction.Suppose for a contradiction that there is a clause c ∈ C, c = (x ∨ y), such that neither x nor y is contained in a contradiction to the α-deletioncriticalness of W . Hence the assignment is satisfying and the theorem follows.
Since perfect graphs are a superclass of chordal graphs, we obtain the following corollary.
Observe that Corollary 3 could also be shown as follows.Complements of perfect graphs are again perfect graphs.Further, 1-Deletion Blocker(α) is a Yes-instance for a graph G if and only if 1-Deletion Blocker(ω) is a Yes-instance for G. Since it was shown in [8] that 1-Deletion Blocker(ω) is NP-hard in perfect graphs the corollary follows.

Edge Deletions
Given a colouring c of the vertices of a graph G, we say that an edge uv, with u, v ∈ V (G), is a monochromatic edge of c if c(u) = c(v).Using this terminology, a proper colouring is a colouring without monochromatic edges.The following problem is a generalization of h-Chromatic Number (for a definition, see for example [12]), in the sense that we ask if there is a colouring with few monochromatic edges.

h-Monochromatic Edges
Instance: A graph G and an integer m.Question: Is there an h-colouring of G with at most m monochromatic edges?
As above, we sometimes consider h to be part of the input.The problem is then called Monochromatic Edges.
To keep the notation more simple, we will focus on Monochromatic edges instead of Edge Deletion Blocker(χ) in this chapter.This is justified by the following proposition.For the other direction, assume that (G, m) is a Yes-instance for (χ(G) − h)-Edge Deletion Blocker(χ).Thus, there is a set of edges When we colour the vertices of G according to c, then the only monochromatic edges can be the edges in S. Thus, c is an h-colouring of G with at most m monochromatic edges, which completes the proof.
The following lemma is a simple observation about reducing the number of monochromatic edges by recolouring the vertices.Lemma 4. Let G be a graph, and I ⊆ V (G) an independent set such that for any v ∈ I we have N (v) = N (I).If c is an h-colouring of G, then there is a colour j ∈ c(I) such that recolouring every vertex of I with j yields an h-colouring of G which has at most as many monochromatic edges as c.
Proof.For each i ∈ [h], we denote by n i the number of vertices in I which receive colour i by c.Similarly, for every i ∈ [h], we denote by n ′ i the number of vertices in N (I) which receive colour i by c.Since I is independent, no colouring can have any monochromatic edges between two vertices of I.The number of monochromatic edges between I and N (I) is i∈[h] n i n ′ i .Let j ∈ c(I) be such that n ′ j is minimum amongst all colours in c(I).After recolouring all vertices in I with colour j, the number of monochromatic edges between I and N (I) is This concludes the proof.

Algorithms
Theorem 7.For a fixed integer h, the decision problem h-Monochromatic Edges is solvable in polynomial time on cographs.
Proof.Let G be a cograph with associated cotree T .For every p ∈ V (T ), we define a function f p which takes as input an h-tuple of non-negative integers a p = (a p 1 , . . ., a p h ) whose entries sum up to |V (T p )|.
If p is a leaf, then f p (a p ) = 0 for any valid input.If p is not a leaf, let q and r be the children of p.If p is a 0-node, then f p (a p ) = min a q ,a r ∈[0.
If p is a 1-node, then This defines the values of f p for every p ∈ V (T ).Observe that for every node p ∈ V (T ), there are at most O(n h ) possible inputs a p .To compute f p (h), we consider every pair of h-tuples a q , a r ∈ [0.
.n] h , of which there are O(n 2h ).Checking whether they sum to the correct values and computing the term given in the formula above takes constant time.So, we can compute the function f p in polynomial time.
Claim.For every p ∈ V (T ) and every h-tuple a p = (a p 1 , . . ., a p h ) of non-negative integers with the value of f p (a p ) is the minimum number of monochromatic edges of all hcolourings of T p , in which colour i appears a p i times for every i ∈ [h].Proof of the claim.Observe first that the claim holds when p is a leaf, since then there are no edges in T p .If p is not a leaf, let q and r be the children of p and assume that the claim holds for q and r.
For an h-tuple a p = (a p 1 , . . ., a p h ) which satisfies (1), let c p be an h-colouring of T p which, for every i ∈ [h], assigns colour i to exactly a p i vertices, and which minimizes the number of monochromatic edges amongst all such colourings.Let m p be the number of monochromatic edges in c p .Let c q and c r be the hcolourings of T q and T r , respectively, which we obtain by restricting c p to T q and T r , respectively.For every i ∈ [h], let a q i be the number of vertices in T q which receive the colour i from c q .Define a r i analogously for all i ∈ [h].Clearly, a p i = a q i + a r i for every i ∈ [h] as well as It follows from the definition of f p that f p (a p ) ≤ f q (a q ) + f r (a r ) if p is a 0-node and f p (a p ) ≤ f q (a q )+ f r (a r )+ h i=1 a q i a r i if p is a 1-node.Let m q be the number of monochromatic edges of c q , and define m r analogously.Since the claim holds for q and r, it follows that f q (a q ) ≤ m q and f r (a r ) ≤ m r .If p is a 0-node, then the number of monochromatic edges of c p is m p = m q + m r and thus, f p (a p ) ≤ m q + m r = m p .If p is a 1-node, then the number of monochromatic edges of c p is m p = m q + m r + h i=1 a q i a r i and thus, f p (a p ) ≤ m q + m r + h i=1 a q i a r i = m p .Suppose for a contradiction that f p (a p ) < m p .Then there are h-tuples of non-negative integers b q = (b q 1 , . . ., b q h ) and b r = (b r 1 , . . ., b r h ) such that b q 1 + . . .
Since we assume that the claim holds for q and r, it follows that there is an h-colouring c ′ q of T q such that the number of vertices in T q which receive the colour i by c ′ q is b q i for every i ∈ [h] and whose number of monochromatic edges is f q (b q ) and analogously for T r .Let us colour T p by colouring the vertices in T q according to c ′ q and the vertices in T r according to c ′ r .This yields a welldefined h-colouring c ′ p of T p since V (T p ) is a disjoint union of V (T q ) and V (T r ).The number of monochromatic edges of p is an h-colouring of T p for which the number of vertices which receive colour i is b q i + b r i = a p i for every i ∈ [m] and which has less monochromatic edges than c p , a contradiction.It follows that f p (a p ) is the number of monochromatic edges of c p and thus that the claim holds for p.
We have shown that for every node p ∈ V (T ) and every h-tuple a p , we can compute in polynomial time the smallest number of monochromatic edges of all h-colourings of T p whose i-th colour class has size a p i for each i ∈ [h].In particular, the value of f s (a s ), where s is the root of T , is the minimum number of monochromatic edges of all h-colourings of T whose i-th colour class has size a s i for each i ∈ [h].Since there are O(n h ) possibilities how to fix the sizes of h colour classes which partition n vertices, we can determine the minimum number of monochromatic edges of h-colourings for each of them and then take the minimum of all of them.This can be done in polynomial time and shows thus the theorem.
For the next theorem we will need the following definitions.Let ℓ be a positive integer, a = (a 1 , . . ., a ℓ ), a ′ = (a ′ 1 , . . ., a ′ ℓ ) two ℓ-tuples of real numbers and λ ≤ ℓ a positive integer.We want to associate λ entries of one tuple to λ entries of the other tuple.
We say that a λ-matching µ of two ℓ-tuples is a λ-tuple that for all j, j ′ ∈ [λ], j = j ′ , we have that i j = i j ′ and i ′ j = i ′ j ′ .Intuitively, we can imagine that a λ-matching encodes the edges of a matching in a complete bipartite graph whose vertices correspond to the entries of two ℓ-tuples, see Figure 3 for an example.For any µ j = (i j , i ′ j ), j ∈ [λ], we say that the index i j is matched with the index i ′ j .For the ℓ-tuples a and a ′ we say that the entry a ij is matched with the entry a ′ i ′ j .The value of a λ-matching µ applied to the ℓ-tuples a and a ′ is denoted by val(µ, a, a ′ ) and is defined as We now want to create a new tuple from a and a ′ and a λ-matching µ.A µ-merge of a and a ′ is a (2ℓ − λ)-tuple whose j-th entry is a ij + a ′ i ′ j for all j ∈ [λ], the next ℓ − λ entries contain the unmatched entries of a, and the last ℓ − λ entries contain the unmatched entries of a ′ , see Figure 3 for an example.We obtain a sorted µ-merge of a and a ′ if we sort the entries of any µ-merge of a and a ′ in ascending order.Observe that there might be several µ-merges of a and a ′ , but there is only one sorted µ-merge.Given a λ-matching µ and two ℓ-tuples a and a ′ , we denote the sorted µ-merge of a and a ′ by merge(µ, a, a ′ ).We denote the i-th entry of merge(µ, a, a ′ ) by merge(µ, a, a ′ , i), (3,4), (4,3)) visualized on the 4-tuples a = (a 1 , . . ., a 4 ) and a ′ = (a ′ 1 , . . ., a ′ 4 ).Right: A corresponding µ-merge.
Property 1.Let G be a cograph with corresponding cotree T .A colouring c of T is said to have Property 1 if for every 0-node p of T with children q and r, the i-th largest colour class of T q has the same colour as the i-th largest colour class of T r for all i ∈ [χ(T p )].
Lemma 5. Let G be a cograph with associated cotree T .Let d be a non-negative integer.There is a (χ(G)−d)-colouring c of G with the minimum possible number of monochromatic edges which satisfies Property 1.
Proof.Let p ∈ V (T ) be a 0-node with children q and r.Suppose that there is an i ∈ [χ(T p )] such that the i-th largest colour class of T q does not have the same colour as the i-th largest colour class of T r and assume that i is the smallest such number.Note that the i-th colour classes of both T q and T r cannot be empty since an empty colour class has the same colour as every other colour class.By construction of the cotree, all vertices in T p have the same neighbourhood in T p .Denote by n q and n r the number of vertices in T p which have the same colour as the vertices in the i-th largest colour class of T q and T r , respectively, and which are adjacent to the vertices in T p .Assume, without loss of generality, that n q ≥ n r .Denote by a q and a r the number of vertices of the i-th largest colour class of T q and T r , respectively.Denote by a ′ q the number of vertices in T q which have the colour of the i-th largest colour class of T r and denote by a ′ r the number of vertices which have the colour of the i-th largest colour class of T q .Observe that a ′ q ≤ a q and a ′ r ≤ a r since we assumed that i is the smallest index for which the i-th largest colour classes of T q and T r do not have the same colour.There are n q (a q + a ′ r ) + n r (a r + a ′ q ) monochromatic edges between T p and T p whose endpoints have the colours of the i-th colour classes of T q or T r .Recolour the vertices in the i-th largest colour class of T q with the colour of the i-th largest colour class of T r and colour the vertices in T q which have the colour of the i-th largest colour class in T r with the colour of the i-th largest colour class of T q .Observe that we only exchanged the colours of two colour classes in T q , so we can only have changed the number of monochromatic edges between T p and T p which have the colours of the i-th largest colour classes of T p and T q .After recolouring, this number is now n r (a q + a r ) + n q (a ′ q + a ′ r ).The difference of the number of monochromatic edges is n q (a q + a ′ r ) + n r (a r + a ′ q ) − n r (a q + a r ) + n q (a ′ q + a ′ r ) = (n r − n q )(a ′ q − a q ), which is the product of two non-positive numbers and thus non-negative.This shows that the recolouring did not increase the number of monochromatic edges.Repeating this step for each i ∈ [χ(T p )] as above yields a colouring which satisfies the condition above.
Observe that if the condition above holds for any descendant q of p in the original colouring, then it still holds after the recolouring, since any two vertices in T q having the same colour in the original colouring will still have the same colour after the recolouring step.We can thus apply the recolouring procedure starting at the leaves and working our way up to the root, ending up with a colouring of the graph for which the desired condition holds for every node of the cotree.Lemma 6.Let G be a cograph with associated cotree T whose root p is a 1node with children q and r.Let a p = (a p 1 , . . ., a p ℓ ) be an ℓ-tuple of non-negative integers and let λ, ∆ be non-negative integers.There is a (χ(T p ) − ∆)-colouring of T p with Property 1 whose i-th smallest colour class has at most a p i vertices for every i ∈ [ℓ], which has exactly λ colours which appear in both T q and T r , which has the minimum number of monochromatic edges amongst all such colourings and there is no j > ℓ + λ such that the colour of the j-th smallest colour class of T q (or T r ) appears in T r (or T q , respectively).
Proof.Let c p be a (χ(T p ) − ∆)-colouring of T p with Property 1 such that its i-th smallest colour class has at most a p i vertices for every i ∈ [ℓ], the number of colours which appear in both T q and T r is λ and its number of monochromatic edges amongst all such colourings is minimal.If there is no j > ℓ + λ such that the j-th smallest colour class of T q shares its colour with some vertices in T r , or vice versa, we are done.If not, suppose, without loss of generality, that there are j > ℓ + λ and j ′ such that the j-th smallest colour class of T q and the j ′th smallest colour class of T r have the same colour.Besides the j-th smallest colour class, there are λ − 1 other colour classes in T q whose colour also appears in T r .Since j ≥ ℓ + λ + 1, there is an i ∈ [ℓ + λ] such that the i-th smallest colour class in T q has a colour which does not appear in T r and which is not one of the ℓ smallest colour classes of T p .Recolour the vertices of the i-th and the j-th smallest colour classes of c q by exchanging their colours.This does not change the number of monochromatic edges with both ends in T q .The number of monochromatic edges between T q and T r cannot increase since the i-th smallest colour class does not contain more vertices than the j-th smallest one.It follows that the new colouring did not increase the number of monochromatic edges or the number of colours used and it did not change the sizes of the ℓ smallest colour classes.It is also clear that the new colouring still has Property 1. Repeating this process for every j as above yields a colouring as desired.
Theorem 8.For a fixed integer d, (χ(G) − d)-Monochromatic Edges is solvable in polynomial time on cographs.
Proof.Let G be a cograph with associated cotree T and let d ≤ χ(G) be a fixed integer.For every ℓ ∈ [0..d] and every node p ∈ V (T ) we define a function f p ℓ which takes as input an ℓ-tuple of non-negative integers a p = (a p 1 , . . ., a p ℓ ) with a p i ≤ a p j for every i ≤ j and a non-negative integer ∆ with ∆ ≤ d − ℓ.If p is a leaf, then f p ℓ will output 0 for every ℓ and every input.If p is not a leaf, let q and r be the children of p.Let ℓ and ∆ be non-negative integers with ℓ + ∆ ≤ d and let a p = (a p 1 , . . ., a p ℓ ) be an ℓ-tuple as above.If p is a 0-node, then assume, without loss of generality, that χ(T q ) ≥ χ(T r ) and let δ = χ(T q ) − χ(T r ).We distinguish the following three cases: Case 1: Case 2: If ∆ < δ and ∆ + ℓ ≥ δ we set f q ℓ (a p 1 , . . ., a p δ−∆ , a q , ∆) + f r ℓ−δ+∆ (a r , 0).
This defines the values of f p ℓ for every ℓ ∈ [0..d] and p ∈ V (T ).Observe that for every f p ℓ there are at most (n + 1) ℓ (d − ℓ + 1) possible inputs.In order to compute the value of f p ℓ for one of them, we consider at most (n + 1) 2(ℓ+∆) = O(n 2d ) possible pairs of tuples a q and a r if p is a 0-node and O(n 2d ) choices for ∆ q , ∆ r , λ, a q , a r and µ if p is a 1-node.Thus, we can compute the function f p ℓ in polynomial time.Claim.For every ℓ ∈ [d], p ∈ V (T ) and every valid input (a p , ∆) the function f p ℓ (a p , ∆) returns the smallest number of monochromatic edges of all (χ(T p )−∆)colourings of T p whose i-th smallest colour class has size at most a p i for all i ∈ [ℓ] and which have Property 1.
Observe first that the value of f p ℓ is correct when p is a leaf since then there are no edges in T p .If p is not a leaf let q and r be the children of p and assume that the claim holds for q and r.
Let c p be a (χ(T p ) − ∆)-colouring of T p which satisfies Property 1 and whose i-th smallest colour class has at most a p i vertices, for every i ∈ [ℓ], and which has the smallest number of monochromatic edges amongst all such colourings.We need to show that the number of monochromatic edges of c p , which we denote by m p , is identical to the value of f p ℓ (a p , ∆).Let c q and c r be the colourings which we obtain by restricting c p to T q and T r , respectively, and let ∆ q be an integer such that χ(T q ) − ∆ q is the exact number of colours we use in c q .We define ∆ r analogously.For every i ∈ [ℓ], denote by a q i and a r i the number of vertices of the i-th smallest colour class of c q and c r , respectively.Observe that the i-th smallest colour classes of c q and c r do not necessarily have the same colour.Let m q and m r be the numbers of monochromatic edges of c q and c r , respectively.
Assume first that p is a 0-node, set δ = χ(T q ) − χ(T r ) and assume without loss of generality that δ ≥ 0. Recall that χ(T p ) = χ(T q ) and m q +m r = m p , since p is a 0-node.It follows from Property 1 that for every i > χ(T r ) the i-th largest colour class of c p is entirely contained in T q .To prove the claim we distinguish the following three cases, see Figure 4 for an illustration.

Case 1: ∆ ≥ δ
We first show that f p ℓ (a p , ∆) ≤ m p .The colouring c p uses χ(T q ) − ∆ colours on T p .We have that χ(T q ) − ∆ = χ(T r ) − (∆ − δ) ≤ χ(T r ).It follows that c q is a (χ(T q ) − ∆)-colouring of T q and c r is a (χ(T r ) − (∆ − δ))-colouring of T r .By Property 1 we know that the i-th largest colour class of c p on T p consists of the i-th largest colour class of c q and the i-th largest colour class of c r for every i ∈ [χ(T q ) − ∆].This implies in particular that a p i ≥ a q i + a r i for every i ∈ [ℓ].Since c q is a (χ(T q )−∆)-colouring of T q whose i-th smallest colour class contains a q i vertices and since the claim holds for q, it follows that f q ℓ (a q , ∆) ≤ m q and analogously f r ℓ (a r , ∆ − δ) ≤ m r .Hence f p ℓ (a p , ∆) ≤ f q ℓ (a q , ∆) + f r ℓ (a r , ∆ − δ) ≤ m q + m r = m p .
It remains to show that f p ℓ (a p , ∆) = m p .We suppose for a contradiction that there are a q , a r ∈ [0..n] ℓ such that a q i + a r i ≤ a p i for all i ∈ [ℓ] and f p ℓ (a p , ∆) = f q ℓ (a q , ∆) + f r ℓ (a r , ∆ − δ) < m p .Since the claim holds for q and r, it follows that there is a (χ(T q ) − ∆)-colouring c ′ q of T q and a (χ(T r ) − (∆ − δ))-colouring c ′ r of T r , both with Property 1, such that the i-th smallest colour class of c ′ q (c ′ r , respectively) contains at most a q i vertices (a r i vertices, respectively) for each i ∈ [ℓ] and that the sum of the number of monochromatic edges in c ′ q and c ′ r is strictly less than m p .Construct a (χ(T p )− ∆)-colouring c ′ p of T p with Property 1 such that the i-th largest colour class of c ′ p contains exactly the vertices of the i-th largest colour class of c ′ q and the vertices of the i-th largest colour class of c ′ r for every i ∈ [χ(T q ) − ∆].It follows that the size of the i-th smallest colour class of c ′ p is at most a p i for every i ∈ [ℓ].Since p is a 0-node, the number of monochromatic edges of c ′ p is exactly the sum of the numbers of monochromatic edges of c ′ q and c ′ r and thus less than m p .By construction, c ′ p has Property 1 and so c ′ p is a (χ(T p ) − ∆)-colouring with Property 1 of T p whose i-th smallest colour class has size at most a p i for every i ∈ [ℓ] and which has less monochromatic edges than c p , a contradiction to the choice of c p .
It remains to show that f p ℓ (a p , ∆) = m p .Again, we suppose for a contradiction that there are a q , a r ∈ [0..n] ℓ−δ+∆ such that a q i+δ−∆ + a r i ≤ a p i+δ−∆ for all i ∈ [ℓ − δ + ∆] and f q ℓ (a p 1 , . . ., a p δ−∆ , a q , ∆) + f r ℓ−δ+∆ (a r , 0) < m q + m r .Since we assumed that the claim holds for q and r it follows that there is a (χ(T q ) − ∆)colouring c ′ q of T q and a χ(T r )-colouring c ′ r of T r , both with Property 1, such that the i-th smallest colour class of c ′ q contains at most a p i vertices for every i ∈ [δ − ∆], the (i + δ − ∆)-th smallest colour class of c ′ q contains at most a q i+δ−∆ vertices for each i ∈ [ℓ − δ + ∆] and the i-th smallest colour class of c ′ r contains at most a r i vertices for each i ∈ [ℓ − δ + ∆] and that the sum of monochromatic edges in c ′ q and c ′ r adds to less than m q + m r .Construct a (χ(T q )−∆)-colouring c ′ p of T p with Property 1 such that the i-th smallest colour class of c ′ p contains exactly the vertices of the i-th smallest colour class of c ′ q for every i ∈ [δ − ∆] and the i-th smallest colour class of c ′ p contains exactly the vertices of the i-th smallest colour class of c ′ q and the vertices of the (i−δ+∆)-th smallest colour class of c ′ r for every i ∈ {δ − ∆ + 1, . . ., χ(T q ) − ∆}.It follows that the size of the i-th smallest colour class of c ′ p has size at most a p i for every i ∈ [ℓ].It is also clear that the number of monochromatic edges of c ′ p is exactly the sum of the numbers of monochromatic edges of c ′ q and c ′ r and thus less than m q + m r .So c ′ p is a (χ(T q ) − ∆)-colouring of T p with Property 1 whose i-th colour class has size at most a p i for every i ∈ [ℓ] and which has less monochromatic edges than c p , a contradiction to the choice of c p .
Case 3: ∆ < δ and ∆ + ℓ < δ In this case, the colours used in the ℓ smallest colour classes of c do not appear in T r .Clearly, f r ℓ (a r , ∆) = 0 and thus f p ℓ (a p , ∆) ≤ f q ℓ (a q , ∆) + f r ℓ (a r , ∆) ≤ m q .Suppose for a contradiction that f q ℓ (a q , ∆) < m q .Then there is a (χ(T q )−∆)colouring c ′ q of T q with Property 1 such that the number of vertices in the i-th smallest colour class of c ′ q contains at most a p i vertices for each i ∈ [ℓ] and the number of monochromatic edges of c ′ q is less than m q .Let c ′ r be a proper colouring of T r with Property 1 using χ(T r ) colours.Construct a (χ(T p ) − ∆)colouring c ′ p of T p with Property 1 such that the i-th smallest colour class of c ′ p contains exactly the vertices of the i-th smallest colour class of c ′ q for each i ∈ [δ − ∆] and that the i-th smallest colour class of c ′ p contains exactly the vertices of the i-th smallest colour class of c ′ q and the (i − δ + ∆)-th smallest colour class of c ′ r for i ∈ {δ − ∆ + 1, . . ., χ(T r ) − ∆}.Since ℓ < δ − ∆, it follows that the ℓ smallest colour classes of c ′ p are all contained in T q and thus c ′ p is a (χ(T p ) − ∆)-colouring of T p whose i-th smallest colour class contains at most a p i vertices for each i ∈ [ℓ].Since the number of monochromatic edges of c ′ p is equal to the number of monochromatic edges of c ′ q , it follows that c ′ p has less monochromatic edges than c p , a contradiction.This completes the third case and thus the claim holds for p if p is a 0-node.
Assume that p is a 1-node.Let λ be the number of colours that are used by both c q and c r .Following Lemma 6 we can assume that only the ℓ + λ smallest colour classes have colours which appear in both T q and T r .The number of colours used by c p is χ(T q ) − ∆ q + χ(T r ) − ∆ r − λ = χ(T p ) − (∆ q + ∆ r + λ), and so ∆ q + ∆ r + λ = ∆.Let µ be a λ-matching on tuples of length ℓ + λ which matches i with j if and only if the i-th smallest colour class of c q and the j-th smallest colour class of c r have the same colour.It follows that merge(µ, (a q 1 , . . ., a q ℓ+λ ), (a r 1 , . . ., a r ℓ+λ ), i) is the size of the i-th smallest colour class of c p for every i ∈ [ℓ].Observe that c q (and c r , respectively) is a (χ(T q ) − ∆ q )-colouring of T q with Property 1 (or a (χ(T r ) − ∆ r )-colouring of T r with Property 1, respectively) whose i-th colour class has exactly a q i vertices (a r i vertices, respectively) for every i ∈ [ℓ + λ] and thus, by the assumption that the claim holds for q and r, f q ℓ+λ ((a q 1 , . . ., a q ℓ+λ ), ∆ q ) ≤ m q and f r ℓ+λ ((a r 1 , . . ., a r ℓ+λ ), ∆ r ) ≤ m r .It is easy to see that the number of monochromatic edges of c p is m q + m r + val(µ, a q , a r ) and thus f p ℓ (a, ∆) is smaller or equal than the number of monochromatic edges of c p .
By the assumption of correctness of the claim for q and r, there are a (χ(T q ) − ∆ ′ q )-colouring c ′ q of T q with Property 1, -a (χ(T r ) − ∆ ′ r )-colouring c ′ r of T r with Property 1, such that the number of monochromatic edges of c ′ q and c ′ r are m ′ q and m ′ r , respectively, -the i-th smallest colour class of c ′ q (or of c ′ r , respectively) has at most b q i vertices (b r i vertices, respectively) for each i ∈ [ℓ + λ], -m ′ q + m ′ r + val(µ ′ , b q , b r ) is strictly less than the number of monochromatic edges of c p .Construct a (χ(T p )−∆)-colouring c ′ p of T p with Property 1 such that two vertices in T q (in T r , respectively) obtain the same colour if and only if they obtain the same colour by c ′ q (by c ′ r , respectively) and two vertices w q ∈ T q and w r ∈ T r , which are contained in the i-th smallest colour class of c ′ q and in the i ′ -th smallest colour class of T r , respectively, obtain the same colour if and only if i and i ′ are both at most ℓ + λ ′ and µ ′ matches i with i ′ .It follows immediately from the definition of this new colouring that c ′ p is a (χ(T p ) − ∆)-colouring of T p with Property 1 such that its i-th smallest colour class contains at most a p i vertices for every i ∈ [ℓ] and which has less monochromatic edges than c p , a contradiction to the choice of c p .
This shows the claim.It follows from the correctness of the claim that f s 0 ((), d), where s is the root of T and the first argument is an empty tuple, is the smallest number of monochromatic edges that any (χ(G) − d)-colouring of G satisfying Property 1 can have.It follows from Lemma 5 that this coincides with the smallest number of monochromatic edges amongst all (χ(G)−d)-colourings of G.This shows that we can indeed solve (χ(G) − d)-Monochromatic Edges in polynomial time.

Hardness proofs
Theorem 9. Monochromatic Edges is NP-hard on complete multipartite graphs.
Proof.We reduce from Minimum Sum of Squares, which takes as input an integer ℓ, an ℓ-tuple a = (a 1 , . . ., a ℓ ) of integers, an integer h and an integer J.

It asks whether [ℓ] can be partitioned into h sets
It was shown in [12] that this problem is NP-hard, when we consider j∈[ℓ] a j as the size of an instance.Given an instance (ℓ, a, h, J) of Minimum Sum of Squares, we set D = 1 2 ℓ j=1 a 2 j .We construct a complete multipartite graph G as follows: for every j ∈ [ℓ], let U j be a set of a j vertices such that U j and U j ′ are disjoint for every j, j ′ ∈ [ℓ].Set V (G) = j∈[ℓ] U j and let E(G) be such that two vertices v ∈ U j and w ∈ U j ′ are adjacent if and only if j = j ′ .We claim that (G, h, 1 2 J − D) is a Yes-instance for Monochromatic Edges if and only if (ℓ, a, h, J) is a Yes-instance for Minimum Sum of Squares.
Assume first that (G, h, 1 2 J − D) is a Yes-instance for Monochromatic Edges.We know from Lemma 4 that there is an h-colouring c of G minimizing the number of monochromatic edges such that |c(U j )| = 1 for every j ∈ [ℓ].
For every i ∈ [h], let A i ⊆ [ℓ] be such that j ∈ [ℓ] is contained in A i if and only if the vertices of U j are coloured with colour i.Then the number of monochromatic edges whose both ends are coloured with colour i equals It follows that (ℓ, a, h, J) is a Yes-instance for Minimum Sum of Squares.
Assume now that (ℓ, a, h, J) is a Yes-instance for Minimum Sum of Squares.For every j ∈ A i , i ∈ [h], we colour the corresponding vertex set U j in G with colour i.As above, the number of monochromatic edges between vertices with colour i is 1 d fixed: P d fixed: P d fixed: P d fixed: P Interval ?P ?P Chordal d=1: NP-c d = 1: NP-c d=1: NP-c d = 1: NP-c Perfect d = 1: NP-h d = 1: NP-h d=1: NP-c d = 1: NP-c plexity of Contraction Blocker(ω) in H-free graphs has been determined

Fig. 1 :
Fig. 1: The paw see that |U | ≤ k, observe that for every connected component T of G ′ S we have added |V (T )| − 1 vertices to U .Since T is a tree (see Corollary 2), we have that |V (T )| − 1 = |E(T )|.Thus, we have added as many vertices to U as there are edges in S and hence |U | = |S| ≤ k.

Lemma 3 .
The tuple (G, m) is a Yes-instance for h-Monochromatic Edges if and only if (G, m) is a Yes-instance for (χ(G)−h)-Edge Deletion Blocker(χ).Proof.Let G be a graph and m an integer.If (G, m) is a Yes-instance for h-Monochromatic Edges, then there is an h-colouring c of G with at most m monochromatic edges.Let S ⊆ E(G) be the set of monochromatic edges of c.Then, c is a proper h-colouring of G − S. It follows that deleting |S| ≤ m edges from G yields a graph whose chromatic number is at most h.In other words, (G, m) is a Yes-instance for (χ(G) − h)-Edge Deletion Blocker(χ).

Fig. 4 :
Fig.4: Illustration of the relation between δ, ∆ and ℓ in the three cases we consider in the proof.We represent a (χ(T p ) − ∆)-colouring with Property 1 as a χ(T p )-colouring with Property 1 whose smallest ∆ colour classes are empty.Each ellipse represents a colour class in T q or T r and they are sorted ascendingly in size from top to bottom.By Property 1, two horizontally adjacent ellipses correspond to the same colour class in T p .

1 2 ( 2 J
j∈Ai a j ) 2 − j∈Ai a 2 j and the total number of monochromatic edges − D + D = J.