On the Complexity of Matching Cut in Graphs of Fixed ... - DROPS

5 downloads 83 Views 479KB Size Report
Martin Davis and Hilary Putnam. A computing procedure for quantification theory. J. ACM, 7(3):201–215, 1960. doi:10.1145/321033.321034. 9. David Eppstein.
On the Complexity of Matching Cut in Graphs of Fixed Diameter Hoang-Oanh Le1 and Van Bang Le2 1 2

Berlin, Germany Universität Rostock, Institut für Informatik, Rostock, Germany [email protected]

Abstract In a graph, a matching cut is an edge cut that is a matching. Matching Cut is the problem of deciding whether or not a given graph has a matching cut, which is known to be NP-complete even when restricted to bipartite graphs. It has been proved that Matching Cut is polynomially solvable for graphs of diameter two. In this paper, we show that, for any fixed integer d ≥ 4, Matching Cut is NP-complete in the class of graphs of diameter d. This almost resolves an open problem posed by Borowiecki and Jesse-Józefczyk in [Matching cutsets in graphs of diameter 2, Theoretical Computer Science 407 (2008) 574–582]. We then show that, for any fixed integer d ≥ 5, Matching Cut is NP-complete even when restricted to the class of bipartite graphs of diameter d. Complementing the hardness results, we show that Matching Cut is in polynomial-time solvable in the class of bipartite graphs of diameter at most three, and point out a new and simple polynomial-time algorithm solving Matching Cut in graphs of diameter 2. 1998 ACM Subject Classification F.2.2 [Analysis of Algorithms and Problem Complexity] Nonnumerical Algorithms and Problems, G.2.2 [Discrete Mathematics] Graph Theory Keywords and phrases matching cut, NP-hardness, graph algorithm, computational complexity, decomposable graph Digital Object Identifier 10.4230/LIPIcs.ISAAC.2016.50

1

Introduction

In a graph G = (V, E), a cut is a partition V = X ∪˙ Y of the vertex set into disjoint, nonempty sets X and Y , written (X, Y ). The set of all edges in G having an endvertex in X and the other endvertex in Y , also written (X, Y ), is called the edge cut of the cut (X, Y ). A matching cut is an edge cut that is a (possibly empty) matching. Note that, by our definition, a matching whose removal disconnects the graph need not be a matching cut. Another way to define matching cuts is as follows ([13, 7]). A partition V = X ∪˙ Y of the vertex set of the graph G = (V, E) into disjoint, nonempty sets X and Y , is a matching cut if and only if each vertex in X has at most one neighbor in Y and each vertex in Y has at most one neighbor in X. Graham [13] studied matching cuts in graphs in connection to a number theory problem called cube-numbering. In [12], Farley and Proskurowski studied matching cuts in the context of network applications. Patrignani and Pizzonia [17] pointed out an application of matching cuts in graph drawing. Matching cuts have been used by Araújo et al. [1] in studying good edge-labellings in the context of WDM (Wavelength Division Multiplexing) networks. Not every graph has a matching cut; the Matching Cut problem is the problem of deciding whether or not a given graph has a matching cut: © Hoang-Oanh Le and Van Bang Le; licensed under Creative Commons License CC-BY 27th International Symposium on Algorithms and Computation (ISAAC 2016). Editor: Seok-Hee Hong; Article No. 50; pp. 50:1–50:12 Leibniz International Proceedings in Informatics Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany

50:2

On the Complexity of Matching Cut in Graphs of Fixed Diameter

Matching Cut Instance: Question:

A graph G = (V, E). Does G have a matching cut?

This paper considers the computational complexity of the Matching Cut problem in graphs of fixed diameter. Previous results. Graphs admitting a matching cut were first discussed by Graham in [13] under the name decomposable graphs. The first complexity and algorithmic results for Matching Cut have been obtained by Chvátal, who proved in [7] that Matching Cut is NP-complete, even when restricted to graphs of maximum degree four and polynomially solvable for graphs of maximum degree at most three. These results triggered a lot of research on the computational complexity of Matching Cut in graphs with additional structural assumptions; see [5, 6, 14, 15, 16, 17]. In particular, the NP-hardness of Matching Cut has been further strengthened for planar graphs of maximum degree four ([5]) and bipartite graphs of maximum degree four ([15]). On the positive side, among others, an important polynomially solvable case has been established by Borowiecki and Jesse-Józefczyk, who proved in [6] that Matching Cut is polynomially solvable for graphs of diameter 2. They also posed the problem of determining the largest integer d such that Matching Cut is solvable in polynomial time for graphs of diameter d. Our contributions. We prove that Matching Cut is NP-complete, even when restricted to graphs of diameter d, for any fixed integer d ≥ 4. Thus, unless NP = P, Matching Cut cannot be solved in polynomial time for graphs of diameter d, for any fixed d ≥ 4. This mostly resolves the open problem posed by Borowiecki and Jesse-Józefczyk mentioned above. Actually, we show a little more: Matching Cut is NP-complete in graphs of diameter 4 and remains NP-complete in bipartite graphs of fixed diameter d ≥ 5. Complementing our hardness results, we show that Matching Cut can be solved in polynomial time in bipartite graphs of diameter at most 3. We also point out a new and simple approach solving Matching Cut in diameter-2 graphs in polynomial time. Notation and terminology. Let G = (V, E) be a graph with vertex set V (G) = V and edge set E(G) = E. An independent set (a clique) in G is a set of pairwise non-adjacent (adjacent) vertices. The neighborhood of a vertex v in G, denoted by NG (v), is the set of all vertices in G adjacent to v; if the context is clear, we simply write N (v). For a subset W ⊆ V , G[W ] is the subgraph of G induced by W , and G − W stands for G[V \ W ]. The complete graph and the path on n vertices is denoted by Kn and Pn , respectively; K3 is also called a triangle. The complete bipartite graph with one color class of size p and the other of size q is denoted by Kp,q . Observe that, for any matching cut (X, Y ) of G, any Kn with n ≥ 3, and any Kp,q with p ≥ 2, q ≥ 3, in G is contained in G[X] or else in G[Y ]. Given a graph G = (V, E) and a partition V = X ∪˙ Y , it can be decided in linear time if (X, Y ) is a matching cut of G. This is because (X, Y ) is a matching cut of G if and only if the bipartite subgraph BG (X, Y ) of G with the color classes X and Y and edge set (X, Y ) is P3 -free. That is, (X, Y ) is a matching cut of G if and only if the non-trivial connected components of the bipartite graph BG (X, Y ) are edges. A path P3 in BG (X, Y ), if any, is called a bad P3 . A bridge in a graph is an edge whose deletion increases the number of the connected components. Since disconnected graphs and graphs having a bridge have a matching cut, we

