Simple and Improved Parameterized Algorithms for Multiterminal Cuts★ Mingyu Xiao★★ School of Computer Science and Engineering University of Electronic Science and Technology of China Chengdu 610054, P.R. CHINA Email:
[email protected]
Abstract. Given a graph 𝐺 = (𝑉, 𝐸) with 𝑛 vertices and 𝑚 edges, and a subset 𝑇 of 𝑘 vertices called terminals, the Edge (respectively, Vertex ) Multiterminal Cut problem is to find a set of at most 𝑙 edges (non-terminal vertices), whose removal from 𝐺 separates each terminal from all the others. These two problems are NP-hard for 𝑘 ≥ 3 but well-known to be polynomial-time solvable for 𝑘 = 2 by the flow technique. In this paper, based on a notion farthest minimum isolating cut, we design several simple and improved algorithms for Multiterminal Cut. We show that Edge Multiterminal Cut can be solved in 𝑂(2𝑙 𝑘𝑇 (𝑛, 𝑚)) time and Vertex Multiterminal Cut can be solved in 𝑂(𝑘𝑙 𝑇 (𝑛, 𝑚)) time, where 𝑇 (𝑛, 𝑚) = 𝑂(min(𝑛2/3 , 𝑚1/2 )𝑚) is the running time of finding a minimum (𝑠, 𝑡) cut in an unweighted graph. Furthermore, the running time bounds of our algorithms can be further reduced for small values of 𝑘: Edge 3-Terminal Cut can be solved in 𝑂(1.415𝑙 𝑇 (𝑛, 𝑚)) time, and Vertex {3, 4, 5, 6}-Terminal Cuts can be solved in 𝑂(2.059𝑙 𝑇 (𝑛, 𝑚)), 𝑂(2.772𝑙 𝑇 (𝑛, 𝑚)), 𝑂(3.349𝑙 𝑇 (𝑛, 𝑚)) and 𝑂(3.857𝑙 𝑇 (𝑛, 𝑚)) time respectively. Our results on Multiterminal √ Cut can also be used to obtain faster algorithms for Multicut: 𝑂((min( 2𝑘, 𝑙)+1)2𝑘 2𝑙 𝑇 (𝑛, 𝑚))-time algorithm for Edge Multicut and 𝑂((2𝑘)𝑘+𝑙/2 𝑇 (𝑛, 𝑚))-time algorithm for Vertex Multicut. Key words. Graph Algorithm, Parameterized Algorithm, Multiterminal Cut, Multicut
1
Introduction
Given a graph 𝐺 = (𝑉, 𝐸) with ∣𝑉 ∣ = 𝑛 vertices and ∣𝐸∣ = 𝑚 edges, positive integers 𝑘 and 𝑙, and a set 𝑇 ⊂ 𝑉 of 𝑘 vertices, called terminals, the Edge ★ ★★
A preliminary version of this paper was presented at the 3rd International Computer Science Symposium in Russia (CSR 2008), and appeared in [1]. The work was supported in part by UESTC Youth Science Funds and Earmarked Research Grant 410206 of the Research Grants Council of Hong Kong SAR. Most of the work was done when the author was a Ph.D. student in Department of Computer Science and Engineering, the Chinese University of Hong Kong.
2
Mingyu Xiao
(respectively, Vertex ) Multiterminal Cut problem is to find a subset 𝑆 of at most 𝑙 edges (non-terminal vertices) such that all terminals in 𝑇 are in different components of 𝐺 − 𝑆. These two Multiterminal Cut problems are fundamental network design problems and have applications in VLSI system design, parallel computing, distributed computing, clustering, and many others [2–4]. Dahlhaus et al. [2] initiated the study of Edge Multiterminal Cut by establishing its NP-hardness for each fixed 𝑘 ≥ 3 and giving a polynomial-time (2−2/𝑘)-approximation algorithm. Later C˘alinescu et al. [5] used a novel geometric relaxation to obtain a polynomial-time (1.5 − 1/𝑘)-approximation algorithm for Edge Multiterminal Cut, and the current best approximation algorithm is the polynomial-time (1.3438−𝜖𝑘 )-approximation algorithm developed by Karger et al. [6]. Furthermore, Garg et al. [7] obtained a polynomial-time (2 − 2/𝑘)approximation algorithm for Vertex Multiterminal Cut, and Naor and Zosin [8] gave a polynomial-time 2-approximation algorithm for the Multiterminal Cut problem in directed graphs. In terms of exact algorithms, Edge/Vertex Multiterminal Cuts for 𝑘 = 2 degenerate to the well-known Minimum Edge/Vertex Cut problems and can be solved in polynomial time by the flow technique and some other techniques. For 𝑘 ≥ 3, Dahlhaus et al. [2] gave an 𝑂((4𝑘)𝑘 𝑛(2𝑘−1) log 𝑛)time algorithm for solving Edge Multiterminal Cut in planar graphs, which was later improved to 𝑂(𝑘4𝑘 𝑛2𝑘−4 log 𝑛) by Hartvigsen [9]. Yeh [3] also gave an 𝑂(𝑘 𝑘 (𝑛 − 𝑘)2𝑘 𝑛 log(𝑛 − 𝑘))-time algorithm for Planar Edge Multiterminal Cut. Chen and Wu [10] obtained an 𝑂(𝑘 3 𝑛 + 𝑘𝑛 log 𝑛)-time algorithm for planar graphs where all the terminals are on the boundary of a face. Marx [11] obtained 3 a 4𝑙 𝑛𝑂(1) -time algorithm for Vertex Multiterminal Cut in general graphs. Recently, Chen et al. [12] and Guillemot [13] improved Marx’s result to 4𝑙 𝑛𝑂(1) respectively. In this paper, we concentrate on exact algorithms for Multiterminal Cut. To make them tractable, we put much attention to the scenarios where the size 𝑙 of the multiterminal cut is small. This point of view has drawn much attention in NP-hard problems recently, such as Feige and Mahdian’s work [14] on finding small balanced cuts, and so on. Those who are familiar with Parameterized Complexity [15–17] will find our results positive on the fixed-parameter tractability of finding minimum multiterminal cuts. The running time bounds of most of our algorithms are in the form of 𝑓 (𝑙)∣𝐼∣𝑂(1) , where 𝑓 (𝑙) is a computable function and ∣𝐼∣ is the input size of the problem, which implies that our problems are fixed-parameter tractable when 𝑙 is taken as a parameter. A fixed-parameter tractable algorithm is also called a parameterized algorithm. 𝑘−2
We show that Edge Multiterminal Cut can be solved in 𝑂(2 𝑘−1 𝑙 𝑘𝑇 (𝑛, 𝑚)) time, which implies that Edge Multiterminal Cut can be solved in polynomial time when 𝑙 is 𝑂(log 𝑛). For Vertex Multiterminal Cut, we obtain an 𝑂(𝑘 𝑙 𝑇 (𝑛, 𝑚))-time algorithm. We also prove better running time bounds for small values of 𝑘: 𝑂(2.059𝑙 𝑇 (𝑛, 𝑚)), 𝑂(2.772𝑙 𝑇 (𝑛, 𝑚)), 𝑂(3.349𝑙 𝑇 (𝑛, 𝑚)) and 𝑂(3.857𝑙 𝑇 (𝑛, 𝑚))-time algorithms for Vertex {3, 4, 5, 6}-Terminal Cuts respectively. Our algorithms for Edge Multiterminal Cut and Vertex {3, 4, 5, 6}-Terminal Cuts are the fastest parameterized algorithms so far. Furthermore, our algo-
Parameterized Algorithms for Multiterminal Cuts
3
rithms for Multiterminal Cut can be easily applied to another famous problem— the Multicut problem, in which we are required to separate 𝑘 given pairs of terminals by deleting at √ most 𝑙 edges or vertices. We show that Edge Multicut can be solved in 𝑂((min( 2𝑘, 𝑙) + 1)2𝑘 2𝑙 𝑇 (𝑛, 𝑚)) time and Vertex Multicut can 𝑘+𝑙/2 be solved in 𝑂((2𝑘) 𝑇 (𝑛, 𝑚)) time. In particular, Edge Multicut and Vertex Multicut for 𝑘 ≤ 5 can be solved in 𝑂(1.415𝑙 𝑇 (𝑛, 𝑚)) and 𝑂(2.059𝑙 𝑇 (𝑛, 𝑚)) time respectively. For most cases, our results improve the previously known result of 3 2𝑘𝑙 4𝑙 𝑛𝑂(1) [11] on Multicut. Our algorithms are based on some important properties of the farthest minimum isolating cut of a terminal (see the definition in Section 2.3) and a simple observation that each element (an edge, or a vertex for the vertex version) in the farthest minimum isolating cut of a terminal is either in the solution or not. We arbitrarily choose one element and branch on it by either including it in the solution or excluding it from the solution. In the former branch, the size of the current solution increases by 1; and in the latter branch, we can get an equivalent graph, in which the size of the farthest minimum isolating cut of the same terminal will increase. When a solution exists, the size of the solution and all the minimum isolating cuts are bounded by 𝑙, and thus we can build a bounded search tree to solve both Edge and Vertex Multiterminal Cuts. The rest of this paper is organized as follows: In Section 2, we first introduce some basic techniques and present some structural properties of optimal cut problems. Farthest minimum isolating cut is a frequently used notion in our algorithms. Based on it, we can identify a small set of edges (vertices) in various ways to branch upon in enumerating possible 𝑘−2 minimum multiterminal cuts. In Section 3, we present an 𝑂(2 𝑘−1 𝑙 𝑘𝑇 (𝑛, 𝑚))time algorithm for Edge Multiterminal Cut (see Theorem 1). That algorithm only works for the edge version, since it will use a 2-approximation property and this property does not hold in the vertex version. In Section 4, we show that Vertex Multiterminal Cut can be solved in 𝑂(𝑘 𝑙 𝑇 (𝑛, 𝑚)) time (see Theorem 3) and faster algorithms for small values of 𝑘 : 𝑂(2.059𝑙 𝑇 (𝑛, 𝑚)), 𝑂(2.772𝑙 𝑇 (𝑛, 𝑚)), 𝑂(3.349𝑙 𝑇 (𝑛, 𝑚)) and 𝑂(3.857𝑙 𝑇 (𝑛, 𝑚))-time algorithms for Vertex {3, 4, 5, 6}Terminal Cuts respectively (see Theorem 2). In Section 5, we give a reduction from Multicut to Multiterminal Cut, which leads to improvements on Multicut.
2 2.1
Definitions and Structural Properties Different Problem Versions
It is easy to transform an Edge Multiterminal Cut instance to a Vertex Multiterminal Cut instance in polynomial time by using some standard techniques. But no polynomial-time reduction in the opposite direction is found, which implies that the edge version might be easier than the vertex version. In this paper our algorithms for the edge version are also faster than those for the vertex version. There are certain relations between those two versions as they have similar definitions and properties, and our algorithms for the vertex version are still
4
Mingyu Xiao
applicable to the edge version. Considering their similarities, we will not discuss two versions separately. In the following sections, if no explicit statement is given, the defined terms are applicable for both the edge and vertex versions. For the vertex version cut problems, some papers [18, 19] also discuss the case that terminals can be added to the solution. They call it unrestricted vertex version when terminals are allowed to be removed, and restricted vertex version when terminals are not allowed to be removed. An Unrestricted Vertex Multiterminal Cut instance can be reduced to a restricted vertex version instance simply by adding, for each terminal 𝑡𝑖 , a new terminal 𝑡′𝑖 adjacent only to 𝑡𝑖 . With some modifications our algorithms for the restricted vertex version are still applicable for the unrestricted vertex version. In this paper, we do not discuss the unrestricted vertex version problem individually, and vertex version always means restricted vertex version. 2.2
Basic Definitions
In this paper, 𝑙 always denotes the upper bound of the solution size, 𝑘 the number of terminals (or the number of terminal pairs in the Multicut problem), 𝑇 = {𝑡1 , 𝑡2 , ⋅ ⋅ ⋅ , 𝑡𝑘 } the terminal set, and 𝑇−𝑖 = 𝑇 − {𝑡𝑖 } the set of terminals except 𝑡𝑖 . 𝐸(𝐺) and 𝑉 (𝐺) denote the edge set and vertex set of graph 𝐺 respectively. 𝑁 (𝑣) denotes the set of neighbors of vertex 𝑣. For a set 𝑉 ′ of vertices, 𝑁 (𝑉 ′ ) = ∪ ′ ′ ′ 𝑣∈𝑉 ′ 𝑁 (𝑣) − 𝑉 is called the neighbor set of 𝑉 . For a subgraph 𝐺 in 𝐺, an edge 𝑒 is incident with 𝐺′ if 𝑒 has exactly one endpoint in 𝑉 (𝐺′ ), and a vertex 𝑣 is adjacent to 𝐺′ if 𝑣 has at least one neighbor in 𝑉 (𝐺′ ) and 𝑣 ∈ / 𝑉 (𝐺′ ). We call an edge (non-terminal vertex) subset an edge (vertex) multiterminal cut, if its removal separates all the terminals. Among all the multiterminal cuts, those with the minimum size are called minimum multiterminal cuts. A minimal multiterminal cut is a multiterminal cut in case that any of its proper subsets is not a multiterminal cut. We call a subset 𝐶𝑖 of edges (vertices) an isolating cut of terminal 𝑡𝑖 , if its removal separates 𝑡𝑖 from all other terminals 𝑇−𝑖 . A minimum isolating cut of 𝑡𝑖 is an isolating cut of 𝑡𝑖 with the minimum size. A minimum isolating cut, which may not be unique, can be found by using the methods for the Minimum (𝑠, 𝑡) Cut problem. Let 𝑆 be an arbitrary minimum multiterminal cut in 𝐺. We consider the connected components of the graph obtained by removing 𝑆. Let 𝐶𝑃𝑖 be the component that contains terminal 𝑡𝑖 . We will use 𝑆𝑖 ⊆ 𝑆 to denote all the edges incident with (vertices adjacent to) 𝐶𝑃𝑖 in 𝐺 (𝑖 = 1, 2, ⋅ ⋅ ⋅ , 𝑘). In Figure 1, dash-dot lines indicate 𝑆1 . Obviously, 𝑆𝑖 is the minimum isolating cut of 𝑡𝑖 contained in 𝑆. Readers will see that the algorithm for Edge Multiterminal Cut in Section 3 will use some properties of 𝑆𝑖 ’s and the vertex version has no such good properties. In our algorithms, we often branch on an edge (vertex) by either including or excluding it in the solution. To exclude an edge (vertex) from the solution, we can shrink the edge (dissolve the vertex). Shrinking an edge means that we identify the two endpoints of it and keep all edges, including possible parallel edges, incident with the two endpoints, and delete self-loops. To dissolve a vertex
Parameterized Algorithms for Multiterminal Cuts
5
t2 S1
t1
t3 S
…..
Fig. 1. Illustration for 𝑆𝑖
we will delete this vertex and all the edges incident with it, and add an edge between every pair of nonadjacent vertices in its neighborhood. When a vertex to be dissolved is adjacent to a terminal, then we can simply implement the dissolving by shrinking the edge between this vertex and the terminal. 1 We use 𝐺 ⋅ 𝑒 to denote the graph after 𝑒 shrinks (dissolves) in 𝐺. See Figure 2 for an illustration for these two operations. Sometimes we will contract a subgraph into a single vertex, i.e., we replace this subgraph with a single vertex, and keep all the edges incident with it (including parallel edges), and delete self-loops.
e
v Shrinking e
Dissolving v
Fig. 2. Shrinking and dissolving
2.3
Farthest Minimum Isolating Cuts
First, we introduce the notion of farthest minimum isolating cut, which leads to a deep understanding about the structure of cut problems and forms the foundation of our algorithms. A minimum isolating cut 𝐶𝑖 of terminal 𝑡𝑖 separates the graph into two components. One that contains 𝑡𝑖 is called the residual of 𝐶𝑖 and denoted by 𝑅𝑖 . The other one is the remaining part that contains 𝑇−𝑖 , and it is called the outside of 𝐶𝑖 . The farthest minimum isolating cut of terminal 𝑡𝑖 is the minimum isolating cut that maximizes the cardinality of the residual 𝑅𝑖 . Here we use ‘the minimum isolating cut’ as opposed to ‘a minimum isolating cut’, since the farthest minimum isolating cut of a given terminal is unique. 1
When a vertex dissolves, the number of edges may increase, which will not cause trouble in our proofs. In our algorithms, the vertices to be dissolved are adjacent to a terminal. Therefore, we can implement the dissolving in the simpler way without increasing the problem size.
6
Mingyu Xiao
The uniqueness is discussed and used in the literature [20, 2, 21, 22]. It can be easily derived from the Max flow/Min cut theorem [20]. How fast we can find the farthest minimum isolating cut is directly related to the running time of our algorithms since finding the farthest minimum isolating cut is a subroutine in our algorithms. In fact, many algorithms for the Minimum (𝑠, 𝑡) Cut problem just find the farthest minimum isolating cut of 𝑠 or 𝑡. The farthest minimum isolating cut of 𝑡𝑖 can be found in linear time if a maximum flow from 𝑡𝑖 to 𝑇−𝑖 is given. There are many fast algorithms for computing maximum flows in the literature. Reader can refer to [23] as a survey. In this paper, we will use Dinic’s 𝑂(min(𝑛2/3 , 𝑚1/2 )𝑚)-time algorithm [24] for finding maximum flows in unweighted graphs to compute farthest minimum isolating cuts. We will also use 𝐶𝑖 to denote the farthest minimum isolating cut of 𝑡𝑖 , when there is no confusion. Lemma 1. The farthest minimum isolating cut of terminal 𝑡𝑖 will not change in the graph after 𝑒 shrinks (dissolves, for the vertex version), where 𝑒 is an edge (vertex) not in the farthest minimum isolating cut of 𝑡𝑖 . Proof. Let 𝐺 be the graph, 𝐶𝑖 the farthest minimum isolating cut of terminal 𝑡𝑖 in 𝐺, and 𝑒 an edge (vertex) not in 𝐶𝑖 . Let 𝐺 ⋅ 𝑒 be the graph after 𝑒 shrinks (dissolves), and 𝐶𝑖′ the farthest minimum isolating cut of 𝑡𝑖 in 𝐺 ⋅ 𝑒. Since we keep all resulting parallel edges when shrinking 𝑒, then 𝐶𝑖′ is also a corresponding isolating cut of 𝑡𝑖 in 𝐺. Since 𝑒 ∈ / 𝐶𝑖 , 𝐶𝑖 is also an isolating cut of 𝑡𝑖 in 𝐺 ⋅ 𝑒. Both 𝐶𝑖 and 𝐶𝑖′ are minimum isolating cuts of 𝑡𝑖 in 𝐺 and 𝐺 ⋅ 𝑒. Considering the uniqueness of the farthest minimum cuts in two graphs, we can easily get 𝐶𝑖 = 𝐶𝑖′ . Lemma 2. Let 𝐶𝑖 be a minimum isolating cut of terminal 𝑡𝑖 , and 𝑅𝑖 the residual of 𝐶𝑖 in graph 𝐺, (1 ≤ 𝑖 ≤ 𝑘). Then there is a minimum multiterminal cut 𝑆 ′ of 𝐺 such that 𝑆 ′ ∩ 𝐸(𝑅𝑖 ) = ∅ (𝑆 ′ ∩ 𝑉 (𝑅𝑖 ) = ∅, for the vertex version). Proof. We only give the proof of the vertex version. The edge version can be proved in the same way. Let 𝑆 be a minimum vertex multiterminal cut of 𝐺, 𝐶𝑃𝑖 the component of 𝐺 − 𝑆 that contains terminal 𝑡𝑖 , and 𝑆𝑖 ⊆ 𝑆 the minimum isolating cut of 𝑡𝑖 contained in 𝑆. Obviously, 𝑆𝑖 is the set of vertices adjacent to 𝐶𝑃𝑖 . Let 𝑉𝑖 = 𝑉 (𝑅𝑖 ) ∩ 𝑉 (𝐶𝑃𝑖 ) and 𝑉𝑖′ = 𝑉 (𝑅𝑖 ) ∪ 𝑉 (𝐶𝑃𝑖 ) (see Figure 3). Then each vertex in 𝑁 (𝑉𝑖 ) is either in 𝑆𝑖 or in 𝐶𝑖 . Let 𝐶𝑖′′ = 𝑁 (𝑉𝑖 ) ∩ 𝐶𝑖 , 𝑆𝑖′ = 𝑁 (𝑉𝑖 ) − 𝐶𝑖′′ , and 𝐶𝑖′ = 𝐶𝑖 − 𝐶𝑖′′ . Then we get 𝑆𝑖′ ⊆ 𝑆𝑖 and 𝑁 (𝑉𝑖′ ) = 𝑆𝑖 − 𝑆𝑖′ + 𝐶𝑖′ . Let 𝑆𝑖∗ = 𝑆 ∩ 𝑉 (𝑅𝑖 ). Then we get 𝑆𝑖′ ⊆ 𝑆𝑖∗ . We argue that 𝑆 ′ = 𝑆 − 𝑆𝑖∗ + 𝐶𝑖′ is a minimum multiterminal cut satisfying the constraints of the lemma. First, we prove that 𝑆 ′ is a multiterminal cut such that 𝑆 ′ ∩ 𝑉 (𝑅𝑖 ) = ∅. If there is any path 𝑃 from one terminal to another in 𝐺−𝑆 ′ , 𝑃 must pass through at least one vertex in 𝑆𝑖∗ . On the other hand, we can prove that 𝑆𝑖∗ and 𝑇−𝑖 are disconnected in 𝐺 − 𝑆 ′ . Since removal of 𝑁 (𝑉𝑖′ ) = 𝑆𝑖 − 𝑆𝑖′ + 𝐶𝑖′ disconnects
Parameterized Algorithms for Multiterminal Cuts
7
T− i Ci
V ( Ri ) − Vi V (CPi ) − Vi
Si
Vi ti
Fig. 3. Illustration for 𝑉𝑖 and 𝑉𝑖′
𝑆𝑖∗ ⊆ 𝑉𝑖′ and 𝑇−𝑖 , and 𝑁 (𝑉𝑖′ ) ⊆ 𝑆 ′ , we know that in 𝐺 − 𝑆 ′ no path from one terminal to another passes through a vertex in 𝑆𝑖∗ . Second, we prove that 𝑆 ′ is minimum. Since 𝑁 (𝑉𝑖 ) = 𝐶𝑖 − 𝐶𝑖′ + 𝑆𝑖′ is an isolating cut of 𝑡𝑖 and 𝐶𝑖 is a minimum isolating cut of 𝑡𝑖 , we get ∣𝐶𝑖 ∣ ≤ ∣𝑁 (𝑉𝑖 )∣ = ∣𝐶𝑖 − 𝐶𝑖′ + 𝑆𝑖′ ∣. and thus ∣𝑆𝑖′ ∣ ≥ ∣𝐶𝑖′ ∣.
(1)
Therefore, ∣𝑆 ′ ∣ = ∣𝑆 − 𝑆𝑖∗ + 𝐶𝑖′ ∣ ≤ ∣𝑆 − 𝑆𝑖′ + 𝐶𝑖′ ∣ = ∣𝑆∣ − ∣𝑆𝑖′ ∣ + ∣𝐶𝑖′ ∣ ≤ ∣𝑆∣. We have finished the proof. Corollary 1. Let 𝐶𝑖 be the farthest minimum isolating cut of terminal 𝑡𝑖 in 𝐺, and 𝐺′ be the graph obtained by merging 𝑅𝑖 into a new terminal 𝑡′𝑖 . Then any minimum multiterminal cut in 𝐺′ is a minimum multiterminal cut in 𝐺. Proof. It is obvious that any multiterminal cut in 𝐺′ is a corresponding multiterminal cut in 𝐺. We only need to prove that the size of the minimum multiterminal cut in 𝐺′ is not greater than the size of the minimum multiterminal cut in 𝐺. In the proof of Lemma 2, we construct a minimum multiterminal cut 𝑆 ′ in 𝐺 and 𝑆 ′ is still a corresponding multiterminal cut in 𝐺′ . Then the size of the minimum multiterminal cut in 𝐺′ is not greater than ∣𝑆 ′ ∣. Lemma 2 and Corollary 1 imply that we can find minimum multiterminal cuts in a reduced graph obtained by contracting the residuals of farthest minimum isolating cuts. We note that the edge version of Lemma 2 can also be inferred from the proof of Goldschmidt and Hochbaum’s main theorem in [21]. Dahlhaus et al. [2] also proved similar results of the edge version of Lemma 2 and Corollary 1 when discussing reducing the instance size of Edge Multiterminal Cut. However their arguments only work for the edge version.
8
3
Mingyu Xiao
The Algorithm for Edge Multiterminal Cut
In this section we will combine farthest minimum isolating cuts and bounded search tree technique to obtain an algorithm for Edge Multiterminal Cut. An interesting analysis enables us to bound the depth of the search tree by 𝑘−2 𝑘−1 𝑙, 𝑘−2
therefore bounding the running time of our algorithm by 𝑂(2 𝑘−1 𝑙 𝑘𝑇 (𝑛, 𝑚)). Before explaining the algorithm, we present some reduction rules to reduce the sizes of Edge Multiterminal Cut instances. Rule 1: For each terminal 𝑡𝑖 , let 𝐶𝑖 and 𝑅𝑖 be its farthest minimum isolating cut and the corresponding residual. We can contract 𝑅𝑖 in the graph to form terminal 𝑡𝑖 . Rule 2: We can remove all the edges that connect two terminals from the graph and put them into the solution.
The correctness of Rule 1 follows from Corollary 1 and the correctness of Rule 2 is obvious. For convenience, we call a Multiterminal Cut instance after applying Rule 1 and Rule 2 a reduced Edge Multiterminal Cut instance. In a reduced instance, the set of all the edges incident with terminal 𝑡𝑖 is the farthest minimum isolating cut 𝐶𝑖 of 𝑡𝑖 , and all the farthest minimum isolating cuts are pairwise disjoint. Rule 3: Given a reduced Edge Multiterminal Cut∪instance, let 𝐶𝑖 be a minimum 𝑘 isolating cut of terminal 𝑡𝑖 , (𝑖 = 1, 2, ⋅ ⋅ ⋅ , 𝑘). If ∣ 𝑖=1 𝐶𝑖 ∣ > 2𝑙, then there is no ∪𝑘 ∪ 𝑙𝑘 multiterminal cut with size at most 𝑙. If ∣ 𝑖=1 𝐶𝑖 ∣ ≤ 𝑘−1 , then 𝑖∕=𝑖′ 𝐶𝑖 is a multiterminal cut with size at most 𝑙, where 𝐶𝑖′ satisfies ∣𝐶𝑖′ ∣ = max𝑘𝑖=1 ∣𝐶𝑖 ∣. Lemma 3. Rule 3 is correct. Proof. Let 𝑆 be a minimum multiterminal cut and 𝑆𝑖 ⊆ 𝑆 the set of all edges incident with the component of 𝐺 − 𝑆 that contains 𝑡𝑖 (i.e., 𝑆𝑖 is the minimum isolating cut of 𝑡𝑖 contained in 𝑆), (𝑖 = 1, ⋅ ⋅ ⋅ , 𝑘). Since 𝑆 is a minimum multiterminal cut, each edge in 𝑆 is incident with two nontrivial components (components containing a terminal) of 𝐺 − 𝑆. We get 𝑘 ∑
∣𝑆𝑖 ∣ = 2∣𝑆∣.
(2)
𝑖=1
Since 𝐶𝑖 is a minimum isolating cut of 𝑡𝑖 and 𝑆𝑖 is also an isolating cut of 𝑡𝑖 , we have ∣𝐶𝑖 ∣ ≤ ∣𝑆𝑖 ∣. Therefore, ∣
𝑘 ∪
𝐶𝑖 ∣ =
𝑖=1
If
∑𝑘
𝑖=1
∣𝐶𝑖 ∣ > 2𝑙, then ∣𝑆∣ > 𝑙.
𝑘 ∑ 𝑖=1
∣𝐶𝑖 ∣ ≤
𝑘 ∑ 𝑖=1
∣𝑆𝑖 ∣ = 2∣𝑆∣.
Parameterized Algorithms for Multiterminal Cuts
9
∪ Next, we prove the second claim in Rule 3. It is obvious that 𝑖∕=𝑖′ 𝐶𝑖 is ∪𝑘 ∪ ∑𝑘 𝑙𝑘 𝑘−1 a multiterminal cut. If ∣ 𝑖=1 𝐶𝑖 ∣ ≤ 𝑘−1 , then ∣ 𝑖∕=𝑖′ 𝐶𝑖 ∣ ≤ ≤ 𝑖=1 ∣𝐶𝑖 ∣ 𝑘 𝑙𝑘 𝑘−1 ⋅ = 𝑙. 𝑘−1 𝑘 Based on these three reduction rules, we design a simple but effective parameterized algorithm for Edge Multiterminal Cut. Our algorithm is described in the following Figure 4.
EMC(𝐺, 𝑇, 𝑙) Input: A graph 𝐺 = (𝑉, 𝐸), a terminal set 𝑇 = (𝑡1 , 𝑡2 , ⋅ ⋅ ⋅ , 𝑡𝑘 ) ⊆ 𝑉 and an integer 𝑙. Output: An edge multiterminal cut of size at most 𝑙 when it exists and ⊥ when it does not exist. 1. For each terminal 𝑡𝑖 ∈ 𝑇 do Find its farthest minimum isolating cut 𝐶𝑖 and the corresponding residual 𝑅𝑖 ; Contract 𝑅𝑖 in 𝐺 to form terminal 𝑡𝑖 . 2. Let 𝐸 ′ be the set of edges that directly connect two terminals. If {𝐸 ′ ∕= ∅ & EMC(𝐺 − 𝐸 ′ , 𝑇, 𝑙 − ∣𝐸 ′ ∣) =⊥}, then return ⊥; If {𝐸 ′ ∕= ∅ & EMC(𝐺 − 𝐸 ′ , 𝑇, 𝑙 − ∣𝐸 ′ ∣) ∕=⊥}, ′ ′ ′ then ∪𝑘 return 𝐸 ∪EMC(𝐺 − 𝐸 , 𝑇, 𝑙 − ∣𝐸 ∣). 3. 𝐵 ←− 𝑖=1 𝐶𝑖 ; If {∣𝐵∣ > 2𝑙}, then return ⊥; 𝑙𝑘 If {∣𝐵∣ ≤ 𝑘−1 }, then return 𝐵 − 𝐶𝑖′ , where 𝐶𝑖′ satisfies ∣𝐶𝑖′ ∣ = max𝑘𝑖=1 ∣𝐶𝑖 ∣ and 𝑖′ ∈ {1, 2, ⋅ ⋅ ⋅ , 𝑘}. 4. Arbitrarily select an edge 𝑒 ∈ 𝐵; 𝐶1 ←− EMC(𝐺 ⋅ 𝑒, 𝑇, 𝑙); 𝐶2 ←− EMC(𝐺 − 𝑒, 𝑇, 𝑙 − 1). If {𝐶1 ∕=⊥}, then return 𝐶1 ; Else if {𝐶2 ∕=⊥}, then return {𝑒} ∪ 𝐶2 ; Else return ⊥. Fig. 4. The Algorithm EMC(𝐺, 𝑇, 𝑙)
The main idea of the algorithm is that we first use the three ∪𝑘reduction rules to reduce the instance size, and then branch on an edge in 𝐵 = 𝑖=1 𝐶𝑖 by either including the edge in the solution or excluding it from the solution. To analyze the time complexity of the algorithm, we build a recurrence re∪𝑘 lation based on the control value 𝑝 = 2𝑙 − ∣ 𝑖=1 𝐶𝑖 ∣. It is obvious that in our algorithm 𝑝 will not increase in Step 1 and Step 2, and the algorithm will stop in Step 3 when 𝑝 < 0. In Step 4, we branch on an edge 𝑒 by either including 𝑒 in the solution or excluding 𝑒 from the solution. We prove that in each branch 𝑝 will decrease by at least 1. When 𝑒 is included in the solution, then 𝑙 decreases
10
Mingyu Xiao
by 1. It is easy to see that 𝐶𝑖 − 𝑒 is the farthest minimum isolating cut of 𝑡𝑖 in 𝐺 − 𝑒. For any 𝑗 ∕= 𝑖, the size of the farthest minimum isolating cut in 𝐺 − 𝑒 will not change. (Note that if the farthest minimum isolating cut 𝐶𝑗′ of 𝑡𝑗 in 𝐺 − 𝑒 is of size less than 𝐶𝑗 , then 𝐶𝑗′ + 𝑒 is an isolating cut of 𝑡𝑗 in 𝐺 of size not greater than ∣𝐶𝑗 ∣, which will imply that 𝐶𝑗 is not the farthest minimum isolating cut of ∪𝑘 ∑𝑘 𝑡𝑗 .) Therefore, ∣ 𝑖=1 𝐶𝑖 ∣ = 𝑖=1 ∣𝐶𝑖 ∣ decreases by 1. Totally, 𝑝 decreases by 1. When 𝑒 shrinks, it is easy to see that the farthest minimum isolating cut of 𝑡𝑖 will increase its size by at least 1 and other farthest minimum isolating cuts will not change by Lemma 1. In this branch, 𝑝 will also decrease by at least 1. Let 𝐶(𝑝) be the size of the search tree generated by our algorithm when it is called on a problem with control value 𝑝, then we get 𝐶(𝑝) ≤ 𝐶(𝑝 − 1) + 𝐶(𝑝 − 1) + 1.
(3)
It is easy to verify that 𝐶(𝑝) = 𝑂(2𝑝 )
(4)
satisfies (3). ∪𝑘 Next, we determine an upper bound for 𝑝. Recall 𝑝 = 2𝑙 − ∣ 𝑖=1 𝐶𝑖 ∣. If ∪𝑘 𝑙𝑘 ∣ 𝑖=1 𝐶𝑖 ∣ ≤ 𝑘−1 , then we will find a solution in Step 3. Else we get 𝑝 = 2𝑙 − ∣
𝑘 ∪ 𝑖=1
𝐶𝑖 ∣
𝑘𝑙, then there is ∪𝑘 ∪ 𝑙𝑘 no vertex multiterminal cut with size at most 𝑙. If ∣ 𝑖=1 𝐶𝑖 ∣ ≤ 𝑘−1 , then 𝑖∕=𝑖′ 𝐶𝑖 is a multiterminal cut with size at most 𝑙, where 𝐶𝑖′ satisfies ∣𝐶𝑖′ ∣ = max𝑘𝑖=1 ∣𝐶𝑖 ∣. The reason why Rule 3 in Section 3 is not applicable to Vertex Multiterminal Cut is that (2) does not hold for minimum vertex multiterminal cuts. Instead, we have relation 𝑘 ∑
∣𝑆𝑖 ∣ ≤ 𝑘∣𝑆∣.
(6)
𝑖=1
Therefore, we get Rule 4′ . Similar to the algorithm in Section 3, we first use ∪ the four reduction rules to 𝑘 reduce the input size, then branch on a vertex in 𝐵 = 𝑖=1 𝐶𝑖 by either including ∪𝑘 it in the solution or excluding it form the solution. Put 𝑝 = 𝑘𝑙 −∣ 𝑖=1 𝐶𝑖 ∣. When we include a vertex 𝑣 ∈ 𝐵 in ∪𝑘the solution, 𝑙 decreases by 1. As we discussed in Section 3, in this branch, ∣ 𝑖=1 𝐶𝑖 ∣ will decrease by 1. Totally 𝑝 decreases by ∪𝑘 𝑘 − 1. When 𝑣 dissolves, 𝑙 does not change and ∣ 𝑖=1 𝐶𝑖 ∣ increases by at least 1. In this branch, 𝑝 will decrease by at least 1. We get the following recurrence relation: 𝐶(𝑝) ≤ 𝐶(𝑝 − 1) + 𝐶(𝑝 − (𝑘 − 1)) + 1,
(7)
where 𝐶(𝑝) is the size of the search tree generated by our algorithm when it is called on a∪problem with control value 𝑝. 𝑘 𝑘 𝑙, we have Since ∣ 𝑖=1 𝐶𝑖 ∣ > 𝑘−1
𝑝 = 𝑙𝑘 − ∣
𝑘 ∪ 𝑖=1
𝐶𝑖 ∣ < (𝑘 − 1)𝑙 −
1 𝑙. 𝑘−1
(8)
By using the substitution method, we can verify that when 𝑘 = 3, 4, 5 and 6, 𝐶(𝑝) = 𝑂(2.059𝑙 ), 𝑂(2.772𝑙 ), 𝑂(3.349𝑙 ) and 𝑂(3.857𝑙 ) respectively satisfy (7) and (8). The problem of bounding a function 𝐶(𝑟) satisfying a recurrence of the ∑ form 𝐶(𝑟) ≤ 𝐶(𝑟 − 𝑟𝑖 ) + 𝑂(1) has been extensively studied [25]. The bound is 𝑂([𝛼(𝑟, 𝑟1∑ , 𝑟2 , ⋅ ⋅ ⋅)]𝑟 ), where 𝛼(𝑟, 𝑟1 , 𝑟2 , ⋅ ⋅ ⋅) is the largest root of the function 𝑓 (𝑥) = 1 − 𝑥−𝑟𝑖 . Theorem 2. Vertex {3, 4, 5, 6}-Terminal Cuts can be solved in 𝑂(2.059𝑙 𝑇 (𝑛, 𝑚)), 𝑂(2.772𝑙 𝑇 (𝑛, 𝑚)), 𝑂(3.349𝑙 𝑇 (𝑛, 𝑚)) and 𝑂(3.857𝑙 𝑇 (𝑛, 𝑚)) time respectively.
12
Mingyu Xiao
For general 𝑘, we will relax more to get a simplified running time bound. It is clear that 𝐶(𝑝) ≤ 𝐶(𝑝 − 1) + 𝐶(𝑝 − (𝑘 − 1)) + 1 ≤ 𝐶(𝑝 − 2) + 2𝐶(𝑝 − (𝑘 − 1)) + 2 ≤ ⋅ ⋅ ⋅ ≤ 𝐶(𝑝 − (𝑘 − 1)) + (𝑘 − 1)𝐶(𝑝 − (𝑘 − 1)) + (𝑘 − 1) = 𝑘𝐶(𝑝 − (𝑘 − 1)) + (𝑘 − 1). Therefore, 𝐶(𝑝) = Since
⌈ 𝑝 ⌉ 𝑘 𝑘−1