Parameterized Algorithms for Graph Partitioning Problems

# Parameterized Algorithms for Graph Partitioning Problems

Hadas Shachnai Department of Computer Science, Technion, Haifa 32000, Israel
Meirav Zehavi Department of Computer Science, Technion, Haifa 32000, Israel
###### Abstract

We study a broad class of graph partitioning problems, where each problem is specified by a graph , and parameters and . We seek a subset of size , such that is at most (or at least) , where are constants defining the problem, and are the cardinalities of the edge sets having both endpoints, and exactly one endpoint, in , respectively. This class of fixed cardinality graph partitioning problems (FGPP) encompasses Max -Cut, Min -Vertex Cover, -Densest Subgraph, and -Sparsest Subgraph.

Our main result is an algorithm for any problem in this class, where is the maximum degree in the input graph. This resolves an open question posed by Bonnet et al. [IPEC 2013]. We obtain faster algorithms for certain subclasses of FGPPs, parameterized by , or by . In particular, we give an time algorithm for Max -Cut, thus improving significantly the best known time algorithm.

## 1 Introduction

Graph partitioning problems arise in many areas including VLSI design, data mining, parallel computing, and sparse matrix factorizations (see, e.g., [1, 12, 7]). We study a broad class of graph partitioning problems, where each problem is specified by a graph , and parameters and . We seek a subset of size , such that is at most (or at least) , where are constants defining the problem, and are the cardinalities of the edge sets having both endpoints, and exactly one endpoint, in , respectively. This class encompasses such fundamental problems as Max and Min -Cut, Max and Min -Vertex Cover, -Densest Subgraph, and -Sparsest Subgraph. For example, Max -Cut is a max-FGPP (i.e., maximization FGPP) satisfying and , Min -Cut is a min-FGPP (i.e., minimization FGPP) satisfying and , and Min -Vertex Cover is a min-FGPP satisfying .

A parameterized algorithm with parameter has running time for some function , where hides factors polynomial in the input size. In this paper, we develop a parameterized algorithm with parameter for the class of all FGPPs, where is the maximum degree in the graph . For certain subclasses of FGPPs, we develop algorithms parameterized by , or by .

Related Work: Parameterized by , Max and Min -Cut, and Max and Min -Vertex Cover are W[1]-hard [8, 4, 11]. Moreover, -Clique and -Independent Set, two well-known W[1]-hard problems [9], are special cases of -Densest Subgraph where , and -Sparsest Subgraph where , respectively. Therefore, parameterized by , -Densest Subgraph and -Sparsest Subgraph are W[1]-hard. Cai et al. [5] and Bonnet et al. [2] studied the parameterized complexity of FGPPs with respect to . Cai et al. [5] gave time algorithms for -Densest Subgraph and -Sparsest Subgraph. Recently, Bonnet et al. [2] presented an time algorithm for degrading FGPPs. This subclass includes max-FGPPs in which , and min-FGPPs in which .111A max-FGPP (min-FGPP) is non-degrading if (). They also proposed an time algorithm for all FGPPs, and posed as an open question the existence of constants and such that any FGPP can be solved in time . In this paper we answer this question affirmatively, by developing an time algorithm for any FGPP.

Parameterized by , Max and Min -Vertex Cover can be solved in times and , respectively, and in randomized times and , respectively [14]. Moreover, Max Cut can be solved in time [2], and Min Cut can be solved in time [6]. Parameterized by , Min Cut can be solved in time  [2].

We note that the parameterized complexity of FGPPs has also been studied with respect to other parameters, such as the treewidth and the vertex cover number of (see, e.g., [13, 3, 2]).

Contribution: Our main result is an time algorithm for the class of all FGPPs, answering affirmatively the question posed by Bonnet et al. [2] (see Section 2). In Section 3, we develop an time algorithm for Max -Cut, that significantly improves the running time obtained in [2]. We also obtain (in Section 4) an time algorithm for the subclass of positive min-FGPPs, in which and . Finally, we develop (in Section 5) a faster algorithm for non-degarding positive min-FGPPs (i.e., min-FGPPs satisfying ). In particular, we thus solve Min -Vertex Cover in time , improving the previous randomized time algorithm.