Hoang-Oanh Le and Van Bang Le

50:3

cj cj1

cj3

qi

vi

pi

ri

qi0

vi0

p0i

ri0

cj2 bj

dj aj

Figure 1 The clause gadget G(Cj ) (left) and the variable gadget G(vi ) (right).

may assume that all graphs considered are connected and 2-edge connected. The distance between two vertices u, v in a (connected) graph G, denoted dist(u, v), is the length of a shortest path connecting u and v. The diameter of G, denoted diam(G), is the maximum distance between all pairs of vertices in G. The paper is organized as follows. In Section 2 we show that Matching Cut is NPcomplete when restricted to bipartite graphs of diameter d, for any fixed integer d ≥ 5. In Section 3 we show that Matching Cut is NP-complete when restricted to graphs of diameter 4. In section 4 we point out a new and simple polynomial time algorithm solving Matching Cut in diameter 2 graphs, and show that Matching Cut can be solved in polynomial time for bipartite graphs of diameter at most 3. We conclude the paper with Section 5.

2

Matching Cut in bipartite graphs of diameter d ≥ 5

In this section we show that, for each fixed d ≥ 5, Matching Cut is NP-complete when restricted to bipartite graphs of diameter d. We first prove this for diameter-5 bipartite graphs by giving a polynomial time reduction from 1-IN-3 3SAT to our problem. The NP-completeness of 1-IN-3 3SAT is proved in [18]. 1-IN-3 3SAT (without negated literals) Instance: Question:

m clauses C1 , . . . , Cm over a set of n Boolean variables v1 , . . . , vn such that each clause has exactly three variables. Is there a truth assignment satisfying all clauses such that each clause has exactly one true variable?

Suppose we are given a formula F with clauses Cj = (cj1 , cj2 , cj3 ), where cj` , 1 ≤ j ≤ m, 1 ≤ ` ≤ 3, are taken from the set of Boolean variables {v1 , . . . , vn }. We will construct, in polynomial time, a bipartite graph G(F ) of diameter 5 such that F ∈ 1-IN-3 3SAT if and only if G(F ) has a matching cut. For each clause Cj = (cj1 , cj2 , cj3 ) we create the 7-vertex graph G(Cj ) as depicted on the left-hand side of Figure 1. The following property of the clause gadget G(Cj ) will be used in the reduction. I Observation 1. In any matching cut (X, Y ) of G(Cj ), cj ∈ X and aj ∈ Y or vice versa. Moreover, G(Cj ) has exactly three matching cuts (X, Y ) with cj ∈ X as depicted in Figure 2. Proof. By inspection.

J

For each Boolean variable vi , 1 ≤ i ≤ n, let G(vi ) be the 8-vertex graph depicted in Figure 1, on the right-hand side.

I S A AC 2 0 1 6

50:4

On the Complexity of Matching Cut in Graphs of Fixed Diameter

cj cj1

cj cj3

cj1

dj

bj

cj2 bj aj

cj cj3

cj1

dj

bj

cj2

cj3 cj2

aj

dj aj

Figure 2 The three matching cuts of the clause gadget: black vertices in X, white vertices in Y .

