A linear time algorithm for a variant of the max cut problem in series parallel graphs

Given a graph G=(V, E), a connected sides cut (U, V\U) or {\delta}(U) is the set of edges of E linking all vertices of U to all vertices of V\U such that the induced subgraphs G[U] and G[complement of U] are connected. Given a positive weight function w defined on E, the maximum connected sides cut problem is to find a connected sides cut {\Omega} such that w({\Omega}) is maximum. This problem is NP-hard. In this paper, we give a linear time algorithm to solve the maximum connected sides cut problem 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.


Introduction
Sets and their characteristic vectors will be not distinguished. We refer to Bondy and Murty's book (2008) about Graph Theory. Given an undirected graph G = (V, E) and positive weights w ij = w ji on the edges (i, j)oeE, the maximum cut problem (MAX CUT) is that of finding the set of vertices S that maximizes the weight of the edges in the cut (S, V\S) or δ(S) or δ(V/S); that is, the weight of the edges with one endpoint in S and the other in V\S. The (decision variant of the) MAX CUT is one of the Karp's original NP-complete problems (Karp 1972), and has long been known to be NPcomplete even if the problem is unweighted; that is, if w ij = 1 for all (i, j)oeE (Garey et al 1976). 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 (Hadlock 1975, Orlova andDorfman 1972), line graphs (Guruswami 1999), graphs with bounded treewidth, or cographs (Bodlaender and Jansen 2000). 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 (Bodlaender and Jansen 2000) and planar graphs if the weights are of arbitrary sign (Terebenkov 1991). Besides its theoretical importance, the MAX CUT problem has applications in circuit layout design and statistical physics (Barahona et al 1988). For a comprehensive survey of the MAX CUT problem, the reader is referred to Poljak and Tuza (1995). The best known algorithm for MAX CUT in planar graphs has running time complexity O(n 3/2 log n), where n is the number of vertices of the graph, (Shih et al. 1990). The main result of this paper is to exhibit a linear time algorithm for a special case of MAX CUT in series parallel graphs. Let's give some definitions: Given a subset of vertices U, a connected sides cut δ(U) is a cut where both induced subgraphs G[U] and G[V\U] are connected. Special connected sides cuts are trivial cuts, i.e. cuts with one single vertex in one side. 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 problems are the same for complete graphs. Since MAX CUT is NP-hard for complete graphs (see Karp 1972) then MAX CS CUT is NP-hard in the general case. A parallel closure of a graph is an induced subgraph on two vertices. A series extension of the graph G = (V, E) based on the edge e of E is adding a vertex v of degree 2 in the middle of e in order to have two edges instead of e. A parallel extension of G based on the edge e is adding an edge f having the same incident vertices as e. Series parallel graphs are graphs obtained by applying recursively series and/or parallel extensions starting form one edge. A series degree of a vertex v in a graph G is the degree of v after replacing every parallel closure of G by one single edge. A series labeling of the vertices of a series parallel graph is a labeling of the vertices from 0 to n-1 = |V|-1 starting from the first two vertices v 0 and v 1 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 v of series degree 2 with the two parallel closures P 0 and P 1 incident to v, and the two adjacent vertices u 0 and u 1 incident to v, we can contract all edges of P 0 (or P 1 ) and replacing v by u 0 (or u 1 ), 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 G j , 0 ≤ j ≤ n-1, with G n-1 = G and G 1 is the induced subgraph on the two vertices v 0 and v 1 . Let G 1 and G 2 two graphs with e j an edge of G j , j = 1, 2. The 2-sum of G 1 and G 2 , denoted G 1 ∆ e G 2 , based on the edges e 1 and e 2 is the graph obtained by identifying e 1 and e 2 on an edge e, and keeping G j \e j , j = 1, 2, as it is. We say that MAX CS CUT 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 MAC CS CUT. We deduce a linear time algorithm for MIN CUT in series parallel graphs in section 4, and we conclude in section 5.