Techniques:  We obtain our main result by establishing an interesting reduction from non-degrading FGPPs to the Weighted -Exact Cover (-WEC) problem (see Section 2). Building on this reduction, combined with an algorithm for degrading FGPPs given in [2], and an algorithm for -WEC given in [18], we develop an algorithm for any FGPP. To improve the running time of our algorithm, we use a fast construction of representative families [10, 17].

In designing algorithms for FGPPs, parameterized by or , we use as a key tool randomized separation [5] (see Sections 35). Roughly speaking, randomized separation finds a ‘good’ partition of the nodes in the input graph via randomized coloring of the nodes in red or blue. If a solution exists, then, with some positive probability, there is a set of only red nodes that is a solution, such that all the neighbors of nodes in that are outside are blue. Our algorithm for Max -Cut makes non-standard use of randomized separation, in requiring that only some of the neighbors outside of nodes in are blue. This yields the desired improvement in the running time of our algorithm.

Our algorithm for non-degrading positive FGPPs is based on a somewhat different application of randomized separation, in which we randomly color edges rather than the nodes. If a solution exists, then, with some positive probability, there is a node-set that is a solution, such that some edges between nodes in are red, and all edges between nodes in and nodes outside are blue. In particular, we require that the subgraph induced by , and the subgraph induced by from which we delete all blue edges, contain the same connected components. We derandomize our algorithms using universal sets [16].

Notation: Given a graph and a subset , let denote the set of edges in having both endpoints in , and let denote the set of edges in having exactly one endpoint in . Moreover, given a subset , let .

## 2 Solving FGPPs in Time O∗(4k+o(k)Δk)

In this section we develop an time algorithm for the class of all FGPPs. We use the following steps. In Section 2.1 we show that any non-degrading FGPP can be reduced to the Weighted -Exact Cover (-WEC) problem, where . Applying this reduction, we then show (in Section 2.2) how to decrease the size of instances of -WEC, by using representative families. Finally, we show (in Section 2.3) how to solve any FGPP by using the results in Sections 2.1 and 2.2, an algorithm for -WEC, and an algorithm for degrading FGPPs given in [2].

### 2.1 From Non-Degrading FGPPs to k′-Wec

We show below that any non-degrading max-FGPP can be reduced to the maximization version of -WEC. Given a universe , a family of nonempty subsets of , a function , and parameters and , we seek a subfamily of disjoint sets from satisfying whose value, given by , is at least . Any non-degrading min-FGPP can be similarly reduced to the minimization version of -WEC.

Let be a max-FGPP satisfying . Given an instance of , we define an instance of the maximization version of -WEC as follows.

• .

• , where contains the node-set of any connected subgraph of on exactly nodes.

• .

• , and .

We illustrate the reduction in Figure 1 (see Appendix A). We first prove that our reduction is valid.

###### Lemma 1

is a yes-instance iff is a yes-instance.

###### Proof

First, assume there is a subset of size satisfying . Let , for some , be the maximal connected components in the subgraph of induced by . Then, for all , . Moreover, , and .

Now, assume there is a subfamily of disjoint sets , for some , such that and . Thus, there are connected subgraphs of , such that , for all . Let , for all . Clearly, . Since , we get that

 \parval(X1)=val(V1)+val(X2)+α1|E(V1,X2)|−2α2|E(V1,X2)|\par≥val(V1)+val(X2)\par=val(V1)+val(V2)+val(X3)+α1|E(V2,X3)|−2α2|E(V2,X3)|\par≥val(V1)+val(V2)+val(X3)\par...\par≥t∑ℓ=1val(Vℓ).\par

Thus, .∎