Finally, the graph G(F ) is obtained by taking all G(Cj ), 1 ≤ j ≤ m, all G(vi ), 1 ≤ i ≤ n, and four new vertices g1 , g2 , h1 , h2 , and by adding edges between cj` and {vi , vi0 }, whenever in clause Cj , cj` is the variable vi , 1 ≤ j ≤ m, 1 ≤ ` ≤ 3 and 1 ≤ i ≤ n, between {g1 , g2 } and {cj | 1 ≤ j ≤ m} ∪ {ri , ri0 | 1 ≤ i ≤ n} (thus, {g1 , g2 } and {cj | 1 ≤ j ≤ m} ∪ {ri , ri0 | 1 ≤ i ≤ n} induce a complete bipartite graph K2,m+2n in G(F )), between {h1 , h2 } and {aj | 1 ≤ j ≤ m} ∪ {qi , qi0 | 1 ≤ i ≤ n} (thus, {h1 , h2 } and {aj | 1 ≤ j ≤ m} ∪ {qi , qi0 | 1 ≤ i ≤ n} induce a complete bipartite graph K2,m+2n in G(F )), g1 h1 and g2 h2 . I Lemma 2. G(F ) is a bipartite graph and has diameter 5. Proof. By construction, the vertices of G(F ) are partitioned into two disjoint independent sets I1 , I2 as follows. I1 = {g1 , g2 } ∪ {aj , cj1 , cj2 , cj3 | 1 ≤ j ≤ m} ∪ {pi , p0i , qi , qi0 | 1 ≤ i ≤ n}, I2 = {h1 , h2 } ∪ {bj , cj , dj | 1 ≤ j ≤ m} ∪ {vi , vi0 , ri , ri0 | 1 ≤ i ≤ n}. That is, G(F ) is bipartite. We now show that diam(G) = 5. Observe first that any vertex x is contained in a 6-vertex cycle Z(x) containing the edge g1 h1 . Indeed, x ∈ {g2 , h2 }: (g1 , c1 , g2 , h2 , a1 , h1 ) is such a cycle Z(x); x ∈ G(Cj ): g1 , h1 and any 4-vertex path in G(Cj ) connecting cj and aj containing x form such a cycle Z(x); x ∈ {vi , ri , pi , qi }: (g1 , ri , pi , vi , qi , h1 ) is such a cycle Z(x); x ∈ {vi0 , ri0 , p0i , qi0 }: (g1 , ri0 , p0i , vi0 , qi0 , h1 ) is such a cycle Z(x). Thus, any two vertices x, y of G(F ) with Z(x) 6= Z(y) belong to a cycle in Z(x) ∪ Z(y) \ {g1 h1 } of length at most 10, hence dist(x, y) ≤ 5. Finally, observe that dist(pi , vk ) = 5 for any i 6= k. J I Lemma 3. Suppose F ∈ 1-IN-3 3SAT. Then G(F ) has a matching cut. Proof. Let b be a truth assignment satisfying all Cj = (cj1 , cj2 , cj3 ) such that exactly one of b(cj1 ), b(cj2 ), b(cj3 ) is true. Partition the vertex set of G(F ) as follows. Initially, set X = {g1 , g2 } ∪ {ri , ri0 | 1 ≤ i ≤ n} ∪ {cj | 1 ≤ j ≤ m} ∪ {cj` | 1 ≤ j ≤ m, 1 ≤ ` ≤ 3, b(cj` ) = false}. Next, extend X to other vertices of G(Cj ) as indicated in Figure 2. That is, for each 1 ≤ j ≤ m,

Hoang-Oanh Le and Van Bang Le

50:5

