Abstract
Given a graph , a connected sides cut or is the set of edges of linking all vertices of to all vertices of such that the induced subgraphs and are connected. Given a positive weight function defined on , the maximum connected sides cut problem (MAX CS CUT) is to find a connected sides cut such that is maximum. MAX CS CUT is NP-hard. In this paper, we give a linear time algorithm to solve MAX CS CUT for series parallel graphs. We deduce a linear time algorithm for the minimum cut problem in the same class of graphs without computing the maximum flow.
1. Introduction
Sets and their characteristic vectors will not be distinguished. We refer to Bondy and Murty [1] about graph theory terminology and facts.
Given an undirected graph and positive weights on the edges , the maximum cut problem (MAX CUT) is that of finding the set of vertices that maximizes the weight of the edges in the cut or or , that is, the weight of the edges with one endpoint in and the other in . The (decision variant of the) MAX CUT is one of the Karp original NP-complete problems [2] and has long been known to be NP-complete even if the problem is unweighted, that is, if for all [3]. This motivates the research to solve the MAX CUT problem in special classes of graphs. The MAX CUT problem is solvable in polynomial time for the following special classes of graphs: planar graphs [4–6], line graphs [7], graphs with bounded treewidth, or cographs [8]. But the problem remains NP-complete for chordal graphs, undirected path graphs, split graphs, tripartite graphs, graphs that are the complement of a bipartite graph [8], and planar graphs if the weights are of arbitrary sign [9]. Besides its theoretical importance, the MAX CUT problem has applications in circuit layout design and statistical physics [10]. For a comprehensive survey of the MAX CUT problem, the reader is referred to Poljak and Tuza [11] and Ben-Ameur et al. [12]. The best known algorithm for MAX CUT in planar graphs has running time complexity , where is the number of vertices of the given graph [13]. This algorithm is not a linear time one. The main result of this paper is to exhibit a linear time algorithm for a special variant of MAX CUT in series parallel graphs. Series parallel graphs can be used to model series and parallel electric circuits [14]. Another motivation is that there is not a known linear time algorithm for the MAX CUT problem or any one of its NP-hard versions in any special class of graphs till today. This motivates the research on linear time algorithms in special classes of graphs for our problem which is an NP-hard variant of MAX CUT. Finally, many NP-hard problems have been studied in series parallel graphs [15–31] but not all outputed a linear time algorithm for the considered problem.
Let us give some definitions. Given an undirected graph and a subset of vertices , a connected sides cut is a cut where both induced subgraphs and are connected. Special connected sides cuts are trivial cuts, that is, cuts with one single vertex in one side (when this vertex is not a disconnecting vertex). The corresponding weighted variant of MAX CUT for connected sides cuts is called MAX CONNECTED SIDES CUT problem (MAX CS CUT). It is clear that MAX CUT and MAX CS CUT are the same problem for complete graphs. Since MAX CUT is NP-hard for complete graphs (see [2]), then MAX CS CUT is NP-hard in the general case. Another motivation is that MAX CS CUT gives a lower bound for MAX CUT.
A parallel closure of a graph is an induced subgraph on two vertices. A series extension of the graph based on the edge is adding a vertex of degree 2 in the middle of in order to have two edges instead of . A parallel extension of based on the edge is adding an edge having the same incident vertices as . Series parallel graphs are graphs obtained by applying recursively series and/or parallel extensions starting from one edge. A series degree of a vertex in a graph is the degree of after replacing every parallel closure of by one single edge. A series labeling of the vertices of a series parallel graph is a labeling of the vertices from 0 to starting from the first two vertices and and so on to the last added vertex. Any series parallel graph contains at least one vertex of series degree 2. So, given a vertex of series degree 2 with the two parallel closures and incident to , and the two adjacent vertices and to , we can contract all edges of (or ) and replace by (or ), and we obtain a new series parallel graph with a new vertex of series degree 2. Each involved graph in any step of this process is labeled , , with , and is the induced subgraph on the two vertices and .
Let and be two graphs with an edge of , . The 2-sum of and , denoted by or , based on the edges and is the graph obtained by identifying and on an edge and keeping , , as they are.
We say that a problem is linear for a class of graphs if there is a linear time algorithm to solve it in such class.
The remaining of the paper is organized as follows: in Section 2, we give a linear time algorithm for MAX CS CUT in series parallel graphs; in Section 3, we prove that 2-sums preserve the linearity of MAX CS CUT. We deduce a linear time algorithm for MIN CUT in series parallel graphs in Section 4, and we conclude in Section 5.
2. MAX CS CUT Is Linear for Series Parallel Graphs
MAXCSCUTSP Algorithm
Input. A series parallel graph with a series labeling of , a positive weight function defined on .
Output. A -maximum connected sides cut in .(0)Begin(1);(2)While do(3)Begin(4)Let and be the two parallel closures incident to in :(5)If then contract ;(6)Else: contract ;(7);(8)End of While(9);(10);(11)While do(12)Begin(13)Let and the two parallel closures incident to in :(14)If then ;(15);(16)End of While(17)End of MAXCSCUTSP algorithm.
This algorithm has two phases: Phase I (steps (1)–(6)) and Phase II (steps (9)–(16)). In each step, we do roughly operations, so the complexity of MAXCSCUTSP is , where .
Theorem 1. MAXCSCUTSP algorithm solves MAX CS CUT in series parallel graphs.
Proof. The summary of the algorithm is as follows: MAXCSCUT chooses a vertex with series degree 2 (step (4)) and contracts the less weighted parallel closure incident to (steps (5) and (6)), and so on, until the resulting graph becomes , which is the starting single parallel closure (Phase I). In , the -maximum connected sides cut is (step (10)). After that, it goes in the reverse path (Phase II): the -maximum connected sides cut is either the trivial cut based on the current vertex with series degree 2 or the current computed connected sides cut (step (14)). Let be the chosen vertex with series degree 2 in , and let and be the two parallel closures incident to . Without loss of generality, we can suppose that and . Let be the -maximum connected sides cut in , . It suffices to prove that .
Let be a connected sides cut in distinct from . Since , we have only two cases.
Case 1. , then is a connected sides cut in containing . And vice versa, any connected sides cut in containing is a connected sides cut in containing .
Case 2. , then is a connected sides cut in not containing . And vice versa, any connected sides cut in not containing is a connected sides cut in not containing .
So the connected sides cuts candidates for the -maximum connected sides cut in and are the same, except .
Note that MAXCSCUTSP algorithm solves MAX CS CUT in series parallel graphs even for arbitrary sign weight functions.
3. 2-Sums Preserve Linearity of MAX CS CUT
Let be the class of connected sides cuts of . We need the following lemma.
Lemma 2. One has .
We can now state one consequence of this as follows.
Theorem 3. If MAX CS CUT is linear for two given graphs and , then it is also linear for .
Proof. It follows from Lemma 2 that a -maximum connected sides cut in is one of the three following connected sides cuts:
(cases 1-2) one of the two -maximum connected sides cuts in which does not contain , or
(case 3) the 2-sum of the -maximum connected sides cuts containing , .
To find a -maximum connected sides cut in which does not contain , (case 2), we have to contract . We need then to perform at most operations, where , , is the linearity coefficient of the algorithm solving MAX CS CUT in , , and , , is the number of vertices of , (by induction).
To find (case 3), we have to put , , as big as possible, for example, sum of the positive weights of all edges, and find , . In this case, we need to perform at most operations (by induction), where , , is the linearity coefficient of the algorithm solving MAX CS CUT in , .
So we have to compute MAX CS CUT twice in each graph and compare three cuts. The total number of operations is then bounded by , where is the number of vertices of and . So linearity of the problem is preserved.
The same property holds for , the unique excluded minor for series parallel graphs, which means that the class of graphs for which MAX CS CUT is linear is larger than series parallel graphs.
Lemma 4. MAX CS CUT is linear for .
Proof. It is not difficult to see that : for any perfect matching of (there are 3 perfect matchings in ), we have a connected sides cut (by removing the perfect matching), and for any vertex of (there are 4 vertices), the corresponding trivial cut is a connected sides one. We can reduce the number of cuts to be considered as follows.
Let and such that is a perfect matching of . We have the following property. So by such comparisons (for each perfect matching of ), we eliminate step-by-step cuts to be considered for comparison between them.
We have then the following corollary directly from Theorems 1 and 3 and Lemma 4.
Corollary 5. MAX CS CUT is linear for 2-sums of series parallel graphs and copies of .
4. MIN CUT Is Linear for Series Parallel Graphs
MINCUTSP Algorithm
Input. A series parallel graph with a series labeling of , a positive weight function defined on .
Output. A -minimum connected sides cut in .
We keep the same steps as MAXCSCUTSP algorithm except the following changes in two steps:(5)If then contract ;(14)If then ;
Since this algorithm is similar to MAXCSCUTSP, then its complexity is , where .
And it is not difficult to see, similarly to MAXCSCUTSP, that MINCUTSP gives the minimum weighted connected sides cut in a series parallel graph without computing the maximum flow.
We can conclude with the following result.
Theorem 6. Given a connected graph and a positive weight function defined on , then any -minimum cut is a connected sides cut of .
Proof. Let be a cut with disconnected. It suffices to prove that is not a -minimum cut. Let be one connected component of . Since is connected, then (i.e., there are edges between and ). It follows that .
Other consequences of Lemma 2 and Theorem 6 are the following corollaries.
Corollary 7. 2-sums preserve the linearity of MIN CUT.
Corollary 8. MIN CUT is linear for 2-sums of series parallel graphs and copies of .
5. Conclusion
We have introduced a new variant of MAX CUT: MAX CS CUT, which is also NP-hard. We have provided two linear time algorithms for MAX CS CUT and MIN CUT, respectively, in series parallel graphs. We have proved that 2-sums preserve the linearity of MAX CS CUT and MIN CUT. Further directions are to study MAX CS CUT in larger classes of graphs than series parallel graphs.
Conflicts of Interest
The author declares that there are no conflicts of interest regarding the publication of this paper.
Acknowledgments
The author is grateful to the deanship of Scientific Research at Al Imam Mohammad Ibn Saud Islamic University (IMSIU) for supporting financially this research under the Grant no. 331203.