We now bound the number of connected subgraphs in .

###### Lemma 2 ([15])

There are at most connected subgraphs of on at most nodes, which can be enumerated in time .

Thus, we have the next result.

###### Lemma 3

The instance can be constructed in time . Moreover, for any , .

### 2.2 Decreasing the Size of Inputs for k′-Wec

In this section we develop a procedure, called Decrease, which decreases the size of an instance of -WEC. To this end, we find a subfamily that contains ”enough” sets from , and thus enables to replace by without turning a yes-instance to a no-instance. The following definition captures such a subfamily .

###### Definition 1

Given a universe , nonnegative integers and , a family of subsets of size of , and a function , we say that a subfamily max (min) represents if for any pair of sets , and such that , there is a set disjoint from such that ().

The following result states that small representative families can be computed efficiently.222This result builds on a powerful construction technique for representative families presented in [10].

###### Theorem 2.1 ([17])

Given a constant , a universe , nonnegative integers and , a family of subsets of size of , and a function , a subfamily of size at most that max (min) represents can be computed in time .

We next consider the maximization version of -WEC and max representative families. The minimization version of -WEC can be similarly handled by using min representative families. Let RepAlg denote the algorithm in Theorem 2.1 where , and let , for all .

We now present procedure Decrease (see the pseudocode below), which replaces each family by a family that represents . First, we state that procedure Decrease is correct (the proof is given in Appendix C).

###### Lemma 4

is a yes-instance iff is a yes-instance.

Theorem 2.1 immediately implies the following result.

###### Lemma 5

Procedure Decrease runs in time
. Moreover, .

### 2.3 An Algorithm for Any FGPP

We now present FGPPAlg, which solves any FGPP in time . Assume w.l.o.g that , and let DegAlg() denote the algorithm solving any degrading FGPP in time , given in [2].

The algorithm given in Section 5 of [18] solves a problem closely related to -WEC, and can be easily modified to solve -WEC in time
. We call this algorithm WECAlg().

Let be an FGPP having parameters and . We now describe algorithm FGPPAlg (see the pseudocode below). First, if is a degrading FGPP, then FGPPAlg solves by calling DegAlg. Otherwise, by using the reduction , FGPPAlg transforms the input into an instance of -WEC. Then, FGPPAlg decreases the size of the resulting instance by calling the procedure Decrease. Finally, FGPPAlg solves by calling WECAlg.

###### Theorem 2.2

Algorithm FGPPAlg solves in time .

###### Proof

The correctness of the algorithm follows immediately from Lemmas 1 and 4, and the correctness of DegAlg and WECAlg.

By Lemmas 3 and 5, and the running times of DegAlg and WECAlg, algorithm FGPPAlg runs in time

 \parO(4k(Δ−1)k(|V|+|E|)|V|+k∑i=1(4i(Δ−1)i|V|(2k2k−i)k−i2o(k)log|V|)+ 2.851k2.5k+o(k)|V|log3|V|)\par=O(4kΔk(|V|+|E|)|V|+2o(k)|V|log|V|[max0≤α≤1{4αΔα(22−α)1−α}]k)\par=O(4kΔk(|V|+|E|)|V|+4k+o(k)Δk|V|log|V|)\par=O(4k+o(k)Δk(|V|+|E|)|V|).

## 3 Solving Max (k,n−k) Cut in Time O∗(4p+o(p))

We give below an time algorithm for Max Cut. In Section 3.1 we show that it suffices to consider an easier variant of Max Cut, that we call NC-Max -Cut. We solve this variant in Section 3.2. Finally, our algorithm for Max Cut is given in Section 3.3.

### 3.1 Simplifying Max (k,n−k) Cut

We first define an easier variant of Max Cut. Given a graph in which each node is either red or blue, and positive integers and , NC-Max -Cut asks if there is a subset of exactly red nodes and no blue nodes, such that at least edges in have a blue endpoint.