if b(cj1 ) = b(cj2 ) = false, then X := X ∪ {bj }, if b(cj2 ) = b(cj3 ) = false, then X := X ∪ {dj }. Finally, extend X to other vertices of G(vi ) as follows. For each 1 ≤ i ≤ n, if b(vi ) = false, then X := X ∪ {vi , vi0 , pi , p0i }. Set Y := V (G(F )) \ X, or explicitly in closed form, Y = {h1 , h2 } ∪ {qi , qi0 | 1 ≤ i ≤ n} ∪ {aj | 1 ≤ j ≤ m} ∪ {cj` | 1 ≤ j ≤ m, 1 ≤ ` ≤ 3, b(cj` ) = true} ∪ {bj | 1 ≤ j ≤ m, b(cj1 ) = true} ∪ {bj , dj | 1 ≤ j ≤ m, b(cj2 ) = true} ∪ {dj | 1 ≤ j ≤ m, b(cj3 ) = true} ∪ {vi , vi0 , pi , p0i | 1 ≤ i ≤ n, b(vi ) = true}. By construction of G(F ) and by definition of X and Y , it is not difficult to see that (X, Y ) is a matching cut of G(F ). I Claim 4. (X, Y ) is a matching cut of G(F ). Due to the space limitation, the proof of Claim 4 is omitted.

J

I Lemma 5. Suppose G(F ) has a matching cut. Then F ∈ 1-IN-3 3SAT. Proof. Let (X, Y ) be a matching cut of G(F ). Recall that each of C = {g1 , g2 } ∪ {cj | 1 ≤ j ≤ m} ∪ {ri , ri0 | 1 ≤ i ≤ n}, A = {h1 , h2 } ∪ {aj | 1 ≤ j ≤ m} ∪ {qi , qi0 | 1 ≤ i ≤ n} induces a K2,m+2n in G(F ), hence C ⊂ X or C ⊂ Y, and A ⊂ X or A ⊂ Y. We claim that all cj belong to X and all aj belong to Y , or vice versa. Suppose for a contrary cj , aj ∈ X for some j. Then, by the facts above, C ∪ A ⊂ X. (The case cj , aj ∈ Y is completely similar.) Then, for all j, V (G(Cj )) ⊂ X (otherwise, V (G(Cj )) ∩ Y 6= ∅ and the restriction of (X, Y ) to G(Cj ) would be a matching cut of G(Cj ) with cj , aj ∈ X, contradicting Observation 1.) This implies that all vi , vi0 , pi , p0i , 1 ≤ i ≤ n, belong to X, too. (This is because vi , vi0 , pi , p0i and the (common) neighbor cj` of vi , vi0 in G(Cj ) for suitable j, ` induce a K2,3 .) Therefore all vertices of G(F ) belong to X and, hence, Y = ∅, a contradiction. Thus, all cj belong to X and all aj belong to Y , or vice versa, as claimed. By symmetry we may assume that all cj ∈ X and all aj ∈ Y . Define a truth assignment b as follows. For each 1 ≤ i ≤ n, b(vi ) = false if vi ∈ X, and b(vi ) = true if vi ∈ Y . We claim that b satisfies all clauses Cj = (cj1 , cj2 , cj3 ) in such a way that exactly one of b(cj1 ), b(cj2 ), b(cj3 ) is true: Consider an arbitrary clause Cj . By our assumption, in G(Cj ), cj ∈ X, aj ∈ Y , and thus the restriction of (X, Y ) to G(Cj ) is a matching cut of G(Cj ). By Observation 1, exactly one of cj1 , cj2 , cj3 is in Y ; see also Figure 2. Thus, F ∈ 1-IN-3 3SAT. J By Lemmas 3, 5 and 2, we conclude I Lemma 6. Matching Cut is NP-complete, even when restricted to bipartite graphs of diameter 5.

ISAAC 2016

50:6

On the Complexity of Matching Cut in Graphs of Fixed Diameter

s1

s2

sd−2

s01

s02

s0d−2

Figure 3 The bipartite chain Bd of d − 3 K2,2 s.

Finally, let d ≥ 6 be a fixed integer, and let Bd be a bipartite chain of d − 3 complete bipartite graphs K2,2 as depicted in Figure 3. Let Gd be obtained by taking G(F ) in Lemma 2 and Bd by identifying the two vertices g1 and s1 , and the two vertices g2 and s01 . Clearly, Gd is bipartite. Recall that dist(x, g1 ) ≤ 3 and dist(x, g2 ) ≤ 3 for all vertices x of G(F ) (cf. the proof of Lemma 2). Hence dist(x, y) ≤ d for all vertices x, y of Gd , and dist(x, y) = d for x = pi and y = sd−2 . Thus, Gd has diameter d. Observe that each vertex of Bd is contained in a K2,3 , hence in any matching cut (X, Y ) of Gd , Bd is contained in Gd [X] or else in Gd [Y ]. Thus, G(F ) has a matching cut if and only if Gd has a matching cut. Hence, Lemma 6 implies I Theorem 7. For each fixed d ≥ 5, Matching Cut is NP-complete, even when restricted to bipartite graphs of diameter d.

3

Matching Cut in graphs of diameter 4

In this section we show that Matching Cut is NP-complete when restricted to graphs of diameter 4. The reduction is again from 1-IN-3 3SAT and is quite similar to that in Section 2. In particular we use the same clause gadget. Suppose we are given a formula F with clauses Cj = (cj1 , cj2 , cj3 ), where cj` ∈ {v1 , . . ., vn }, 1 ≤ j ≤ m, 1 ≤ ` ≤ 3. We will construct, in polynomial time, a graph G(F ) of diameter 4 such that F ∈ 1-IN-3 3SAT if and only if G(F ) has a matching cut. For each clause Cj = (cj1 , cj2 , cj3 ) we create the graph G(Cj ) as depicted in Figure 1, on the left-hand side. For each Boolean variable vi ∈ {v1 , . . . , vn }, let G(vi ) be the 4-cycle with vertices vi , vi0 , qi , qi0 and edges vi vi0 , vi0 qi0 , qi0 qi , qi vi . Finally, the graph G(F ) is obtained by taking all G(Cj ), 1 ≤ j ≤ m, all G(vi ), 1 ≤ i ≤ n, and by adding edges between cj` and vi , vi0 , whenever in clause Cj , cj` is the variable vi , 1 ≤ j ≤ m, 1 ≤ ` ≤ 3 and 1 ≤ i ≤ n, between the vertices c1 , . . . , cm (thus, {c1 , . . . , cm } is a clique in G(F )), between the vertices a1 , . . . , am , q1 , . . . , qn , q10 , . . . , qn0 (thus, {aj | 1 ≤ j ≤ m} ∪ {qi | 1 ≤ i ≤ n} ∪ {qi0 | 1 ≤ i ≤ n} is a clique in G(F )). Informally, G(F ) is obtained from the bipartite graph constructed in Section 2 by deleting the vertices g1 , g2 , h1 , h2 , pi , p0i , ri , ri0 (1 ≤ i ≤ n) and adding an edge between vi and vi0 (1 ≤ i ≤ n), and making {cj | 1 ≤ j ≤ m} to a clique, and {aj | 1 ≤ j ≤ m} ∪ {qi , qi0 | 1 ≤ i ≤ n} to a clique. I Lemma 8. G(F ) has diameter 4.

Hoang-Oanh Le and Van Bang Le

50:7

Proof. Let x, y be two distinct vertices of G(F ). We will see that the distance between x and y is at most 4. First, note that G(Cj ) has diameter 3, G(vi ) has diameter 2, and recall that {c1 , . . . , cm }, as well as {a1 , . . . , am } ∪ {qi , qi0 | 1 ≤ i ≤ n} are two cliques in G(F ), and that each vertex of {vi , vi0 } is adjacent to a vertex in {qi , qi0 }. Hence we need only to consider three cases: Case 1. x ∈ G(Cj ) and y ∈ G(Ck ) with j 6= k: In this case, x and y belong to a cycle of length 8: a 4-vertex path in G(Cj ) connecting cj and aj containing x and a 4-vertex path in G(Ck ) connecting ck and ak containing y form, with the edges cj ck and aj ak , a cycle of length 8. Hence dist(x, y) ≤ 4. Case 2. x ∈ G(vi ) and y ∈ G(vt ) with i 6= t: In this case, dist(x, y) ≤ 3 because qi , qi0 , qt , qt0 are pairwise adjacent. Case 3. x ∈ G(Cj ) and y ∈ G(vi ): If x 6= cj , then dist(x, aj ) ≤ 2 and, as aj is adjacent to qi , qi0 , dist(aj , y) ≤ 2, hence dist(x, y) ≤ dist(x, aj ) + dist(aj , y) ≤ 4. So, let x = cj . If y ∈ {qi , qi0 }, then, as y is adjacent to aj , dist(x, y) ≤ dist(cj , aj ) + 1 = 4. So, it remains the case x = cj , y ∈ {vi , vi0 }. Let k and ` be such that vi = ck` . Then (y, ck` , ck , x) is a 4-vertex path, hence dist(x, y) ≤ 3. Finally, note that dist(b1 , b2 ) = 4. J I Lemma 9. Suppose F ∈ 1-IN-3 3SAT. Then G(F ) has a matching cut. Proof. Let b be a truth assignment satisfying all Cj = (cj1 , cj2 , cj3 ) such that exactly one of b(cj1 ), b(cj2 ), b(cj3 ) is true. Partition the vertex set of G(F ) as follows. Initially, set X = {c1 , . . . , cm } ∪ {cj` | 1 ≤ j ≤ m, 1 ≤ ` ≤ 3, b(cj` ) = false}. Next, extend X to other vertices of G(Cj ) as indicated in Figure 2. That is, for each 1 ≤ j ≤ m, if b(cj1 ) = b(cj2 ) = false, then X := X ∪ {bj }, if b(cj2 ) = b(cj3 ) = false, then X := X ∪ {dj }. Finally, extend X to other vertices of G(vi ) as follows. For each 1 ≤ i ≤ n, if b(vi ) = false, then X := X ∪ {vi , vi0 }. Then (X, Y ) is a matching cut of G(F ), where Y = V (G(F )) \ X. We omit the proof since it is similar to that of Lemma 3. J I Lemma 10. Suppose G(F ) has a matching cut. Then F ∈ 1-IN-3 3SAT. Proof. Let (X, Y ) be a matching cut of G(F ). Note that, as C = {cj | 1 ≤ j ≤ m} and A = {aj , qj , qj0 | 1 ≤ j ≤ m} are cliques in G(F ), C ⊂ X or C ⊂ Y, and A ⊂ X or A ⊂ Y. Similar to the proof of Lemma 5, we can show that all cj belong to X and all aj belong to Y , or vice versa. Let C ⊂ X and A ⊂ Y , say. Then, the assignment b with b(vi ) = false if vi ∈ X, and b(vi ) = true if vi ∈ Y satisfies all clauses Cj = (cj1 , cj2 , cj3 ) in such a way that exactly one of b(cj1 ), b(cj2 ), b(cj3 ) is true. Hence, F ∈ 1-IN-3 3SAT. J By Lemmas 9, 10 and 8, we conclude I Theorem 11. Matching Cut is NP-complete when restricted to graphs of diameter 4. With Theorem 7, Matching Cut is NP-complete when restricted to graphs of diameter d for any fixed d ≥ 4.

ISAAC 2016

50:8

On the Complexity of Matching Cut in Graphs of Fixed Diameter

4

Matching Cut in bipartite graphs of diameter at most 3

In this section we prove that Matching Cut can be solved in polynomial time when restricted to bipartite graphs of diameter at most 3. To do this, we first prove a lemma that will be useful in many cases. In particular, we will drive from this lemma a new and simple polynomial-time algorithm solving Matching Cut in graphs of diameter 2.

4.1

A useful lemma

Given a graph G = (V, E) and two disjoint, non-empty vertex sets A, B ⊂ V . We say a matching cut of G is an A-B-matching cut if A is contained in one side and B is contained in the other side of the matching cut. In general, unless NP 6= P, we cannot decide in polynomial time if G admits an A-Bmatching cut for a given pair A, B. However, there are some rules that force certain vertices some of which together with A must belong to one side and the other together with B muss belong to the other side of such a matching cut (if any). We are going to describe such forcing rules. Now assume that A, B are disjoint, non-empty subsets of V (G) such that each vertex in A is adjacent to exactly one vertex of B and each vertex in B is adjacent to exactly one vertex of A. Initially, set X := A, Y := B and write R = V (G) \ (X ∪ Y ). (R1) Let v ∈ R be adjacent to a vertex in A. If v is adjacent to a vertex in B, or adjacent to (at least) two vertices in Y \ B, then G has no A-B-matching cut. (R2) Let v ∈ R be adjacent to a vertex in B. If v is adjacent to a vertex in A, or adjacent to (at least) two vertices in X \ A, then G has no A-B-matching cut. (R3) If v ∈ R is adjacent to (at least) two vertices in X \ A and to (at least) two vertices in Y \ B, then G has no A-B-matching cut. (R4) Let v ∈ R be adjacent to a vertex in A or to (at least) two vertices in X \ A, then X := X ∪ {v}, R := R \ {v}. If v has a unique neighbor w ∈ Y \ B then A := A ∪ {v}, B := B ∪ {w}. (R5) Let v ∈ R be adjacent to a vertex in B or to (at least) two vertices in Y \ B, then Y := Y ∪ {v}, R := R \ {v}. If v has a unique neighbor w ∈ X \ A then B := B ∪ {v}, A := A ∪ {w}. It is obvious that the rules (R1)–(R5) are correct. If none of (R1), (R2) and (R3) is applicable, then each vertex v ∈ R has no neighbor in A or has no neighbor in B, and v has at most one neighbor in X \ A or has at most one neighbor in Y \ B. If (R4) is not applicable, then each vertex v ∈ R has no neighbor in A and at most one neighbor in X \ A. If (R5) is not applicable, then each vertex v ∈ R has no neighbor in B and at most one neighbor in Y \ B. Thus, the following fact holds: I Fact 12. Suppose none of (R1)–(R5) is applicable. Then (X, Y ) is an A-B-matching cut of G[X ∪ Y ], and any A-B-matching cut of G must contain X in one side and Y in other side; for any vertex v ∈ R, N (v) ∩ A = N (v) ∩ B = ∅ and |N (v) ∩ X| ≤ 1, |N (v) ∩ Y | ≤ 1. We say that a subset S ⊆ R is monochromatic if, for any A-B-matching cut of G, all vertices of S belong to the same side.

Hoang-Oanh Le and Van Bang Le

50:9

I Lemma 13. Suppose none of the rules (R1)–(R5) is applicable. Assuming each connected component of G − (X ∪ Y ) is monochromatic, it can be decided in time O(|V |2 |E|) if G admits an A-B-matching cut. Proof. Let Z be a connected component of G−(X ∪Y ), and let (X 0 , Y 0 ) be an A-B-matching cut of G with A ⊆ X 0 and B ⊆ Y 0 . Note, by Fact 12, then X ⊆ X 0 and Y ⊆ Y 0 . Since Z is monochromatic, we have Z ⊆ X 0 whenever some vertex in X \ A has at least two neighbors in Z. Similarly, Z ⊆ Y 0 whenever some vertex in Y \ B has at least two neighbors in Z. If a vertex in X \ A has neighbors in two connected components of G − (X ∪ Y ), then at least one of these components is contained in X 0 . Similarly, if a vertex in Y \ B has neighbors in two connected components of G − (X ∪ Y ), then at least one of these components is contained in Y 0 . Thus, we can decide if G admits a matching cut (X 0 , Y 0 ) such that X ⊆ X 0 , Y ⊆ Y 0 , by solving the following instance F (G) of the 2-SAT problem. For each connected component C of G − (X ∪ Y ), create two Boolean variables xC , yC . The intention is that xC is set to true if C must go to X and yC is set to true if C muss go to Y . Then (xC ∨ yC ) and (¬xC ∨ ¬yC ) are two clauses of the formula F (G). For each connected component C of G − (X ∪ Y ) with |N (v) ∩ C| ≥ 2 for some v ∈ X \ A, (xC ) is a clause of the formula F (G). This clause ensures that in this case, C must go to X. For each connected component C of G − (X ∪ Y ) with |N (w) ∩ C| ≥ 2 for some w ∈ Y \ B, (yC ) is a clause of the formula F (G). This clause ensures that in this case, C must go to Y. For each two connected components C 6= D of G − (X ∪ Y ) having a common neighbor in X \ A, (xC ∨ xD ) is a clause of the formula F (G). This clause ensures that in this case, at least one of C and D must go to X. For each two connected components C 6= D of G − (X ∪ Y ) having a common neighbor in Y \ B, (yC ∨ yD ) is a clause of the formula F (G). This clause ensures that in this case, at least one of C and D must go to Y . I Claim 14. G admits a matching cut (X 0 , Y 0 ) such that X ⊆ X 0 , Y ⊆ Y 0 if and only if F (G) is satisfiable. Due to the space limitation, the proof of Claim 14 is omitted. Note that F (G) has O(|V |) variables and O(|V |2 ) clauses and can be constructed in time O(|V |2 |E|). Since 2-SAT can be solved in linear time (cf. [3, 8, 11]), by Claim 14 we can decide in time O(|V |2 |E|) if G admits an A-B-matching cut. J

4.2

Diameter 2 graphs: A new, simple and faster polynomial-time algorithm

Let G = (V, E) be a graph of diameter 2. Guess an edge ab of G, and apply rules (R1)–(R5) for A := {a}, B := {b} as long as possible. If (R1) or (R2) or (R3) is applicable, then clearly G has no A-B-matching cut. So let us assume that none of (R1), (R2) and (R3) was ever applied and none of (R4) and (R5) is applicable. Then each connected component Z of G − (X ∪ Y ) is monochromatic. To see this, let (X 0 , Y 0 ) be an A-B-matching cut of G with X ⊂ X 0 , Y ⊂ Y 0 . By Fact 12, any vertex in A ∪ B is non-adjacent to any vertex in Z, any vertex in A has neighbors only in X ∪ B, any vertex in B has neighbors only in Y ∪ A. Since

ISAAC 2016

50:10

On the Complexity of Matching Cut in Graphs of Fixed Diameter

G has diameter 2, therefore, N (v) ∩ N (a) 6= ∅ for all v ∈ Z and a ∈ A. Thus, v must have a neighbor in X \ A. Similarly, each vertex v ∈ Z must have a neighbor in Y \ B. Now, suppose for a contrary that Z is not monochromatic. Then, by connectedness, there is an edge uv in Z with u ∈ X 0 and v ∈ Y 0 , say. But then u, v and a neighbor of v in X ⊆ X 0 induce a bad P3 , contradicting the assumption that (X 0 , Y 0 ) is a matching cut. Thus, any connected component of G − (X ∪ Y ) is monochromatic. Therefore, by Lemma 13, it can be decided in time O(|V |2 |E|) if G has an A-B-matching cut. Since we have at most |E| many choices for the edge ab, we conclude that Matching Cut can be solved in time O(|V |2 |E|2 ) for graphs of diameter two. We remark that the known algorithm posed in [6] has slower running time O(|V |2 |E|3 ). Moreover, in comparison to their algorithm, our is much simpler.

4.3

Diameter 3 bipartite graphs

Given a connected bipartite graph G = (V, E) with a bipartition V = V1 ∪˙ V2 into independent sets V1 , V2 . We will use the following fact which is easy to see: G has diameter at most 3 if and only if, for each i = 1, 2

(1)

and for every two vertices u, v ∈ Vi , N (u) ∩ N (v) 6= ∅. Let G have diameter at most 3. Since graphs having a bridge have a matching cut, we may assume that G is 2-edge connected. Hence every matching cut of G, if any, must have at least two edges. Our algorithm consists of two phases. In the phase 1, we will check if G has a matching cut (X, Y ) containing two edges a1 b1 , a2 b2 such that a1 , a2 ∈ V1 , b1 , b2 ∈ V2 and {a1 , b2 } ⊆ X and {a2 , b1 } ⊆ Y . In case phase 1 is unsuccessful, phase 2 will be started. In the phase 2, we will check if G has a matching cut (X, Y ) containing two edges a1 b1 , a2 b2 such that a1 , a2 ∈ V1 , b1 , b2 ∈ V2 and {a1 , a2 } ⊆ X and {b1 , b2 } ⊆ Y . The fact that G has diameter at most 3 will ensure that each of phase 1 and 2 can be performed in polynomial time. Phase 1. Guess two edges a1 b1 , a2 b2 ∈ E such that a1 , a2 ∈ V1 and b1 , b2 ∈ V2 . Set X = A = {a1 , b2 }, Y = B = {a2 , b1 } and write R = V (G) \ (X ∪ Y ). Apply (R1)–(R5) as long as possible, and let us assume that none of (R1), (R2) and (R3) was ever applied. Then each connected component Z of G − (X ∪ Y ) is monochromatic. Indeed, let (X 0 , Y 0 ) be an A-B-matching cut with X ⊆ X 0 , Y ⊆ Y 0 , and consider an arbitrary vertex v ∈ Z. If v ∈ V1 , then, since a1 ∈ A ∩ V1 and a2 ∈ B ∩ V1 , v must have, by (1), a neighbor in X and a neighbor in Y . Similarly, if v ∈ V2 , then, since b1 ∈ A ∩ V2 and b2 ∈ B ∩ V2 , v must have a neighbor in X and a neighbor in Y , too. Thus, every vertex in Z has a neighbor in X and a neighbor in Y . Therefore, by the same argument explained in the diameter 2 case, Z is monochromatic. Hence, by Lemma 13, we can decide in polynomial time if G has an A-B-matching cut. Since there are at most |E|2 choices for A and B, we conclude that, in polynomial time, phase 1 can decide if G has a matching cut (X, Y ) containing two edges a1 b1 , a2 b2 such that a1 , a2 ∈ V1 , b1 , b2 ∈ V2 and {a1 , b2 } ⊆ X and {a2 , b1 } ⊆ Y . Phase 2. In this second phase we assume that phase 1 is unsuccessful, that is, G has no matching cut (X, Y ) containing two edges a1 b1 , a2 b2 such that a1 , a2 ∈ V1 , b1 , b2 ∈ V2 and {a1 , b2 } ⊆ X and {a2 , b1 } ⊆ Y . Guess an edge ab ∈ E such that a ∈ V1 and b ∈ V2 . Set X = A = {a}, Y = B = {b} and write R = V (G) \ (X ∪ Y ). Apply (R1)–(R5) as long as possible, and let us assume that none of (R1), (R2) and (R3) was ever applied.

Hoang-Oanh Le and Van Bang Le

50:11

Then, by (1), every vertex v ∈ R1 = R ∩ V1 has a neighbor in X (as a ∈ A ∩ V1 ) and every vertex w ∈ R2 = R ∩ V2 has a neighbor in Y (as b ∈ B ∩ V2 ). Thus, assuming G has an A-B-matching cut (X 0 , Y 0 ) with X ⊆ X 0 , Y ⊆ Y 0 , then R1 must belong to X 0 and R2 must belong to Y 0 . For, if v ∈ R1 was in Y 0 , then the A-B-matching cut (X 0 , Y 0 ) would contain the edges ab and uv, where u is the neighbor of v in X ⊆ X 0 , with a, v ∈ V1 and b, u ∈ V2 , contradicting the assumption that phase 1 was unsuccessful. The case of R2 is completely similar. Therefore, G has an A-B-matching cut (X 0 , Y 0 ) with X ⊆ X 0 , Y ⊆ Y 0 if and only if (X ∪ R1 , Y ∪ R2 ) is a matching cut. As the second property can be decided in polynomial time, and there are at most |E| choices for A and B, we conclude that phase 2 can be performed in polynomial time. Putting all together we obtain: I Theorem 15. Matching Cut can be solved in polynomial time when restricted to bipartite graphs of diameter at most 3.

5

Concluding remarks

In this paper we have shown that Matching Cut is NP-complete when restricted to graphs of diameter d, for fixed d ≥ 4, and to bipartite graphs of diameter d, for fixed diameter d ≥ 5. We also have given a polynomial-time algorithm solving Matching Cut in bipartite graphs of diameter at most 3. It is known that Matching Cut is polynomially solvable when restricted to graphs of diameter 2 ([6]; cf. also Section 4). Thus, it would be very interesting to close the gap, obtaining a dichotomy theorem: What is the computational complexity of Matching Cut in graphs of diameter 3? What is the the computational complexity of Matching Cut in bipartite graphs of diameter 4? Finally, we remark that Matching Cut can be solved in linear time in planar graphs (and in graphs with fixed genus) of fixed diameter. This is because a planar graph with diameter d has tree-width at most 3d − 2 ([9]). (More general, a graph with diameter d and genus g has tree-width O(gd); see [10].) In [5], it is shown that Matching Cut can be expressed in monadic second order logic (MSOL), and it is well-known ([2]) that all graph properties definable in MSOL can be decided in linear time for classes of graphs with bounded tree-width, when a tree-decomposition is given. It is also well-known ([4]) that a tree-decomposition of bounded width of a given graph can be found in linear time. Combining these facts, it follows that Matching Cut can be solved in linear time for planar graphs (and in graphs with fixed genus) of fixed diameter. References 1

2 3

4 5

Júlio Araújo, Nathann Cohen, Frédéric Giroire, and Frédéric Havet. Good edge-labelling of graphs. Discrete Applied Mathematics, 160(18):2502–2513, 2012. doi:10.1016/j.dam. 2011.07.021. Stefan Arnborg, Jens Lagergren, and Detlef Seese. Easy problems for tree-decomposable graphs. J. Algorithms, 12(2):308–340, 1991. doi:10.1016/0196-6774(91)90006-K. Bengt Aspvall, Michael F. Plass, and Robert Endre Tarjan. A linear-time algorithm for testing the truth of certain quantified boolean formulas. Inf. Process. Lett., 8(3):121–123. Erratum: 14 (1982) 195, 1979. doi:10.1016/0020-0190(79)90002-4. Hans L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput., 25(6):1305–1317, 1996. doi:10.1137/S0097539793251219. Paul S. Bonsma. The complexity of the matching-cut problem for planar graphs and other graph classes. Journal of Graph Theory, 62(2):109–126, 2009. doi:10.1002/jgt.20390.

ISAAC 2016

50:12

On the Complexity of Matching Cut in Graphs of Fixed Diameter

6

7 8 9

10 11 12 13

14 15 16 17

18

Mieczyslaw Borowiecki and Katarzyna Jesse-Józefczyk. Matching cutsets in graphs of diameter 2. Theor. Comput. Sci., 407(1-3):574–582, 2008. doi:10.1016/j.tcs.2008.07. 002. Vasek Chvátal. Recognizing decomposable graphs. Journal of Graph Theory, 8(1):51–53, 1984. doi:10.1002/jgt.3190080106. Martin Davis and Hilary Putnam. A computing procedure for quantification theory. J. ACM, 7(3):201–215, 1960. doi:10.1145/321033.321034. David Eppstein. Subgraph isomorphism in planar graphs and related problems. J. Graph Algorithms Appl., 3(3), 1999. URL: http://www.cs.brown.edu/publications/jgaa/ accepted/99/Eppstein99.3.3.pdf. David Eppstein. Diameter and treewidth in minor-closed graph families. Algorithmica, 27(3):275–291, 2000. doi:10.1007/s004530010020. Shimon Even, Alon Itai, and Adi Shamir. On the complexity of timetable and multicommodity flow problems. SIAM J. Comput., 5(4):691–703, 1976. doi:10.1137/0205048. Arthur M. Farley and Andrzej Proskurowski. Networks immune to isolated line failures. Networks, 12(4):393–403, 1982. doi:10.1002/net.3230120404. Ron L. Graham. On primitive graphs and optimal vertex assignments. Ann. N.Y. Acad. Sci., 175:170–186, 1970. URL: http://www.math.ucsd.edu/~ronspubs/70_04_ primitive_graphs.pdf. Dieter Kratsch and Van Bang Le. Algorithms solving the matching cut problem. Theor. Comput. Sci., 609:328–335, 2016. doi:10.1016/j.tcs.2015.10.016. Van Bang Le and Bert Randerath. On stable cutsets in line graphs. Theor. Comput. Sci., 1-3(301):463–475, 2003. doi:10.1016/S0304-3975(03)00048-3. Augustine M. Moshi. Matching cutsets in graphs. Journal of Graph Theory, 13(5):527–536, 1989. doi:10.1002/jgt.3190130502. Maurizio Patrignani and Maurizio Pizzonia. The complexity of the matching-cut problem. In Graph-Theoretic Concepts in Computer Science, 27th International Workshop, WG 2001, Boltenhagen, Germany, June 14-16, 2001, Proceedings, pages 284–295, 2001. doi:10.1007/ 3-540-45477-2_26. Thomas J. Schaefer. The complexity of satisfiability problems. In Proceedings of the 10th Annual ACM Symposium on Theory of Computing, May 1-3, 1978, San Diego, California, USA, pages 216–226, 1978. doi:10.1145/800133.804350.

Suggest Documents