European Journal of Combinatorics 70 (2018) 178–189
Contents lists available at ScienceDirect
European Journal of Combinatorics journal homepage: www.elsevier.com/locate/ejc
The monotonicity property of M-partition problems Payam Valadkhan a , Mohammad-Javad Davari b a b
School of Computing Science, Simon Fraser University, Canada School of Computer Science, Institute for Research in Fundamental Sciences (IPM), Iran
article
info
Article history: Received 3 January 2017 Accepted 8 December 2017 Available online 30 January 2018
a b s t r a c t Given a symmetric m × m matrix M with entries from the set {0, 1, ∗}, the M-partition problem asks whether the vertices of a given graph G can be partitioned into parts V1 , V2 · · · Vm such that any two distinct vertices u ∈ Vi and v ∈ Vj (i, j ∈ {1, 2, . . . , m}) are adjacent if M(i, j) = 1 and non-adjacent if M(i, j) = 0. We address a question in Hell (2014) regarding the monotonicity property of M-partition problems, i.e., whether the M-partition problem being NP-complete implies that the M ′ -partition problem is also NPcomplete for any matrix M ′ containing M as a principal submatrix and having no ∗ on its main diagonal. We provide a negative answer to this question by providing a class of counter examples. We then introduce some special cases in which the monotonicity property holds. © 2017 Elsevier Ltd. All rights reserved.
1. Introduction Let M be a symmetric m × m matrix with entries from the set {0, 1, ∗}. By M(i, j) we mean the entry in the ith row and the jth column, for i, j ∈ {1, 2, . . . , m}. An M-partition of a graph G is a partition {V1 , V2 · · · Vm } of its vertices such that for any two parts Vi and Vj (i, j ∈ {1, 2, . . . , m}) any two distinct vertices u ∈ Vi and v ∈ Vj are adjacent if M(i, j) = 1 and non-adjacent if M(i, j) = 0 (the case M(i, j) = ∗ produces no condition). Considering the case i = j, we obtain that Vi is an independent set if M(i, i) = 0 and a clique if M(i, i) = 1. The M-partition problem asks whether the input graph G has an M-partition [6,8,10]. Let M be the k × k symmetric matrix with its main diagonal being entirely 0 and every other entry being ∗. Then the M-partition problem is the same as the famous k-coloring problem. As another E-mail addresses:
[email protected] (P. Valadkhan),
[email protected] (M.-J. Davari). https://doi.org/10.1016/j.ejc.2017.12.001 0195-6698/© 2017 Elsevier Ltd. All rights reserved.
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
179
noteworthy example, given a graph H on k vertices (with possibly loops), let M be the matrix obtained from the adjacency matrix of H by turning each 1 entry to a ∗ entry. Then the M-partition problem is the same as the H-coloring (or the graph homomorphism) problem [9,3,5]. Many other important graph problems can be modeled by the M-partition problem. We refer to [6,8] for a more detailed treatment of these applications. The concepts of M-partition and M-partition problem were introduced by Feder et al. [6] and since then many aspects and variations of this problem have been studied, particularly the complexity of the M-partition problem and the structural properties of minimal M-partitionable graphs. A recent survey of Hell [8] contains an exposition of research directions and current results in this area. In this survey, Hell asks (in page 11, Problem 5) whether M-partition problems have the monotonicity property, i.e., if for a matrix M the M-partition problem is NP-complete then for any matrix M ′ containing M as a principal submatrix and having no ∗ on its main diagonal the M ′ -partition problem is also NP-complete. (We made some changes to the notations and problem formulation of Hell’s version.) We remark that in this question, the condition of having no ∗ on the main diagonal of M ′ is necessary to avoid trivial counter examples, as any graph has the obvious M ′ -partition consisting of a single part Vi if M ′ (i, i) = ∗ (for some 1 ≤ i ≤ m). Intuitively, the monotonicity property asks whether a sub-problem (i.e., the M-partition problem) is no harder than the main problem (i.e., the M ′ -partition problem). We note that, since M-partition problems are in NP, if P = NP then the monotonicity property trivially holds. So to have a meaningful discussion about the monotonicity property we always need the hidden assumption that P ̸ = NP. The monotonicity property obviously holds for a variation of M-partition problems, called the list M-partition problem (introduced in [6], see also [2]). In this problem, each vertex v of the input graph G has a list L(v ) ⊆ {1, 2, . . . , m} assigned to it, and the problem asks whether there is an M-partition {V1 , V2 , . . . , Vm } of G such that for any vertex v we have v ∈ Vi only if i ∈ L(v ). Now consider a matrix M ′ and a principal submatrix M of it. For the list M ′ -partition problem, by limiting the list of each vertex to the indices corresponding to the rows of M we obtain an instance of the list M-partition problem. This obvious fact implies that the monotonicity property holds for the list M-partition problem. But for the (non-list) M-partition problem the monotonicity property is not obvious and posed as an open problem. In this paper, after introducing some notation in Section 1.1, in Section 2 we show that the monotonicity property does not hold in general by providing a group of counter examples (Corollary 2.7). In spite of this fact, the monotonicity property still could hold in special cases. We study two such special cases: In Section 3 we put some restrictions on the matrix M (the submatrix) and in Section 4 we put some restrictions on the matrix M ′ (the supermatrix), and for these cases we prove that the monotonicity property holds (Corollaries 3.5 and 5.1 and Theorem 4.5). These special cases could be useful tools to determine the complexity of M-partition problems, which is an important research direction (cf., [8,4]). 1.1. Notations For any integer k ≥ 1, denote by [k] the set {1, 2, . . . , k}. A graph G consists of a set V (G) of vertices and a set E(G) of edges between its vertices. An edge both of whose endpoints are the same vertex is called a loop. For a subset S ⊆ V (G), denote by G[S ] the induced subgraph of S in G. The set S is said to be a clique (independent set, respectively) if any two distinct vertices in S are adjacent (non-adjacent, respectively). We refer to [1] for all other graph notations and definitions. In this paper, we assume that all given matrices are symmetric with entries from the set {0, 1, ∗}. By the size of a matrix we mean the number of its rows. We always denote the size of the matrix M by the m. We identify each row or column of the matrix M with its index, e.g., by the row i we mean the ith row, etc. We normally assign the indices 1, 2, . . . , m to the rows of M, but for submatrices of M the indices of the rows could form any subset of [m] (this should be clear from the context). When dealing with symmetric matrices, we identify any column i with its corresponding row i, e.g., when we say: ‘‘for the rows i and j we have M(i, j) = ∗’’, we actually mean for the row i and the column j we have M(i, j) = ∗. A submatrix M of a (symmetric) matrix M ′ is said to be principal if for some set S of the rows of M ′ , the matrix M is obtained from M ′ by considering the rows and columns in S. In this case we say M ′
180
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
is a principal supermatrix of M. For x ∈ {0, 1, ∗}, we say a matrix M is x-free if it has no entry equal to x. We say a row i of M is x-diagonal if M(i, i) = x. We also say M is x-diagonal if the main diagonal of M consists entirely of x (i.e., any row is x-diagonal). The matrix M is said to be 01-diagonal if its main diagonal consists only of 0 or 1 entries (no ∗ on the main diagonal). Any M-partition P = {V1 , V2 , . . . , Vm } of a graph G can be seen as a coloring f : V (G) → [m] of the vertices V (G) with the colors 1, 2, . . . , m, where a vertex v has the color i if and only if v ∈ Vi . In this paper we adopt this coloring view and identify any M-partition with its corresponding coloring. Based on this view, we use the term M-coloring and the M-coloring problem instead of M-partition and the Mpartition problem, respectively. Let f : V (G) → [m] be an M-coloring of G. Then for any edge uv ∈ E(G) we must have M(f (u), f (v )) ∈ {1, ∗}, as M(f (u), f (v )) = 0 requires that uv ̸ ∈ E(G). Similarly, for any non-edge uv ̸ ∈ E(G) we must have M(f (u), f (v )) ∈ {0, ∗}, as M(f (u), f (v )) = 1 requires that uv ∈ E(G). So, we may conclude that a vertex coloring f : V (G) → [m] is an M-coloring of G if and only if for any two distinct vertices u and v we have M(f (u), f (v )) ∈ {0, ∗} if uv ̸ ∈ E(G) and M(f (u), f (v )) ∈ {1, ∗} if uv ∈ E(G). In this coloring context, we identify each color with its corresponding row, e.g., by the color i we mean the row i and vice versa, a color of M means a row of M, etc. For x ∈ {0, 1, ∗}, we say a color is an x-color if its corresponding row is x-diagonal. By the ∗-adjacency matrix of a graph H, possibly having loops, we mean a matrix obtained from its adjacency matrix by turning each 1 entry to a ∗ entry. For example, as already discussed in Introduction, the matrix corresponding to k-coloring is the ∗-adjacency matrix of Kk . We remark that the ∗-adjacency matrices are 1-free. 2. The monotonicity property of M -coloring problems In this section we show that the monotonicity property does not hold for M-coloring problems (unless P = NP). We do so by constructing a group of matrices Mr (r ≥ 9 is some integer) for which the Mr -coloring problem is NP-complete (Theorem 2.2) while for some 01-diagonal principal supermatrix M ′ of M the M ′ -coloring problem can be solved in polynomial time (Theorem 2.6 and Corollary 2.7). A graph G with no loops is said to be a mask of a matrix M if its vertices correspond to the rows of M and two distinct vertices i and j are adjacent if M(i, j) = 1 and non-adjacent if M(i, j) = 0. Note that the condition M(i, j) = ∗ produces no restriction over the adjacency of the vertices i and j, and thus in general a matrix does not have a unique mask, unless it is ∗-free. For a mask G, the trivial M-coloring f (i) = i is called the natural M-coloring of G. Central to our construction is to find matrices M such that for some mask G of M, the natural M-coloring is almost the only M-coloring of G. While studying such matrices is interesting on its own, for our practical purposes in this section even a more relaxed condition will do. Suppose M is a ∗-free 1-diagonal matrix. Note that M has a unique mask. For an integer r ≥ 1, we say M is r-strong if there exists a partition {P1 , P2 , . . . , Pr } of its rows, which is called a strong partition, such that in any M-coloring of the mask G of M, the subgraph G[Pi ] is colored only by the colors in Pi , and each color of Pi is used for at least one vertex (for i ∈ [r ]). Lemma 2.1. For any r ≥ 1 there exists an r-strong matrix Tr with size r(r + 5)/2. Proof. Let Ii be the identity matrix of size i. Construct Tr by putting matrices I3 , I4 , . . . , Ir +2 together (as principal submatrices) and setting any entry between these submatrices to 1. Note that Tr has size r(r + 5)/2. Fig. 1 shows such a construction for r = 2 and its corresponding mask. Let {P1 , P2 , . . . , Pr } be the partition of the rows in Tr where Pi is the set of rows corresponding to the submatrix Ii+2 , e.g., P1 = {1, 2, 3}, P2 = {4, 5, 6, 7}, etc (cf., Fig. 1). Let G be the mask of Tr and f be a Tr -coloring of G. Note that the subgraph G[Pi ] (for i ∈ [r ]) cannot contain colors from two distinct parts Pj and Pj′ . For otherwise, if for some u, v ∈ Pi we have f (u) ∈ Pj and f (v ) ∈ Pj′ then u and v are non-adjacent while Tr (f (u), f (v )) = 1, and this defies the coloring rules. So all the colors in each subgraph G[Pi ] belong to the same part Pj , and in this case we write j = g(i). Now suppose g(i) = g(i′ ) for some i ̸ = i′ . Let u ∈ Pi and v ∈ Pi′ be arbitrary vertices. The fact that u and v are adjacent implies the condition that Tr (f (u), f (v )) = 1. But given that f (u), f (v ) ∈ Pg(i) , the only way for this condition to hold is that f (u) = f (v ). Now let v ′ ∈ Pi′ be a vertex different
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
181
Fig. 1. The matrix T2 and its mask.
from v . Again a similar argument shows that f (u) = f (v ′ ), which implies f (v ) = f (v ′ ). But this is a contradiction as v and v ′ are non-adjacent in G while Tr (f (v ), f (v ′ )) = 1. This means g : [r ] → [r ] is a one-to-one function. Now suppose g(i) < i. Then, according to the pigeonhole principle, at least two distinct vertices u, v ∈ Pi will have the same color c, which is a contradiction as u and v are non-adjacent in G while Tr (c , c) = 1. This means for any i ∈ [r ] we have the condition g(i) ≥ i. Note that the only one-to-one function g with this condition is the identity function and the lemma follows. □ Let Tr be the matrix of the above lemma for some r ≥ 9. Let P1 , P2 , . . . , Pr be a strong partition of Tr . We construct the (symmetric) matrix Mr from Tr by adding 16 new rows and columns to it. To aid in visualization, in Fig. 2 we use a graphic model to show the structure of Mr . In this figure, the small black circles labeled by c i or cji (for i = 0, 1 and j = 1, 2, . . . , 7) are the new rows added to Tr . The labels of these circles in Fig. 2 represent the indices of the corresponding rows in Mr . The bigger black circles in the lower box (which are labeled with expressions in the form of P(x, y) or P(x, y, x)) represent 9 distinct parts chosen among the parts P1 , P2 , . . . , Pr (that is why we need to assume r ≥ 9). The choice for these 9 distinct parts is arbitrary, and this leads to the construction of a group of matrices Mr . By connecting a small circle representing a row c to a big black circle representing a part P we mean Mr (c , p) = ∗ for all indices p ∈ P, e.g., Mr (c 0 , p) = ∗ for any p ∈ P(c 0 , c 1 ). We set Mr (x, y) = 0 for all other cases with x being one of the new rows and y being an existing row in Tr , e.g., Mr (c 1 , p) = 0 for any p ∈ P(c11 , c41 ). To make it easier to remember, we denote each of these 9 parts based on the new rows to which it is connected. For example, the part P(c10 , c40 ) is connected to the rows c10 and c40 , etc. Also, by connecting two new rows c and c ′ together we mean Mr (c , c ′ ) = ∗, e.g., Mr (c 0 , c20 ) = ∗. We set Mr (x, y) = 0 for all other pairs of new rows, e.g., Mr (c20 , c50 ) = 0. In particular, note that the new rows are all 0-diagonal. For later references in the proof of Theorem 2.2, we group the new rows into sets B, B0 , W 0 , B1 , W 1 as shown in Fig. 2. Also the big black circles are grouped into a rectangle titled Tr to emphasis that these rows belong to the matrix Tr . We remind again that the matrix Mr , for a fixed r ≥ 9, is not uniquely constructed, but we have a group of these matrices. In the following theorems we simply refer to the matrix Mr as if it is a unique matrix, but in reality we are referring to any matrix constructed according to the above instructions for some fixed r ≥ 9. Theorem 2.2. The Mr -coloring problem is NP-complete. Proof. Clearly the Mr -coloring problem is NP. We use a variation of the 3-SAT problem, called the not-all-equal 3-satisfiability (or NAE 3-SAT ) problem [7]. We consider a special case of this problem, called MONOTONE NAE 3-SAT defined as follows: given n ≥ 1 variables and m ≥ 1 clauses, where
182
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
Fig. 2. The pictorial structure of the matrix Mr .
each clause is a set of three distinct variables without negation, the problem asks whether there is an assignment of 0 or 1 to each variable such that the variables in each clause do not all have the same value. This problem is known to be NP-complete [7]. We reduce this problem to the Mr -partition problem. So assume that an instance of this problem with the variables x1 , x2 , . . . , xn is given. Let H0 be the mask of Tr . We obtain the graph H from H0 by replacing each vertex i ∈ V (H0 ) with a clique Si containing 34 vertices, and joining two vertices u ∈ Si and v ∈ Sj (for all i ̸ = j) if and only if i and j are adjacent in H0 . We also partition each clique Si into two parts Si+ and Si− , each containing exactly 17 vertices. Now we construct a graph G from H by adding some more vertices to it as follows: for each variable xi (of the NAE 3-SAT problem) we add a new vertex with the same name xi and connect it to all the vertices of each clique Si+ with i ∈ P(c 0 , c 1 ) (recall that P(c 0 , c 1 ) is a part of the strong partition of Tr used in Fig. 2). Next, for each clause C = {xi , xj , xk }, we add the two gadgets shown in Fig. 3. For each gadget, the top three vertices are identified with the vertices xi , xj and xk (as they are labeled so in the figure), but all other vertices are new and distinct from the gadgets of other clauses. Note that, in the figure, each of these new vertices is labeled with a tuple which defines its neighborhood. For example, the vertex with the label (c10 , c20 ) (in the left gadget) has to be connected to all the vertices of each clique Si+ with i ∈ P(c10 , c20 ). We repeat a similar process for all these vertices of the two gadgets, i.e., the vertex labeled with the tuple U has to be connected to all the vertices of each clique Si+ with i ∈ P(U). Now suppose G has an Mr -coloring f . We show that the NAE 3-SAT problem has a solution. Note that each clique Si+ has at most one vertex with a color not in Tr , as all such colors are 0-colors. Now since the size of Si+ is strictly larger than the number of 0-colors, Si+ contains a vertex vi+ whose color is in Tr . Using a similar argument we may conclude that each clique Si− also contains a vertex vi− whose color is in Tr . Note that the subgraph induced by the vertices vi− (for i = 1, 2, . . . , r(r + 5)/2) is isomorphic to H0 (the mask of Tr ), and the coloring f is a Tr -coloring for it. Thus, the definition of r-strong matrices implies that any color in Tr is used for at least one vertex vi− . Since all the colors in Tr are 1-colors and any vertex in G − H is non-adjacent to any vertex vi− , we may conclude that no vertex in G − H is colored by a color in Tr . Also, note that the subgraph induced by the vertices vi+ (for i = 1, 2, . . . , r(r + 5)/2) is isomorphic to H0 , and the coloring f is a Tr -coloring for it. Thus, the definition of r-strong matrices implies that for any part Pj of the strong partition of Tr , f (vi+ ) ∈ Pj if and only if i ∈ Pj . Let k ∈ P(c 0 , c 1 ) be an arbitrary index. Note that each vertex xi is adjacent to vk+ and f (vk+ ) ∈ P(c 0 , c 1 ) (due to the aforementioned property). These facts along with the fact that xi is colored by non-Tr colors and considering the structure of Mr (cf., Fig. 2) imply that the color of xi must be from the set B, i.e., f (xi ) is either c 0 or c 1 . We interpret this color as the value of this variable, i.e., f (xi ) = c 0 and f (xi ) = c 1 are interpreted as xi = 0 and xi = 1, respectively. Now consider a clause
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
183
Fig. 3. The gadgets for each clause.
C = {xi , xj , xk } and its corresponding two gadgets. Let v be the vertex of these gadgets labeled with (c10 , c20 ) (cf., Fig. 3). Let k ∈ P(c10 , c20 ) be an arbitrary index. Note that v is adjacent to vk+ . Now using a similar argument as we did for the vertices xi s (considering the facts that f (vk+ ) ∈ P(c10 , c20 ) and f (v ) is not in Tr ) we may conclude that v can take only the color c10 or c20 . A similar argument shows that for any vertex v of the two gadgets, except the top three vertices labeled with the variables, the label of v indeed represents the list of the permitted colors for v . Then it is easy to see that the left gadget cannot be Mr -colored if all the three vertices xi , xj and xk assume the color c 0 at the same time. For in this case, the colors of the middle three vertices (i.e., vertices labeled with (c10 , c20 ), (c10 , c30 ) and (c10 , c40 )) is, from left to right, c20 , c30 and c40 , and this leaves no permitted choice for the vertex labeled with (c50 , c60 , c70 ) (see the edges between B0 and W 0 in Fig. 2). Similarly, using the right gadget, we may argue that these three vertices cannot assume the color c 1 all at the same time. This means the values of xi s (corresponding to this coloring) form a solution for the NAE 3-SAT problem. Conversely, if the NAE 3-SAT problem has a solution we may Mr -color G as follows: color any vertex in each clique Si with i and color xi with c 0 or c 1 depending on whether xi = 0 or xi = 1. It is easy to see that each gadget has an Mr -coloring based on the lists of permitted colors of its vertices (i.e., the labels of its vertices in Fig. 3) given that not all its three top vertices assume the same color. This provides a reduction from the NAE 3-SAT to the Mr -coloring problem and we are done. □ Now we need a tool developed in [6]. By graph class we mean a set of graphs. We say two graph classes ˜ S and ˜ D form a sparse-dense pair if there exists a constant d such that no two graphs GS ∈ ˜ S and GD ∈ ˜ D can share more than d vertices, i.e., there are no sets U ⊆ V (GS ) and U ′ ⊆ V (GD ) with |U | = |U ′ | = d + 1 such that GS [U ] is isomorphic to GD [U ′ ]. We say a partition {VS , VD } of V (G) is a sparse-dense partition if ˜ S and ˜ D form a sparse-dense pair and G[VS ] ∈ ˜ S and G[VD ] ∈ ˜ D. Theorem 2.3 ([6]). Having fixed a sparse-dense pair ˜ S and ˜ D with the constant d, a graph G with n vertices has at most n2d different sparse-dense partitions. Furthermore, all such partitions can be found in time n2d+2 T (n), where T (n) is the time needed for deciding whether a subgraph of G belongs to ˜ S or ˜ D. Relevant to our purpose is to consider the class S˜k of graphs that are k-colorable, for some k ≥ 1, ˜l of graphs whose complement graphs are l-colorable, for some l ≥ 1. A simple and the class D argument based on the pigeonhole principle shows that any k-colorable graph with its complement
˜l form a sparse-dense pair. being l-colorable cannot have more than kl vertices. This means S˜k and D By applying the above theorem we get: Lemma 2.4. For a 01-diagonal matrix M, let M0 and M1 be the principal submatrices consisting of all the 0-diagonal rows and all the 1-diagonal rows, respectively. Suppose M(x, y) = ∗ for every row x in M0 and every row y in M1 . If both the M0 -coloring and M1 -coloring problems can be solved in polynomial time then the M-coloring problem can also be solved in polynomial time.
184
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
Proof. Let k and l be the size of M0 and M1 , respectively. Given an M-coloring f of a graph G, let VS and VD be the set of vertices whose colors are in M0 and the set of vertices whose colors are in M1 , respectively. This implies that the subgraphs G[VS ] and G[VD ] are M0 -colored and M1 -colored, respectively. This means G[VS ] and the complement of G[VD ] are k-colorable and l-colorable, respec˜l tively. Thus VS , VD is a sparse-dense partition of G (with respect to the sparse-dense pair S˜k and D defined above). Theorem 2.3 implies that we have polynomially many choices for the partition {VS , VD } and, recalling the fact that the M0 -coloring and M1 -coloring problems are both solvable in polynomial time, all such partitions can be generated in polynomial time. Lets fix a partition {VS , VD }. Considering the fact that M(x, y) = ∗ for every color x in M0 and every color y in M1 , to M-color G is to M0 -color the subgraph G[VS ] and M1 -color the subgraph G[VD ] independently, and both tasks can be accomplished in polynomial time. □ Given a matrix M and two distinct colors c and c ′ of it, we say c ′ is more relaxed than c if M(c , c) = M(c ′ , c ′ ) = M(c , c ′ ) and for any color x ∈ [m] \ {c , c ′ } we have M(c ′ , x) = M(c , x) or M(c ′ , x) = ∗. Based on this definition, it is obvious that in any M-coloring of a graph G, the color of any vertex colored with c can be replaced with c ′ without causing any problem. This means: Observation 2.5. Suppose in a matrix M1 a color c ′ is more relaxed than another color c. Let M2 be the matrix obtained from M1 by removing the row and column c. Then a graph is M1 -colorable if and only if it is M2 -colorable. Theorem 2.6. There exists a 01-diagonal principal supermatrix M ′ of Mr , where Mr is as defined in the beginning of this section (see Fig. 2), for which the M ′ -coloring problem can be solved in polynomial time. Proof. For each color c in Tr define a new color c ′ which is called the dual of c. Let M ′ be the matrix corresponding to all the colors in Tr and their duals. (So M ′ is a principal supermatrix of Mr . The dual color c ′ follows the same coloring rules as c in Tr , i.e., M ′ (c ′ , c ′ ) = Mr (c , c), and for any color x in Tr we have M ′ (c ′ , x) = Mr (c , x). Also for any two distinct colors c1 and c2 in Tr we have M ′ (c1′ , c2′ ) = Mr (c1 , c2 ). But for any dual color c ′ and any color x in Mr which is not in Tr (i.e., 0-colors of Mr ) we define M ′ (c ′ , x) = ∗. Note that for any color c in Tr , the dual color c ′ is more relaxed than c. Thus, by applying Observation 2.5, we may conclude that the M ′ -coloring problem is equivalent to the M ′′ -coloring problem, where M ′′ is obtained from M ′ by removing all the colors in Tr (but not their dual colors). Let M0 and M1 be the set of 0-colors and 1-colors of M ′′ , respectively. Note that M1 consists entirely of the dual colors (of the colors in Tr ), and based on their definition we have M ′′ (x, y) = ∗ for any color x in M0 and any color y in M1 . Also note that the matrix M1 is ∗-free, and it is known that in this case the M1 -coloring problem can be solved in polynomial time [8,6]. As for the M0 -coloring problem, note that the graph with the ∗-adjacency matrix M0 is shown in Fig. 2 (the graph whose vertices are the small black circles). Note that this graph is bipartite, as we can group the sets B, B0 and B1 as one part and the sets W 0 and W 1 as another part. Then, according to [9], the M0 -coloring problem can be solved in polynomial time (in fact it is equivalent to check whether the input graph is bipartite, see also [8]). Now applying Lemma 2.4 implies that the M ′′ -coloring problem, and thus the M ′ -coloring problem, can be solved in polynomial time and the theorem follows. □ Corollary 2.7. The monotonicity property does not hold for M-coloring problems, unless P = NP. 3. Special cases of the submatrix M We say a matrix M has the monotonicity property if the M ′ -coloring problem is NP-complete for any principal supermatrix M ′ of M (including the matrix M itself). The result of the previous section implies that the M-coloring problem being NP-complete does not guarantee that M has the monotonicity property (unless P = NP). So it would be interesting to identify matrices with the monotonicity property. In this section we take some steps in this direction. As a useful tool for this purpose, we have the following simple observation:
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
185
Observation 3.1. If the monotonicity property holds for a matrix M then it also holds for any principal supermatrix of M.
¯ is defined as the matrix obtained from M by turning each of For any matrix M, its complement M its 0 entries to a 1 entry and each of its 1 entries to a 0 entry (we leave the ∗ entries intact). It is easy ¯ to see that a graph is M-colorable if and only if its complement is M-colorable. This implies that the ¯ M-coloring problem is NP-complete if and only if the M-coloring problem is so. This gives us another simple but useful tool: Observation 3.2. If the monotonicity property holds for a matrix M then it also holds for the complement of M. As seen in Introduction, if M is a 0-diagonal 1-free matrix then the M-coloring problem is equivalent to the H-coloring problem, where H is the graph with the ∗-adjacency matrix M. A result of Hell and Ne˜set˜ril [9] states that, for graphs H without loops, the H-coloring problem can be solved in polynomial time if H is bipartite, and is NP-complete if H is non-bipartite. Note that H is nonbipartite if it contains an odd cycle. So this result implies that containing an odd cycle makes the H-coloring problem NP-complete. It is natural to ask whether the same property holds for the M-coloring problem, i.e., whether the ∗-adjacency matrix of an odd cycle without loops has the monotonicity property. In Theorem 3.4 we prove that it is indeed the case. But before that we need to introduce some tools. For the sake of convenience, we call the ∗-adjacency matrix of an odd cycle without loops an oddcycle matrix and the complement of such matrix an anti-odd-cycle matrix. By digraph we mean a graph with a direction assigned to each of its edges. (A directed edge is called an arc.) Suppose a digraph D, with possibly loops and multi-arcs, is given. For two vertices u, v ∈ V (D) we write u → v if there is an arc in D directed from u to v , and otherwise we write u ̸ → v . We say D has the transitive property if for any three vertices u, v, w ∈ V (D) (not necessarily distinct), the conditions u → v and v → w imply u → w . A vertex s ∈ V (D) is called a semi-sink if for any vertex v ∈ V (D), the condition s → v implies v → s. Lemma 3.3. Any digraph D with the transitive property and at least one vertex has a semi-sink. Proof. We use induction on the number of vertices. If D consists of only one vertex then trivially that vertex is a semi-sink for D. Suppose D consists of n ≥ 2 vertices v1 , v2 , . . . , vn . Let D′ be the digraph obtained from D by removing the vertex v1 . By induction hypothesis, we may assume that D′ has a semi-sink s. If s ̸ → v1 then it is easy to see that s is also a semi-sink for D. So suppose s → v1 . We claim that v1 is a semi-sink for D. Let v ∈ V (D) be a vertex for which v1 → v . If v ∈ {v1 , s} then obviously we have v → v1 and the semi-sink condition is satisfied. Otherwise, by applying the transitive property of D in this case and the assumption that s → v1 , we get s → v . The fact that s is a semi-sink of D′ implies that v → s. Again, by applying the transitive property of D in this case and the assumption that s → v1 , we get v → v1 . This proves v1 fulfills the condition for being a semi-sink in D. □ Theorem 3.4. Suppose a 01-diagonal matrix M contains an odd-cycle matrix as a principal submatrix. Then the M-coloring problem is NP-complete. Proof. Let ˜ H be the set of all non-bipartite graphs H without loops whose ∗-adjacency matrix is a principal submatrix of M. The existence of an odd-cycle principal submatrix of M implies that ˜ H ̸ = ∅. Let D be the digraph whose vertices are the graphs in ˜ H and for any two graphs H , H ′ ∈ ˜ H, we draw an arc directed from H to H ′ if and only if H is homomorphic to H ′ (i.e., H is H ′ -colorable). It is easy to see that D has the transitive property, and thus by applying Lemma 3.3 we conclude that D has a semi-sink S. Note that since S is non-bipartite, according to [9], the S-coloring problem is NP-complete. Now we reduce the S-coloring problem to the M-coloring problem. Let G be an arbitrary graph. For any two graphs H and H ′ we denote by H + H ′ the disjoint union of H and H ′ (i.e., V (H + H ′ ) = V (H) ∪ V (H ′ ) and E(H + H ′ ) = E(H) ∪ E(H ′ )). Recall that m is the size of M. Let G′ be the disjoint union of m + 1 copies of G + S. We claim that G′ is M-colorable if and only if G is S-colorable, and this proves the reduction.
186
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
The reverse direction is trivial, as any S-coloring of G can be easily extended to an S-coloring for G + S, and then to G′ . Now we focus on the forward direction. Let f be an M-coloring of G′ . Let M ′ be the principal submatrix of M consisting of all the colors c used by f (i.e., c = f (v ) for some v ∈ V (G′ )). Then note that f is indeed an M ′ -coloring of G′ . A color c in M ′ is said to be problematic if there exists a color c ′ in M ′ , not necessarily distinct from c, such that M ′ (c , c ′ ) = 1. Now suppose, in the coloring f of the graph G′ , the color c ′ appears in a certain copy of G + S (recall that G′ is the disjoint union of m + 1 copies of G + S). Then the color c cannot appear in any other copy of G + S, as all these copies are disjoint. This means any problematic color c appears in exactly one copy of G + S. Now since the number of these copies is larger than the number of colors (of M ′ ), there must be a copy C (of G + S) without any problematic color in it. This means C is M0 -colored, where M0 is the principal submatrix of M ′ consisting of all the non-problematic colors. Note that M0 is 1-free, as it contains no problematic color. Considering the fact that M is 01-diagonal, we may conclude that M0 is the ∗-adjacency matrix of a graph H with no loops. Thus the graph C , or equivalently the graph G + S, is H-colored. Thus both G and S are H-colorable. Suppose H is a bipartite graph with parts V1 and V2 . For an H-coloring of S, let W1 (W2 , respectively) be the set of vertices of S whose colors are in V1 (in V2 , respectively). Then W1 and W2 form a bipartite partition for S, which is a contradiction as S is non-bipartite. This means H is also non-bipartite, and thus a vertex of the digraph D. The fact that S is a semi-sink of D, along with the fact that S is H-colorable (or S → H) imply that H is also S-colorable (or H → S). This fact combined with the fact that G is H-colorable imply that G is S-colorable. □ So, according to the above theorem, the odd-cycle matrices have the monotonicity property. Applying Observations 3.1 and 3.2 we obtain: Corollary 3.5. Any matrix having an odd-cycle matrix or an anti-odd-cycle matrix as a principal submatrix has the monotonicity property.
4. Special cases of the supermatrix M ′ In this section we focus on the special cases of the supermatrix M ′ . In other words, for a given matrix M with the M-coloring problem being NP-complete, we are interested in identifying those principal supermatrices M ′ of M for which the M ′ -coloring problem is also NP-complete. We remark that based on Corollary 2.7 not all supermatrices M ′ of M necessarily have this property (unless P = NP). Given a principal supermatrix M ′ (of M), let T be the principal submatrix of M ′ consisting of all the rows that are not in M, and let B be the submatrix (not principal) consisting of the rows of M and columns of T . So the matrix M ′ can be partitioned into two principal submatrices M and T , with the submatrices B and Bt between these two. This structure of M ′ is depicted in Fig. 4. As a special case of M ′ , we consider the case when the submatrix B entirely consists of 0 entries. In this case we say the principal submatrices M and T form a 0-partition for M ′ , and we write M ′ = 0(M , T ). This situation somehow represents a separation, in the sense of non-adjacency, between the colors of M and the colors of T . We ask whether for any matrix M and T , the 0(M , T )-coloring problem is NP-complete if the M-coloring problem is so. In the rest of this section we prove an affirmative answer to this question in the case that T is 1-diagonal. Studying other cases of matrices T and B is left as a prospective problem. An m1 × m1 matrix M1 is said to be homomorphic to an m2 × m2 matrix M2 if there exists a function f : [m1 ] → [m2 ] such that for any two rows i, j ∈ [m1 ] (not necessarily distinct) we have the following properties: 1) if M1 (i, j) = 1 then M2 (f (i), f (j)) is either 1 or ∗, 2) if M1 (i, j) = 0 then M2 (f (i), f (j)) is either 0 or ∗, and 3) if M1 (i, j) = ∗ then M2 (f (i), f (j)) = ∗. In this case f is called a homomorphic function. Note that if in a given M1 -coloring of a graph G we change any color c to f (c) then we obtain an M2 -coloring of G. Thus: Observation 4.1. Suppose a matrix M1 is homomorphic to a matrix M2 . If a graph G is M1 -colorable then it is also M2 -colorable.
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
187
Fig. 4. The structure of the supermatrix M ′ .
Lemma 4.2. For any 0 < α < 1 there exists an integer nα > 1 (depending only on α ) and a bipartite graph Gα with each part having nα vertices such that any induced subgraph containing at least α · nα vertices of each part is neither a complete bipartite graph nor an independent set. Proof. Let V1 and V2 be two distinct vertex sets, each having n = nα vertices and containing no edges. In the proof we will determine the value of n in terms of α . We consider the class ˜ G of all 2 labeled bipartite graphs with parts V1 and V2 . Note that |˜ G| = 2n . Let k = ⌈α n⌉. We say a labeled graph G ∈ ˜ G is unfavorable if for some sets S1 ⊆ V1 and S2 ⊆ V2 with |S1 | = |S2 | = k the induced sub-graph G[S1 ∪ S2 ] is either a complete bipartite graph or an independent set. Note that each such 2
2
pair S1 , S2 of sets produces 2n −k +1 unfavorable labeled graphs in ˜ G. To see this, note that for each pair (x, y) ∈ V1 × V2 \ S1 × S2 we have two options of choosing an edge or a non-edge, which gives us 2n
2 −k2
choices, and combined with the two choices for the labeled graph G[S1 ∪ S2 ] to be either a
n complete bipartite ( n )2 graph or an independent set, we get 2 pairs S1 , S2 is k . So if the inequality 2
2n > 2n
2 −k2 +1
·
2 −k2 +1
choices in total. Now the number of
( n )2 k
holds then this means there exists at least one(favorable (= non unfavorable) labeled graph in ˜ G and ) n the lemma follows. Using the estimation 2n ≥ k , the above inequality holds if k2 − 1 > 2n, and this latter inequality holds if (α n)2 > 3n, which requires n > 3/α 2 . So by setting n = ⌊3/α 2 ⌋ + 1 we are done. □ For a 1-diagonal matrix T and a number 0 < α < 1, the α -mask of T is a graph constructed as follows: for each row i of T consider a clique Si with nα vertices (where nα is the parameter defined in Lemma 4.2). For two distinct rows i and j of T , if T (i, j) = 1 then we connect all vertices of Si to all vertices of Sj , if T (i, j) = 0 then we connect no vertex in Si to any vertex in Sj , and if T (i, j) = ∗ then we draw edges between Si and Sj in such a way that the bipartite graph produced by the parts Si and Sj (ignoring the edges within the sets Si and Sj for a moment) is isomorphic to the graph Gα constructed in Lemma 4.2. Note that in the last case we could have more than one choice for drawing edges, and thus technically speaking we have a group of α -masks. But in the rest of this section, by the α -mask we mean one arbitrary such graph. Lemma 4.3. The α -mask of a 1-diagonal matrix T is connected if T has no 0-partition 0(T1 , T2 ) with both T1 and T2 having size ≥ 1.
188
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
Proof. Suppose in contrary that the α -mask H can be partitioned into two (non-empty) graphs H1 and H2 with no edges between them. Then note that each clique Si in H (for any row i of T ) has to be either entirely in H1 or entirely in H2 . For j = 1, 2, let Tj be the principal submatrix of T consisting of the rows i for which Si ⊆ Hj . Then T = 0(T1 , T2 ), which is a contradiction. □ Lemma 4.4. Given a 1-diagonal matrix T and a matrix X with size x, suppose there exists an X -coloring f for the α -mask H of T , where 0 < α ≤ 1/x. Then T is homomorphic to a principal submatrix X ′ of X . Furthermore, in the coloring f , any color in X ′ appears in at least one vertex of H. Proof. Considering the coloring f , for each row i in T define g(i) as the color that appears most among the vertices of the clique Si (if there was more than one color with this property then choose one of them arbitrarily). Let X ′ be the principal submatrix of X whose set of rows is the range of the function g. Now we claim that g is a homomorphic function from the rows of T to the rows of X ′ , and the lemma will follow. To prove this claim, let i and j be two colors of T (not necessarily distinct). Let u ∈ Si and v ∈ Sj be two arbitrary vertices of H with f (u) = g(i) and f (v ) = g(j). Note that we may assume u and v are distinct, for even if i = j we still have more than one vertex in Si with the color g(i) (according to the definition of g(i)). Note that if T (i, j) = 1 (T (i, j) = 0, respectively) then u and v are adjacent (nonadjacent, respectively), and this implies that X ′ (g(i), g(j)) ∈ {∗, 1} (X ′ (g(i), g(j)) ∈ {∗, 0}, respectively). Now suppose T (i, j) = ∗. Let Si′ ⊆ Si and Sj′ ⊆ Sj be the set of vertices having the color g(i) and g(j), respectively. Note that, based on the definition, we have |Si′ | ≥ |Si |/x ≥ α|Si | and |Sj′ | ≥ |Sj |/x ≥ α|Sj |. Combining this fact with the fact that the bipartite graph H [Si ∪ Sj ] (ignoring the edges in the sets Si and Sj for a moment) is isomorphic to the graph Gα (of Lemma 4.2) implies that there exist vertices x, y ∈ Si′ and x′ , y′ ∈ Sj′ such that xx′ ∈ E(H) and yy′ ̸ ∈ E(H). This implies X ′ (g(i), g(j)) can only be ∗. So the function g is indeed a homomorphic function. □ Theorem 4.5. Let M be a matrix for which the M-coloring problem is NP-complete, and let T be a 1diagonal matrix. Then the 0(M , T )-coloring problem is also NP-complete. Proof. Suppose T is homomorphic to one of its proper principal submatrices T ′ . Then applying Observation 4.1 implies that the 0(M , T )-coloring problem is equivalent to the 0(M , T ′ )-coloring problem. Thus, w.l.o.g., we may assume that T is homomorphic to none of its proper principal submatrices, or in other words, it is minimal with respect to homomorphism. Also note that, w.l.o.g., we may assume that T has no 0-partition 0(T1 , T2 ) with both matrices T1 and T2 having size ≥ 1; for otherwise we may first consider the theorem for the matrix M1 = 0(M , T1 ) and then for the matrix 0(M1 , T2 ) (which is the matrix 0(M , T )). So having these assumptions (T being minimal and having no non-trivial 0-partition), we reduce the M-coloring problem to the 0(M , T )-coloring problem. Let m and t be the size of M and T , respectively. Let G be an arbitrary graph and H the α -mask of T , where α = 1/max{m, t }. We claim that the disjoint union G + H is 0(M , T )-colorable if and only if G is M-colorable, and this proves our reduction. The reverse direction is easy to prove: by assigning the color i to each vertex in the clique Si (for all the rows i of T ) we obtain a T -coloring of H and putting this coloring and an M-coloring of G together yields a 0(M , T )-coloring for G + H. Now suppose G + H is 0(M , T )-colorable, and let f be such a coloring. This coloring induces a vertex partition {V1 , V2 } of V (G + H), where V1 (V2 , respectively) is the set of vertices whose color is in M (in T , respectively). Note that there can be no edge between the sets V1 and V2 due to the coloring rules of 0(M , T ). Let G1 = G[V (G) ∩ V1 ] and G2 = G[V (G) ∩ V2 ]. The assumption that T has no non-trivial 0-partition along with Lemma 4.3 imply that the graph H is connected. This means H is either entirely in part V1 or entirely in part V2 . We treat these two cases separately: Case 1: V (H) ⊆ V1 : This means H is M-colored. Let MH be the set of colors of M which appear in at least one vertex of H. By applying Lemma 4.4 (for X = MH ) we may conclude that T is homomorphic to MH . Considering Observation 4.1 and the fact that G2 is T -colored (by f ), we get that G2 is MH -colorable. Let f ′ be an MH -coloring of G2 . Note that for any color c in MH and any color c ′ used by f for at least one vertex of G1 we have M(c , c ′ ) ̸ = 1, as there is no edge between graphs G1 and H. Considering the fact that there is also no edge between graphs G1 and G2 , we may conclude that by putting f and f ′ together we obtain an M-coloring for G = G1 + G2 .
P. Valadkhan, M.-J. Davari / European Journal of Combinatorics 70 (2018) 178–189
189
Case 2: V (H) ⊆ V2 : In this case H is T -colored, and applying Lemma 4.4 (for X = T ) implies that T is homomorphic to some principal submatrix T ′ of T and any color in T ′ appears in at least one vertex of H. Recalling the assumption of minimality for T we get T ′ = T . This means any color i in T appears in at least one vertex vi of H. This leads us to a contradiction if we consider i as the color of an arbitrary vertex v of G2 , as v and vi are non-adjacent while T (i, i) = 1. The only way to avoid this contradiction is that G2 has no vertex at all, i.e., G1 = G, which means G is M-colored (by f ). □ 5. Open problems and future work Note that for matrices Mr constructed in Section 2, the Mr -coloring problem is NP-complete while Mr does not contain any odd-cycle or anti-odd-cycle matrix as a principal submatrix (to see this, recall that the 0-diagonal rows of Mr form the ∗-adjacency matrix of a bipartite graph and the 1-diagonal rows are *-free). This implies that, in contrast to H-coloring problems, odd cycles are not the only structures that make the M-coloring problem NP-complete. It is interesting to see whether this contrast with H-coloring problems is still the case if we limit ourselves to 0-diagonal matrices. In other words, we ask whether there is a 0-diagonal matrix M without any odd-cycle matrix as a principal submatrix such that the M-partition problem is NP-complete. The construction of Section 2 produces a family of matrices Mr for which the monotone property does not hold (unless P = NP). But note that all such matrices Mr have both 0 and 1 on the main diagonal. This motivates the question whether any 0-diagonal matrix M for which the M-coloring problem is NP-complete has the monotone property. Combining Theorem 3.4 and the fact that, assuming P ̸ = NP, the H-coloring problem is NP-complete if and only if H contains an odd cycle [9], we can give an affirmative answer to this question in the special case of 0-diagonal 1-free matrices: Corollary 5.1. The monotone property holds for any 0-diagonal 1-free (or 1-diagonal 0-free) matrix M for which the M-coloring problem is NP-complete. In general it would be interesting to identify more matrices with the monotone property. In particular, we ask if there is any 0-diagonal matrix other than odd-cycle matrices that has the monotone property. References [1] J.A. Bondy, U.S.R. Murty, Graph Theory with Applications, Macmillan London, 1976. [2] K. Cameron, E.M. Eschen, Ch.T. Hoàng, R. Sritharan, The complexity of the list partition problem for graphs, SIAM J. Discrete Math. 21 (4) (2007) 900–929. [3] T. Feder, P. Hell, List homomorphisms to reflexive graphs, J. Combin. Theory Ser. B 72 (2) (1998) 236–250. [4] T. Feder, P. Hell, Matrix partitions of perfect graphs, Discrete Math. 306 (19–20) (2006) 2450–2460. [5] T. Feder, P. Hell, J. Huang, Bi-arc graphs and the complexity of list homomorphisms, J. Graph Theory 42 (1) (2003) 61–80. [6] T. Feder, P. Hell, S. Klein, R. Motwani, List partitions, SIAM J. Discrete Math. 16 (3) (2003) 449–478. [7] M.R. Garey, D.S. Johnson, Computers and Intractability, Freeman, 1979. [8] P. Hell, Graph partitions with prescribed patterns, European J. Combin. 35 (2014) 335–353. [9] P. Hell, J. Ne˜set˜ril, On the complexity of h-coloring, J. Combin. Theory Ser. B 48 (1) (1990) 92–110. [10] P. Hell, J. Ne˜set˜ril, Graphs and Homomorphisms, Oxford University Press, 2004.