Given an instance of Max Cut, we perform several iterations of coloring the nodes in ; thus, if is a yes-instance, we generate at least one yes-instance of NC-Max -Cut. To determine how to color the nodes in , we need the following definition of universal sets.

###### Definition 2

Let be a set of functions . We say that is an -universal set if for every subset of size and a function , there is a function such that for all , .

The following result asserts that small universal sets can be computed efficiently.

###### Lemma 6 ([16])

There is an algorithm, UniSetAlg, that given a pair of integers , computes an -universal set of size in time .

We now present ColorNodes (see the pseudocode below), a procedure that given an input (), where () is an instance of Max Cut and , returns a set of instances of NC-Max -Cut. Procedure ColorNodes first constructs a -universal set . For each , ColorNodes generates a colored copy of . Then, ColorNodes returns a set , including the resulting instances of NC-Max -Cut.

The next lemma states the correctness of procedure ColorNodes.

###### Lemma 7

An instance of Max -Cut is a yes-instance iff ColorNodes() returns a set containing at least one yes-instance of NC-Max -Cut.

###### Proof

If is a no-instance of Max -Cut, then clearly, for any coloring of the nodes in , we get a no-instance of NC-Max -Cut. Next suppose that is a yes-instance, and let be a set of nodes in such that . Note that there is a set of at most nodes in such that . Let and denote the indices of the nodes in and , respectively. Since is a -universal set, there is such that: (1) for all , , and (2) for all , . Thus, in , the copies of the nodes in are red, and the copies of the nodes in are blue. We get that is a yes-instance of NC-Max -Cut.∎

Furthermore, Lemma 6 immediately implies the following result.

###### Lemma 8

Procedure ColorNodes runs in time , and returns a set of size .

### 3.2 A Procedure for NC-Max (k,n−k)-Cut

We now present SolveNCMaxCut, a procedure for solving NC-Max -Cut

(see the pseudocode below). Procedure SolveNCMaxCut orders the red nodes in according to the number of their blue neighbors in a non-increasing manner. If there are at least red nodes, and the number of edges between the first red nodes and blue nodes is at least , procedure SolveNCMaxCut accepts; otherwise, procedure SolveNCMaxCut rejects.

Clearly, the following result concerning SolveNCMaxCut is correct.

###### Lemma 9

Procedure SolveNCMaxCut solves NC-Max -Cut in time .

### 3.3 An Algorithm for Max (k,n−k) Cut

Assume w.l.o.g that has no isolated nodes. Our algorithm, MaxCutAlg, for Max Cut, proceeds as follows. First, if , then MaxCutAlg accepts, and if , then MaxCutAlg calls itself with instead of . Then, MaxCutAlg calls ColorNodes to compute a set of instances of NC-Max -Cut, and accepts iff SolveNCMaxCut accepts at least one of them.

The next lemma implies the correctness of Step 1 in MaxCutAlg.

###### Lemma 10 ([2])

In a graph having no isolated nodes, there is a subset of size such that .

Our main result is the following.

###### Theorem 3.1

Algorithm MaxCutAlg solves Max Cut in time
.

###### Proof

Clearly, () is a yes-instance iff () is a yes-instance. Thus, Lemmas 7, 9 and 10 immediately imply the correctness of MaxCutAlg.

Denote . If , then MaxCutAlg runs in time . Next suppose that . Then, by Lemmas 8 and 9, MaxCutAlg runs in time .∎

## 4 Solving Positive Min-FGPPs in Time O∗(2k+pα2+o(k+p))

Let be a min-FGPP satisfying and . In this section we develop an time algorithm for . Using randomized separation, we show in Section 4.1 that we can focus on an easier version of . We solve this version in Section 4.2, using dynamic programming. Then, Section 4.3 gives our algorithm.

### 4.1 Simplifying the Positive Min-FGPP Π