MAX CS CUT is linear for series parallel graphs
MAXCSCUTSP Algorithm: Input: A series parallel graph G = (V, E) with a series labeling of V, a positive weight function w defined on E. Output: A w-maximum connected sides cut Ω in G. 0) Begin 1) j := n-1; 2) While j > 1 do 3) Begin 4) Let P 0 and P 1 the two parallel closures incident to v j in G j : 5) If w(P 0 ) > w(P 1 ) then contract P 1 ; 6) Else: contract P 0 ; 7) j := j-1; 6) End of While 7) j := 2; 8) Ω := E(G 1 ); 9) While j ≤ n-1 do 9) Begin 11) Let P 0 and P 1 the two parallel closures incident to v j in G j : 12) If w(P 0 )+w(P 1 ) > w(Ω) then Ω := P 0 »P 1 ; 13) j := j+1; 14) End of While 15) End of MAXCSCUTSP algorithm. It is not difficult to see that the complexity of this algorithm is O(n), where n = |V|. Theorem 2: MAXCSCUTSP algorithm solves MAX CS CUT problem in series parallel graphs. Proof: Te summary of the algorithm is as follows: MAXCSCUT choose a vertex v with series degree 2 (step 4) and contract the less weighted parallel closure incident to v (steps 5 and 6). And so on the resulted graph until it reaches G 1 (steps 2-6), the starting single parallel closure. In G 1 , the w-maximum connected sides cut is E(G 1 ) (step 8). After that, it goes in the reverse path (steps 9-14): the w-maximum connected sides cut is either the trivial cut based on the current vertex v j with series degree 2 or the current computed connected sides cut (step 12). Let v j the chosen vertex with series degree 2 in G j , P 0 and P 1 the two parallel closures incident to v j . Without loss of generality, we can suppose that w(P 0 ) < w(P 1 ) and G j-1 = G j /P 0 . Let Ω j the w-maximum connected sides cut in G j , 1 ≤ j ≤ n-1. It suffices to prove that w(Ω j ) = Max {w(Ω j-1 ), w(P 0 »P 1 )}.
Let Ω a connected sides cut in G j distinct from P 0 »P 1 . Since w(P 0 ) < w(P 1 ), we have only two cases: Case 1: P 1 is contained in Ω then Ω is a connected sides cut in G j-1 = G j /P 0 containing P 1 . And vice versa, any connected sides cut in G j-1 = G j /P 0 containing P 1 is a connected sides cut in G j containing P 1 . Case 2: P 1 is not contained in Ω then Ω is a connected sides cut in G j-1 = G j /P 0 not containing P 1 . And vice versa, any connected sides cut in G j-1 = G j /P 0 not containing P 1 is a connected sides cut in G j containing P 1 . So the connected sides cuts candidates for the w-maximum connected sides cut in G j and G j-1 are the same, except P 0 »P 1 . □ Note that MAXCSCUT algorithm solves the MAX CS CUT problem even for arbitrary sign weight functions.

2-sums preserve linearity of MAX CS CUT
Let CS(G) be the class of connected sides cuts of G. We need the following lemma: Lemma 3: CS(G 1 ∆ e G 2 ) = {Ω j oeCS(Gj) : e j -Ω j , j = 1, 2} »{Ω 1 ∆ e Ω 2 : Ω j oeCS(Gj) and e j oeΩ j , j = 1, 2}. It follows that the w-maximum connected sides cut in G 1 ∆ e G 2 is one of the three following connected sides cuts: (cases 1-2) one of the two w-maximum connected sides cut in G j which does not contain e j , j = 1, 2, (case 3) or the 2-sum of the w-maximum connected sides cuts containing e j , j = 1, 2. To find Ω 1 ∆ e Ω 2 (case 3), we have to put w(e j ), j = 1, 2, as big as possible, e.g. sum of the positive weights of all edges, and find Ω j , j = 1, 2. So we have to compute MAX CS CUT twice in each graph and compare three cuts. So linearity of the problem is preserved.

An O(n) time algorithm for MIN CUT in series parallel graphs MINCUTSP Algorithm:
Input: A series parallel graph G = (V, E) with a series labeling of V, a positive weight function w defined on E. Output: A w-minimum cut Ω in G. 0) Begin 1) j := n-1; 2) While j > 1 do 3) Begin 4) Let P 0 and P 1 the two parallel closures incident to v j in G j : 5) If w(P 0 ) < w(P 1 ) then contract P 1 ; 6) Else: contract P 0 ; 7) j := j-1; 6) End of While 7) j := 2; 8) Ω := E(G 1 ); 9) While j ≤ n-1 do 9) Begin 11) Let P 0 and P 1 the two parallel closures incident to v j in G j : 12) If w(P 0 )+w(P 1 ) < w(Ω) then Ω := P 0 »P 1 ; 13) j := j+1; 14) End of While 15) End of MINCUTSP algorithm. It is not difficult to see that the complexity of this algorithm is O(n), where n = |V|.
And it is not difficult to see, similarly to MAXCSCUT (the changes are bolded), 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: Proposition 4: Given a connected graph G = (V, E) and a positive weight function w defined on E. Any w-minimum cut is a connected sides cut of G. Proof: Let δ(U) a cut with G[U] disconnected. It suffices to prove that δ(U) is not a wminimum cut. Let G[U 1 ] one connected component of G [U]. Since G is connected, then: w(V\U, U 1 ) > 0 (i.e. there are edges between V\U and U 1 ). It follows that: w(δ(U\U 1 ) = w(δ(U))-w(V\U, U 1 ) < w(δ(U)). □ Another consequence of Lemma 3 and Proposition 4 is the following proposition: Proposition 5: 2-sums preserves the linearity of MIN CUT.

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.