We first define an easier variant of . Given a graph in which each node is either red or blue, and parameters and , NC- asks if there is a subset of exactly red nodes and no blue nodes, whose neighborhood outside includes only blue nodes, such that val.

The simplification process is similar to that performed in Section 3.1. However, we now use the randomized separation procedure ColorNodes, defined in Section 3.1, with instances of , and consider the set returned by ColorNodes as a set of instances of NC-. We next prove that ColorNodes is correct.

###### Lemma 11

An instance of is a yes-instance iff ColorNodes() returns a set containing at least one yes-instance of NC-.

###### Proof

If is a no-instance of , then clearly, for any coloring of the nodes in , we get a no-instance of NC-. Next suppose that is a yes-instance, and let be a set of nodes in such that val. Let denote the neighborhood of outside . Note that . Let and denote the indices of the nodes in and , respectively. Since is a -universal set, there is such that: (1) for all , , and (2) for all , . Thus, in , the copies of the nodes in are red, and the copies of the nodes in are blue. We get that is a yes-instance of NC-.∎

### 4.2 A Procedure for Nc-Π

We now present SolveNCP, a dynamic programming-based procedure for solving NC- (see the pseudocode below). Procedure SolveNCP first computes the node-sets of the maximal connected red components in . Then, procedure SolveNCP generates a matrix M, where each entry holds the minimum value val of a subset in , the family containing every set of exactly nodes in obtained by choosing a union of sets in , i.e., . Procedure SolveNCP computes M by using dynamic programming, assuming an access to a non-existing entry returns , and accepts iff M.

The following lemma states the correctness and running time of SolveNCP.

###### Lemma 12

Procedure SolveNCP solves NC- in time .

###### Proof

For all and , denote val. Using a simple induction on the computation of M, we get that M. Since is a yes-instance of NC- iff val, we have that SolveNCP is correct. Step 1, and the computation of val for all , are performed in time . Since M is computed in time , we have that SolveNCP runs in time .∎

### 4.3 An Algorithm for Π

We now conclude PAlg, our algorithm for (see the pseudocode below). Algorithm PAlg calls ColorNodes to compute several instances of NC-, and accepts iff SolveNCP accepts at least one of them.

By Lemmas 8, 11 and 12, we have the following result.

###### Theorem 4.1

Algorithm PAlg solves in time .

## 5 Solving a Subclass of Positive Min-LGPPs Faster

Let be a min-FGPP satisfying . Denote . In this section we develop an time algorithm for , that is faster than the algorithm in Section 4. Applying a divide-and-conquer step to the edges in the input graph , Section 5.1 shows that we can focus on an easier version of . This version is solved in Section 5.2 by using dynamic programming. We give the algorithm in Section 5.3.

### 5.1 Simplifying the Non-Degrading Positive Min-FGPP Π

We first define an easier variant of . Suppose we are given a graph in which each edge is either red or blue, and parameters and . For any subset , let C denote the family containing the node-sets of the maximal connected components in the graph , where is the set of red edges in having both endpoints in . Also, let val. The variant EC- asks if there is a subset of exactly nodes, such that all the edges in are blue, and val.

We now present a procedure, called ColorEdges (see the pseudocode below), whose input is an instance () of . Procedure ColorEdges uses a universal set to perform several iterations coloring the edges in , and then returns the resulting set of instances of EC-.

The following lemma states the correctness of ColorEdges.

###### Lemma 13

An instance of is a yes-instance iff ColorEdges() returns a set containing at least one yes-instance of EC-.

###### Proof

Since , val for any set and coloring of edges in . Thus, if is a no-instance of , then clearly, for any coloring of edges in , we get a no-instance of EC-. Next suppose that is a yes-instance, and let be a set of nodes in such that val. Let , and . Also, choose a minimum-size subset such that the graphs and contain the same set of maximal connected components. Let and denote the indices of the edges in and , respectively. Note that . Since is an -universal set, there is such that: (1) for all , , and (2) for all , . Thus, in , the copies of the edges in