University of Electronic Science and Technology of China, Chengdu, [email protected] of Electronic Science and Technology of China, Chengdu, [email protected]://orcid.org/0000-0002-1012-2373 \CopyrightJ. Open Access and J.βR. Public \ccsdesc[100]Theory of computation Parameterized complexity and exact algorithms
Acknowledgements.
I want to thank β¦\EventEditorsJohn Q. Open and Joan R. Access \EventNoEds2 \EventLongTitle42nd Conference on Very Important Topics (CVIT 2016) \EventShortTitleCVIT 2016 \EventAcronymCVIT \EventYear2016 \EventDateDecember 24β27, 2016 \EventLocationLittle Whinging, United Kingdom \EventLogo \SeriesVolume42 \ArticleNo23Solving Co-Path/Cycle Packing and Co-Path Packing Faster Than
Abstract
The Co-Path/Cycle Packing problem (resp. The Co-Path Packing problem) asks whether we can delete at most vertices from the input graph such that the remaining graph is a collection of induced paths and cycles (resp. induced paths). These two problems are fundamental graph problems that have important applications in bioinformatics. Although these two problems have been extensively studied in parameterized algorithms, it seems hard to break the running time bound . In 2015, Feng et al. provided an -time randomized algorithms for both of them. Recently, Tsur showed that they can be solved in time deterministically. In this paper, by combining several techniques such as path decomposition, dynamic programming, cut & count, and branch-and-search methods, we show that Co-Path/Cycle Packing can be solved in time deterministically and Co-Path Packing can be solved in time with failure probability . As a by-product, we also show that the Co-Path Packing problem can be solved in time with probability at least 2/3 if a path decomposition of width is given.
keywords:
Graph Algorithms, Parameterized Algorithms, Co-Path/Cycle Packing, Co-Path Packing, Cut & Count, Path Decompositioncategory:
\relatedversion1 Introduction
In the classic Vertex Cover problem, the input is a graph and an integer , and the problem asks whether it is possible to delete at most vertices such that the maximum degree of the remaining graph is at most 0. A natural generalization of Vertex Cover is that: can we delete at most vertices such that the maximum degree of the remaining graph is at most ? Formally, for every integer , we consider the following -Bounded-Degree Vertex Deletion problem.
Β
-Bounded-Degree Vertex Deletion
Instance: A graph and two integers and .
Question: Is there a set of at most vertices whose removal from results in a graph with maximum degree at most ?
Β
The -Bounded-Degree Vertex Deletion problem finds applications in computational biologyΒ [7] and social network analysisΒ [16]. In this paper, we focus on the case that , which is referred to as the Co-Path/Cycle Packing problem. The Co-Path/Cycle Packing problem also has many applications in computational biologyΒ [4]. Formally, the Co-Path/Cycle Packing problem is defined as follows.
Β
Co-Path/Cycle Packing
Instance: A graph and an integer .
Question: Is there a vertex subset of size at most whose deletion makes the graph a collection of induced paths and cycles?
Β
We also focus on a similar problem called Co-Path Packing, which allows only paths in the remaining graph, defined as follows.
Β
Co-Path Packing
Instance: A graph and an integer .
Question: Is there a vertex subset of size at most whose deletion makes the graph a collection of induced paths?
Β
Related Work. In this paper, we mainly consider parameterized algorithms. When is an input, the general -Bounded-Degree Vertex Deletion problem is W[2]-hard with the parameter Β [7]. XiaoΒ [22] gave a deterministic algorithm that solves -Bounded-Degree Vertex Deletion in time for every , which implies that the problem is FPT with parameter . In term of treewidth (tw), van RooijΒ [21] gave an -time algorithm to solve -Bounded-Degree Vertex Deletion for every . Lampis and VasilakisΒ [14] showed that no algorithm can solve -Bounded-Degree Vertex Deletion in time , for any and for any fixed unless the SETH is false. The upper and lower bounds have matched. This problem has also been extensively studied in kernelization. Fellows et al.Β [7] and XiaoΒ [23] gave a generated form of the NT-theorem that then provided polynomial kernels for the problem with each fixed .
For each fixed small , -Bounded-Degree Vertex Deletion has also been paid certain attention. The -Bounded-Degree Vertex Deletion problem is referred to as Vertex Cover, which is one of the most fundamental problems in parameterized algorithms. For a long period of time, the algorithm of Chen et al.Β [3] held the best-known running time of , and recently this result was improved by Harris and NarayanaswamyΒ [11] to . The -Bounded-Degree Vertex Deletion problem is referred to as Vertex Cover, where TuΒ [20] achieved a running time of by using iterative compression. This result was later improved by KatreniΔΒ [12] to . Then, Chang et. al.Β [2] gave an -time polynomial-space algorithm and an -time exponential-space algorithm. Xiao and KouΒ [24] gave an -time polynomial-space algorithm. This result was improved by TsurΒ [18] to through a branch-and-search approach and finally by Δervenα»³ and Suchα»³Β [1] to through using an automated framework for generating parameterized branching algorithms.
Co-Path/Cycle Packing is the special case of -Bounded-Degree Vertex Deletion with . A closely related problem is Co-Path Packing, where even cycles are not allowed in the remaining graph. Chen et al.Β [4] initially showed that Co-Path/Cycle Packing and Co-Path Packing can be solved in time, and a finding subsequently refined to for Co-Path/Cycle Packing by XiaoΒ [22]. Feng et al.Β [8] introduced a randomized -time algorithm for the Co-Path Packing, which also works for Co-Path/Cycle Packing. However, we do not know how to derandomize this algorithm. Recently, TsurΒ [19] provided -time algorithms solving Co-Path/Cycle Packing and Co-Path Packing deterministically. It seems that the bound is hard to break for the two problems. As shown in Tsurβs algorithmsΒ [19], many cases, including the case of handling all degree-4 vertices, lead to the same bottleneck. One of the main targets in this paper is to break those bottlenecks. Previous results and our results for Co-Path/Cycle Packing and Co-Path Packing are summarized in TableΒ 1.
Years | References | Co-Path/Cycle | Deterministic | Co-Path | Deterministic |
---|---|---|---|---|---|
2010 | Chen et al.Β [4] | Yes | Yes | ||
2015 | Feng et al.Β [8] | No | No | ||
2016 | XiaoΒ [22] | Yes | - | - | |
2022 | TsurΒ [19] | Yes | Yes | ||
2024 | This paper | Yes | No |
Our Contributions. The main contributions of this paper are a deterministic algorithm for Co-Path/Cycle Packing running in time and space and a randomized algorithm for Co-Path Packing running in time and space with failure probability . To obtain this result, we need to combine path decomposition, dynamic programming, branch-and-search and some other techniques. In the previous -time algorithms for both Co-Path/Cycle Packing and Co-Path Packing, many cases, including dealing with degree-4 vertices and several different types of degree-3 vertices, lead to the same bottleneck. It seems very hard to avoid all the bottleneck cases by simply modifying the previous algorithms. The main idea of the algorithm in this paper is as follows. We first design some new reduction and branching rules to handle some good structures of the graph. After this, we prove that the remaining graph has a small pathwidth and then design an efficient dynamic programming algorithm based on a path decomposition. Specifically, our algorithm firstly runs the branch-and-search algorithm to handle the degree- vertices and the degree-4 vertices adjacent to at least one degree- vertex. In the branch-and-search phase, our algorithm runs in time for both Co-Path/Cycle Packing and Co-Path Packing. When branching steps cannot be applied, we can construct a path decomposition of width at most for any and call our dynamic programming algorithm. The running time and space of the dynamic programming algorithm are bounded by for Co-Path/Cycle Packing and bounded by with failure probability for Co-Path Packing. Therefore, the whole algorithm runs in time and space for Co-Path/Cycle Packing and runs in time and space with failure probability for Co-Path Packing.
For the dynamic programming algorithms based on a path decomposition, the first algorithm is an -time algorithm to solve -Bounded-Degree Vertex Deletion for every , where is the width of the given path decomposition. This was firstly found inΒ [21]. We also present it in our way to make this paper self-contained. The second algorithm is designed for Co-Path Packing. In this algorithm, we use an algorithm framework called cut & countΒ [6]. Given a path decomposition of width , we show that Co-Path Packing can be solved in time and space with failure probability .
Reading Guide. Section 2 begins with a review of fundamental definitions and the establishment of notation. In Section 3 we solve Co-Path/Cycle Packing and in section 4 we solve Co-Path Packing. In Section 3.1, we show that a proper graph has a small pathwidth and present a dynamic programming algorithm for Co-Path/Cycle Packing. In Section 3.2, we give the branch-and-search algorithm for Co-Path/Cycle Packing. Similarly, in Section 4.1, we present a randomized dynamic programming algorithm for Co-Path Packing. In Section 4.2, we give the branch-and-search algorithm for Co-Path Packing. Most of the content of this branching algorithm is the same as the branching algorithm for Co-Path/Cycle Packing. Due to lack of space, Sections 1-3 can be seen as the short version. In Section 5, we give a conclusion.
The proof of theorems marked is placed in the appendix.
2 Preliminaries
In this paper, we only consider simple and undirected graphs. Let be a graph with vertices and edges. A vertex is called a neighbor of a vertex if there is an edge . Let denote the set of neighbors of . For a subset of vertices , let and . We use to denote the degree of a vertex in . A vertex of degree is called a degree- vertex. For a subset of vertices , the subgraph induced by is denoted by . The induced subgraph is also written as . A path in is a sequence of vertices such that for any . Two vertices and are reachable to each other if there is a path such that and . A connected component of a graph is a maximum subgraph such that any two vertices are reachable to each other. A vertex subset is called a cPCP-set of graph if the degree of any vertex in is at most 2. A vertex subset is called a cPP-set of graph if is a collection of disjoint paths. For a graph , we will use and to denote the vertex set and edge set of it, respectively. A complete graph with 3 vertices is called a triangle. A singleton may be denoted as .
Path decomposition. We will use the concepts of path decomposition and nice path decomposition of a graph.
Definition 2.1 ([5]).
A path decomposition of a graph is a sequence of vertex subsets such that:
(P1) .
(P2) For every , there exists such that contains both and .
(P3) For every , if for some , then for all .
For a path decomposition of a graph, each vertex subset in it is called a bag. The width of the path decomposition is . The pathwidth of a graph , denoted by pw(), is the minimum possible width of a path decomposition of . A path decomposition is nice if and for every there is either a vertex such that , or there is a vertex such that . The following lemma shows that any path decomposition can be turned into a nice path decomposition without increasing the width.
Lemma 2.2 ([5]).
If a graph admits a path decomposition of width at most , then it also admits a nice path decomposition of width at most . Moreover, given a path decomposition of of width at most , one can in time compute a nice path decomposition of of width at most .
There are also easy ways to reduce the length of a path decomposition to a polynomial of the graph size. Next, we will also assume that is bounded by a polynomial of the number of vertices. In terms of the pathwidth, there is a known bound.
Theorem 2.3 ([10]).
For any , there exists an integer such that for every graph with vertices,
where is the number of vertices of degree in and is the number of vertices of degree at least 5. Moreover, a path decomposition of the corresponding width can be constructed in polynomial time.
Branch-and-Search Algorithm. For a branch-and-search algorithm, we use a parameter of the instance to measure the running time of the algorithm. Let denote the maximum size of the search tree generated by the algorithm when running on an instance with the parameter no greater than . Assume that a branching operation generates branches and the measure in the -th instance decreases by at least . This operation generates a recurrence relation
The largest root of the function is called the branching factor of the recurrence. Let denote the maximum branching factor among all branching factors in the search tree. The running time of the algorithm is bounded by . For more details about analyzing branch-and-search algorithms, please refer toΒ [13].
3 A Parameterized Algorithm for Co-Path/Cycle Packing
In this section, we propose a parameterized algorithm for Co-Path/Cycle Packing. First, in Section 3.1, we show that Co-Path/Cycle Packing on a special graph class, called proper graph, can be quickly solved by using the dynamic programming algorithm based on path decompositions in Theorem 3.5. The key point in this section is to bound the pathwidth of proper graphs by for any . Second, in Section 3.2, we give a branch-and-search algorithm that will implement some branching steps on special local graph structures. When there is no good structure to apply our branching rules, we show that the graph must be a proper graph and then the algorithm in Section 3.1 can be called directly to solve the problem.
3.1 Proper Graphs with Small Pathwidth
A graph is called proper if it satisfies the following conditions:
-
1.
The maximum degree of is at most 4.
-
2.
For any degree-4 vertex , all neighbors are of degree at most 2.
-
3.
For any degree-2 vertex , at least one vertex in is of degree at least 3.
-
4.
Each connected component contains at least 6 vertices.
We are going to solve Co-Path/Cycle Packing on proper graphs first. Next, we try to bound the pathwidth of proper graphs.
Lemma 3.1.
Let be a proper graph. If has a -set (resp. -set) of size at most , then it holds that
(1) |
where and are the number of degree-3 and degree-4 vertices in , respectively.
Proof 3.2.
Assume that there is a cPCP-set (resp. cPP-set) of size at most . Let . Let and be the set of degree-3 and degree-4 vertices in , respectively. Let and . Let be the number of degree-4 vertices in . See Figure 1 for an illustration.
Since the degree of any vertex in is at most 2, the number of edges between and is at least . Since is proper, for any degree-4 vertex , there is no degree- vertex in . So we have that the number of edges between and is at most . So we have that
(2) |
Let be the number of degree- vertices in for any . By the fourth condition of the proper graph, we have that . We also have that , . Inequality (2) implies that
(3) |
By the third condition of the proper graph, we have that
(4) |
For degree-1 vertices, also by the fourth condition of the proper graph, we have that
(5) |
Inequalities (3), (4) and (5) together imply that
(6) |
Since , inequality (2) implies that
Lemma 3.3.
Let be a proper graph. For any , in polynomial time we can either decide that has no cPCP-set (resp. cPP-set) of size at most or compute a path decomposition of width at most .
Proof 3.4.
Our algorithm is defined as follows. Let and be the number of degree-3 and degree-4 vertices in , respectively. First, we check whether and in polynomial time. If oder , by Lemma 3.1, we can decide that has no cPCP-set (resp. cPP-set) of size at most . Otherwise, let . By Theorem 2.3, we can obtain a path decomposition of width at most . This lemma holds.
The following theorem shows that there exists an algorithm for the general -Bounded-Degree Vertex Deletion problem based on a given path decomposition of the graph. The running time bound of the algorithm is , where is the width of the given path decomposition. Previously, an -time algorithm for -Bounded-Degree Vertex Deletion was knownΒ [2]. Recently, this result was extended for any by van RooijΒ [21]. We also present it (in the appendix) in our way to make this paper self-contained.
Theorem 3.5 ().
Given a path decomposition of with width . For any , -Bounded-Degree Vertex Deletion can be solved in time and space.
However, the algorithm given in Theorem 3.5 cannot be used to solve Co-Path Packing since there is a global connectivity constraint for Co-Path Packing. We will discuss it in Section 4. Based on Theorem 3.5, we have the following lemma.
Lemma 3.6.
Co-Path/Cycle Packing on proper graphs can be solved in time.
Proof 3.7.
We first call the algorithm in Lemma 3.3. If the algorithm decides that has no -set of size at most , we claim that is a no-instance. Otherwise, we can obtain a nice path decomposition of width at most . Then we call the algorithm in Theorem 3.5. This algorithm runs in , where we choose . This lemma holds.
3.2 A Branch-and-Search Algorithm
In this subsection, we provide a branch-and-search algorithm for Co-Path/Cycle Packing, which is denoted by . Our algorithm contains several reduction and branching steps. After recursively executing these steps, we will get a proper graph and then call the dynamic programming algorithm in Section 3.1 to solve it.
3.2.1 Reduction and Branching Rules
Firstly we have a reduction rule to reduce small connected components.
Reduction-Rule 1.
If there is a connected component of the graph such that , then run a brute force algorithm to find a minimum cPCP-set in , delete and include in the deletion set.
Lemma 3.8.
Let and be two adjacent vertices of degree at most 2 in and be the graph after deleting edge from . Then is a yes-instance if and only if is a yes-instance.
This lemma holds because adding an edge between two vertices of degree at most 1 back to a graph will not make the two vertices of degree greater than 2. Based on this lemma, we have the following reduction rule.
Reduction-Rule 2.
If there are two adjacent vertices and of degree at most 2, then return .
Lemma 3.9.
Let be a triangle such that . Let be the vertex in . There is a minimum cPCP-set containing .
This lemma holds because we must delete at least one vertex in and delete any vertex in cannot decrease the degree of vertices in . Based on this lemma, we have the following reduction rule.
Reduction-Rule 3.
If there is a triangle such that , then return .
After applying the three simple reduction rules, we will execute some branching steps. Although we have several branching steps, most of them are based on the following two branching rules.
For a vertex of degree at least 3, either it is included in the deletion set or it remains in the graph. For the latter case, there are at most two vertices in that can remain in the graph. So we have the following branching rule.
Branching-Rule (B1). For a vertex of degree at least 3, branch on it to generate branches by either (i) deleting from the graph and including it in the deletion set, or (ii) for every pair of vertices and in , deleting from the graph and including in the deletion set.
A vertex dominates a vertex if . We have the following property for dominated vertices.
Lemma 3.10.
If a vertex dominates a vertex , then there is a minimum cPCP-set either containing or containing none of and .
Proof 3.11.
Let be a cPCP-set. Assume to the contrary that . Since dominates , we know that is still a feasible cPCP-set with . There is a minimum cPCP-set containing . This lemma holds.
Assume that dominates . By LemmaΒ 3.10, we know that either is included in the deletion set or both of and remain in the graph. For the latter case, there are at most two vertices in that can remain in the graph. Thus, at least vertices in will be deleted. We get the following branching rule.
Branching-Rule (B2). Assume that a vertex of degree at least 3 dominates a vertex . Branch on to generate branches by either (i) deleting from the graph and including it in the deletion set, or (ii) for each vertex , deleting from the graph and including in the deletion set.
3.2.2 Steps
When we execute one step, we assume that all previous steps are not applicable in the current graph anymore. We will analyze each step after describing it.
Step 1 (Vertices of degree at least 5). If there is a vertex of , then branch on with Branching-Rule (B1) to generate branches and return the best of
For this step, we get a recurrence
where . For the worst case that , the branching factor of it is 2.5445.
After Step 1, the graph contains only vertices with degree at most 4.
Step 2 (Degree-4 vertices dominating some vertex of degree at least 3). Assume that there is a degree-4 vertex that dominates a vertex , where . Without loss of generality, we assume that the other three neighbors of are and , and is adjacent to and ( is further adjacent to if ). See Figure 2 for an illustration. We branch on with Branching-Rule (B2) and get branches
The corresponding recurrence is
which has a branching factor of 2.3028.
A triangle is called heavy if it holds that .
Step 3 (Degree-4 vertices in a heavy triangle). Assume that a degree-4 vertex is in a heavy triangle. Let , , and be the four neighbors of , where we assume without loss of generality that is a heavy triangle. See Figure 3 for an illustration. We branch on with Branching-Rule (B1). In the branch of deleting , we can simply assume that the three vertices and are not deleted, otherwise this branch can be covered by another branch and then it can be ignored. Since and form a triangle, we need to delete all the vertices in in this branch. Note that is a heavy triangle and we have that . We generate the following + 1 branches
The corresponding recurrence is
where . For the worst case that , the branching factor of it is 2.8186.
Lemma 3.12.
If a vertex has two degree-1 neighbors and , then there is a minimum cPCP-set containing none of and . Furthermore, If is a vertex of degree at most 3, then there is a minimum cPCP-set containing none of , , and .
Proof 3.13.
Let be a minimum cPCP-set. If , then is still a minimum cPCP-set. Next, we assume that . If at least one of and is in , then is a cPCP-set with . Thus, is a minimum cPCP-set not containing and .
If is a degree-2 vertex, then the component containing is a path of three vertices. None of the three vertices should be deleted. If is a degree-3 vertex, we let be the third neighbor of . Note that at least one vertex in should be deleted and then any solution will contain at least one vertex in . We can see that is still a cPCP-set with size . There is always a minimum cPCP-set containing none of , , and .
Step 4 (Degree-4 vertices in a triangle). Assume that there is still a degree-4 vertex in a triangle . We also let , , and be the four neighbors of . Since triangle can not be a heavy triangle now, we know that . First, we show that it is impossible . Assume to the contrary that . Then and can only be adjacent to vertices in . If both of and are degree-2 vertices, then Reduction-Rule 1 should be applied. If one of and is a vertex of degree at least 3, then would dominate this vertex, and then the condition of Step 2 would hold. Any case is impossible. Next, we assume that and let denote the third vertex in . We further consider several different cases.
Case 1: One of and , say is a degree-4 vertex. For this case, vertex is adjacent to , otherwise the degree-4 vertex would dominate the degree-4 vertex . Since is of degree 4, we know that is also adjacent to one of and , say . Vertices and can only be adjacent to vertices in , otherwise oder would form a heavy triangle and Step 3 should be applied. Thus, neither nor can be a degree-3 vertex, otherwise degree-4 vertex oder dominates a degree-3 vertex oder and then Step 2 should be applied. Thus, we have that either oder . We further consider the following three cases:
Case 1.1: . For this case, we have that dominates and . By Lemma 3.10, we have that there is a minimum cPCP-set either containing or containing none of , and . For the first branch, we delete from the graph and include it in the deletion set. For the second branch, we delete and from the graph and include it in the deletion set. The corresponding recurrence is
the branching factor of which is 1.6181.
Case 1.2: and and are not adjacent. For this case, both of and are adjacent to and . Since does not dominate , we know that is adjacent to at least one vertex out of . Since triangle is not a heavy triangle, we know that is not adjacent to any vertex other than . Thus, is also adjacent to . Since the maximum degree of the graph is 4 now, we know that this component only contains six degree-4 vertices , which should be eliminated by Reduction-Rule 2.
Case 1.3: and and are adjacent. For this case, since does not dominate , we know that is adjacent to at least one vertex out of . This vertex can only be . Thus, the four neighbors of are , , and . Now is a degree-4 vertex dominating a degree-4 vertex . Step 2 should be applied. Thus, this case is impossible.
Case 2: Both of and are degree-3 vertices. It holds that and , otherwise vertex would dominate oder . See Figure 4 for an illustration. For this case, we first branch on with Branching-Rule (B1) to generate branches. We can only get a recurrence relation
This recurrence is not good enough. Next, we look at the branch of deleting and try to get some improvements on this subbranch. After deleting , vertices and become degree-2 vertices in a triangle. We first apply Reduction-Rule 1 to delete edge between and . Then, vertices and become degree-1 vertices adjacent to .
Case 2.1: is a degree-2 vertex. This case is impossible otherwise Reduction Rule 3 would be applied before this step.
Case 2.2: is a degree-3 vertex. By Lemma 3.12, we can delete directly and include the third neighbor of in the deletion set. We generate the following + 1 branches
The corresponding recurrence is
which has a branching factor of 2.6458.
Case 2.3: is a degree-4 vertex. By Lemma 3.12, we know that there is a minimum cPCP-set either containing or containing none of , and . For the first case, we delete and include it in the deletion set. For the second case, we delete from the graph and include in the deletion set. Note that since is a degree-4 vertex. Combining with the previous branching on , we get the following + 2 branches
The corresponding recurrence is
which has a branching factor of 2.7145.
After Step 4, no degree-4 vertex is in a triangle.
Step 5 (Degree-4 vertices adjacent to some vertex of degree at least 3). Assume there is a degree-4 vertex adjacent to at least one vertex of degree at least 3. Let , , and be the four neighbors of , where we assume without loss of generality that . First, we branch on by either (b1) including it in the solution set or (b2) excluding it from the solution set. Next, we focus on the latter case (b2). In (b2), we further branch on by (b2.1) either including it in the solution set or (b2.2) excluding it from the solution set. For case (b2.1), there are at least vertices in that should be deleted by the same argument for Branching-Rule (B1). Thus, we can generate three subbranches by deleting , , and , respectively. For case (b2.2), there are still at least vertices in that should be deleted, which can be one of the following three sets , , and . Furthermore, there are also at least vertices in that should be deleted. Note that is not allowed to be deleted now. Thus, at least vertices in should be deleted. We will generate branches by decreasing by . Since after Step 3, the degree-4 vertex is not in any triangle, we know that is disjoint with . For case (b2.2), we will generate subbranches by decreasing by at least in each, where or 4. See Figure 5 for an illustration. In total, we will generate the following 1+3+ branches
We get a recurrence
where or 4. For the case that , the branching factor is 2.8192, and for the case that , the branching factor is 2.6328.
The worst branching factors in the above five steps are listed in Table 2. After Step 5, any degree-4 vertex can be only adjacent to vertices of degree at most 2. It is easy to see that the remaining graph after Step 5 is a proper graph. We call the algorithm in Lemma 3.6 to solve the instance in time.
Steps | Step 1 | Step 2 | Step 3 | Step 4 | Step 5 |
---|---|---|---|---|---|
Branching factors | 2.5445 | 2.3028 | 2.8186 | 2.7145 | 2.8192 |
Theorem 3.14.
Co-Path/Cycle Packing can be solved in time.
Fomin et al.Β [9] introduced the monotone local search technique for deriving exact exponential-time algorithms from parameterized algorithms. Under some conditions, a -time algorithm implies an algorithm with running time . By applying this technique on our -time algorithm in Theorem 3.14, we know that Co-Path/Cycle Packing can be solved in time.
Corollary 3.15.
Co-Path/Cycle Packing can be solved in time.
4 A Parameterized Algorithm for Co-Path Packing
In this section, we show a randomized time algorithm for Co-Path Packing. We also use the method for Co-Path/Cycle Packing, which consists of two phases. The first one is the dynamic programming phase, and the second one is the branch-and-search phase.
In the dynamic programming phase, it is more difficult to solve Co-Path Packing based on a path decomposition in comparison to Co-Path/Cycle Packing. The reason is that Co-Path/Cycle Packing involves only local constraints, which means that the objectβs properties can be verified by checking each vertexβs neighborhood independently. For this problem, a typical dynamic programming approach can be used to design a time algorithm straightforwardly. In contrast, there is a global connectivity constraint for Co-Path Packing. The problem with global connectivity constraint is also called connectivity-type problem. For connectivity-type problems, the typical dynamic programming approach has to keep track of all possible ways the solution can traverse the corresponding separator of the path decomposition that is , where is the size of the separator and hence the pathwidthΒ [6].
To obtain a single exponential algorithm parametrized by pathwidth for Co-Path Packing, we use the cut & count framework. Previously, cut & count significantly improved the known bounds for various well-studied connectivity-type problems, such as Hamiltonian Path, Steiner Tree, and Feedback Vertex SetΒ [6]. Additionally, for -Co-Path Set, cut & count has been used to obtain a fast parameterized algorithmΒ [17]. In Section 4.1, we present a randomized fpt algorithm with complexity for Co-Path Packing.
In the branch-and-search phase, our algorithm for Co-Path Packing is similar to the branching algorithm for Co-Path/Cycle Packing. Specifically, our branching algorithm for Co-Path Packing contains two reduction rules, two branching rules, and four steps, while the first reduction rule, both two branching rules, the first two steps, and the last step are the same as the branching algorithm for Co-Path/Cycle Packing. The branch-and-search phase is shown in Section 4.2.
4.1 A DP Algorithm via Cut & Count for Co-Path Packing
In this section, we use the cut & count framework to design a one-sided error Monte Carlo algorithm with a constant probability of a false negative for Co-Path Packing.
4.1.1 Cutting
In this subsection, we first introduce the definitions of consistent cuts and marked consistent cuts. Then we show the Isolation Lemma.
Definition 4.1.
A partition of is a consistent cut of a graph if there is no edge such that and . Furthermore, all degree-0 vertices are contained in .
By the definition of consistent cut, each non-isolate connected component must be contained fully in oder . So we have that a graph has exactly consistent cuts, where is the number of connected components and is the number of degree-0 vertices. A marker set is an edge set .
Definition 4.2.
A triple is a marked consistent cut of a graph if is a consistent cut and . A marker set is proper if it contains at least one edge in each non-isolate connected component of .
Note that if a marked consistent cut contains a proper marker set, all vertices are contained in . The reason is that by the definition of marked consistent cut, any non-isolate connected component containing a marker must be contained in . Additionally, all degree-0 vertices are contained in . Therefore, If is a proper marker set, there exists exactly one corresponding consistent cut with . Conversely, if is not a proper marker set, there are an even number of consistent cuts with , since there exists at least one unmarked non-isolate connected component that could be contained in either oder .
We call an induced subgraph of a cc-solution if is a collection of disjoint paths.
Definition 4.3.
A pair is a marked-cc-solution of a graph if is a cc-solution and is a proper marker set with size exactly equals to the number of non-isolate connected components of .
If there exists a cc-solution with vertices, then we can claim that there exists a cPP-set with size . Furthermore, if there exists a marked-cc-solution with vertices, which means that there exists a cc-solution with vertices, then we can also claim that there exists a cPP-set with size .
A function isolates a set family if there is an unique with , where .
Lemma 4.4 (Isolation LemmaΒ [15]).
Let be a set family over an universe with . For each , choose a weight uniformly and independently at random. Then
4.1.2 Counting
Definition 4.5.
For some values , and , A pair is a cc-candidate of a graph if is an induced subgraph of with maximum degree 2, exactly vertices and edges, and is a marked consistent cut of with markers.
Counting marked-cc-solutions remains difficult on a path decomposition since any feasible marked-cc-solution must include a cycle-free induced subgraph . However, it is important to note that there is no global connectivity constraint for cc-candidates. Therefore, counting cc-candidates is easier than counting marked-cc-solutions. The following lemma shows that we can count cc-candidates instead of marked-cc-solutions in .For a graph , assuming there is a weight function . The weight of a marked-cc-solution is defined as . The weight of a cc-candidates is also defined as .
Lemma 4.6.
The parity of the number of marked-cc-solutions in with vertices, edges and weight is the same as the parity of the number of cc-candidates with vertices, edges, markers, and weight .
Proof 4.7.
Consider an induced subgraph of and a marker set of . Now we consider the following three cases.
Case 1. oder oder oder : In this case, contributes 0 to both the number of marked-cc-solutions and the number of cc-candidates, respectively.
Case 2. There is a cycle in : In this case, is not a feasible marked-cc-solution and contributes 0 to the number of marked-cc-solutions. Since there is a cycle in , we know that . The number of non-isolate connected components is greater than . So, there exists one non-isolate connected component containing no marker. Since this connected component could be contained in either oder , we have that there are an even number of feasible consistent cuts such that is a cc-candidate. Thus, contributes an even number to the number of cc-candidates.
Case 3. There is no cycle in : In this case, is a feasible cc-solution. We further consider two cases.
Case 3.1. is not a proper marker set: In this case, is also not a feasible marked-cc-solution and contributes 0 to the number of marked-cc-solutions. By the definition of proper marker set, we have that there is one non-isolate connected component containing no marker. Following a similar argument in Case 2, we have that contributes an even number to the number of cc-candidates.
Case 3.2. is a proper marker set: In this case, is a feasible marked-cc-solution and contributes 1 to the number of marked-cc-solutions. By the definition of proper marker set, we have that every non-isolate connected component contains a marker. Therefore, each connected component can only be contained in . There is exactly one feasible consistent cut such that is a cc-candidate. Thus, contributes 1 to the number of cc-candidates.
Thus, For any subgraph of and any marker set of , either contributes 1 to both the number of marked-cc-solutions and cc-candidates, or contributes 0 to marked-cc-solutions and an even number to cc-candidates. This lemma holds.
The following lemma shows the algorithm to count the number of cc-candidates in a given path decomposition.
Lemma 4.8.
Given a graph and a path decomposition of with width . For any Determining the parity of the number of cc-candidates of with degree-0 vertices, vertices, edges, markers, and weight can be solved in time and space.
Proof 4.9.
Similar to the proof of Theorem 3.5. We simply assume that the path decomposition is a nice path decomposition by Lemma 2.2.
Let for each . We have . For any , let be an arbitrary partition of . We consider the following subproblem: to count the number of cc-candidates of the induced graph such that is a feasible cc-candidate with degree-0 vertices, vertices, edges, markers, and weight . And each vertex in is a degree-0 vertex in ; each vertex in is a degree-1 vertex in ; each vertex in is a degree-2 vertex in oder . We also let denote the corresponding number of the cc-candidates to this problem. We only need to check the value since . Next, we use a dynamic programming method to compute all .
For the case that , and it trivially holds that and other input equals to 0. Since the path decomposition is nice, there are two cases for each .
Case 1: for some . By the definition of path decomposition, we know that all neighbors of in the graph must be in . For every parameter combination and every partition of , the following holds.
-
1.
. It holds .
-
2.
for some . Let . We further consider two subcases.
Case (a): oder :
For this case, the partition is infeasible and we simply have that
Case (b): and . Let be the vertex contained in . We further consider two cases.
Case (b.1): :
(i) If , the consistent cut corresponding to is infeasible and we simply have that
(ii) If , we have that
(iii) If , we have that
Case (b.2): :
(i) If , the consistent cut corresponding to is infeasible and we simply have that
(ii) If , we have that
(iii) If , we have that
-
3.
. Let . We further consider two subcases.
Case (a): oder :
For this case, the partition is infeasible and we simply have that
Case (b): and : Let be the two vertices contained in . If and are both contained in , the edges and can be marked or not. Let which is the possible parameter combination set for the case that and are contained in . Now we consider all possible cases for .
(i) If , we have that
(ii) If and oder and the consistent cut corresponding to is infeasible and we simply have that
(iii) If we have that
(iv) If and oder and , we only consider the latter case without loss of generality. We have that
(v) If and oder and , we only consider the latter case without loss of generality. We have that
(vi) If we have that
Case 2: for some . It is not hard to see that the following equation holds.
For each bag , there are at most different partitions, where . The values are bounded by a polynomial of the graph size. For and each partition of , it takes constant time to compute by using the above recurrence relations. Therefore, our dynamic programming algorithm runs in time, where is bounded by a polynomial of the graph size. This lemma holds.
Now we are ready to prove the main theorem in this section.
Theorem 4.10.
Given a path decomposition of with width . Co-Path Packing can be solved in time and space with failure probability .
Proof 4.11.
Let be the set of where is a feasible marked-cc-solution. Let contain and . Then denotes all pairs of a vertex subset and an edge subset, which are potential marked-cc-solutions. Let . Each vertex and edge is assigned a weight in uniformly at random by and the probability of finding an isolating is 2/3 by Lemma 4.4. Based on such , we have that there exists a weight such that there is exactly one marked-cc-solution with weight (if ). It is easy to see that there exists a cPP-set with size at most if and only if there exists a marked-cc-solution with and any possible and . Thus, for any possible and , by Lemma 4.6, we call the algorithm given in Lemma 4.8, then check the parity of the number of cc-candidates of with any possible degree-0 vertices, vertices, edges, markers and weight to determine the existence of the number of marked-cc-solution with and weight . Thus, this lemma holds.
4.2 The Whole Algorithm
In this section, we propose a parameterized algorithm for Co-Path Packing. First, in Section 4.2.1, we show that Co-Path Packing on a proper graph class can be quickly solved by using the dynamic programming algorithm based on path decompositions in Theorem 4.10. Similarly, we will use Lemma 3.3 to conclude this result. Second, in Section 4.2.2, we give a branch-and-search algorithm that will implement some branching steps on special local graph structures. Our branching algorithm for Co-Path Packing is similar to the branching algorithm for Co-Path/Cycle Packing. Specifically, our branching algorithm for Co-Path Packing contains two reduction rules, two branching rules, and four steps, while the first reduction rule, both two branching rules, the first two steps and the last step are the same as the branching algorithm for Co-Path/Cycle Packing. When all the steps cannot be applied, we show that the graph must be a proper graph and then the algorithm in Section 4.1 can be called directly to solve the problems.
4.2.1 Proper Graphs with Small Pathwidth
Recall that a graph is called proper if it satisfies the following conditions:
-
1.
The maximum degree of is at most 4.
-
2.
For any degree-4 vertex , all neighbors are of degree at most 2.
-
3.
For any degree-2 vertex , at least one vertex in is of degree at least 3.
-
4.
Each connected component contains at least 6 vertices.
Combine Lemma 3.3 for Co-Path Packing with Lemma 4.10, we have the following lemma.
Lemma 4.12.
Co-Path Packing on proper graphs can be solved in time with probability at least 2/3.
Proof 4.13.
We first call the algorithm in Lemma 3.3. If the algorithm decides that has no -set of size at most , we claim that is a no-instance. Otherwise, we can obtain a nice path decomposition of width at most . Then, we call the algorithm in Theorem 4.10. This algorithm runs in with failure probability , where we choose . This lemma holds.
4.2.2 A Branch-and-Search Algorithm
In this subsection, we provide a branch-and-search algorithm for Co-Path Packing, which is denoted by . Our algorithm contains several reduction and branching steps. After recursively executing these steps, we will get a proper graph and then call the dynamic programming algorithm in Lemma 4.12 to solve it.
4.2.2.1. Reduction and Branching Rules.
Firstly, we present two reduction rules. The first reduction rule is Reduction Rule 1 for Co-Path/Cycle Packing and Reduction Rule *2 is a new reduction rule for Co-Path Packing.
Reduction-Rule 1. If there is a connected component of the graph such that , then run a brute force algorithm to find a minimum cPP-set in , delete and include in the deletion set.
A path is called a degree-two-path if the two vertices and are of degree not 2 and the other vertices are of degree 2, where we allow .
Lemma 4.14.
For a degree-two-path with in , let , we have that is a yes-instance if and only if is a yes-instance.
Proof 4.15.
If one of is a degree-1 vertex, without loss of generality, we say is a degree-1 vertex. In this case, it is easy to see that vertices are not contained in any minimum solution, and this lemma holds.
If is of degree at least 3, let be a minimum cPP-set for . We consider the following cases.
(i) : In this case, since is a minimum cPP-set. Vertex set is also a minimum cPP-set for .
(ii) : If , it is easy to check that is a feasible cPP-set with size . Vertex set is a minimum cPP-set for . If , clearly is also a minimum cPP-set for .
Let be a minimum cPP-set for . By the similar argument, there exists a minimum cPP-set with size for .
Based on this lemma, we have the following reduction rule for Co-Path Packing.
Reduction-Rule *2. If there is a degree-two-path with , then return .
If Reduction Rules 1 and *2 cannot be applied, we have a property that for any degree-2 vertex , at least one vertex in is of degree at least 3.
After applying the three simple reduction rules, we will execute some branching steps. For Co-Path Packing, we have two branching rules, which are the same as the two branching rules for Co-Path/Cycle Packing. The correctnesses of these two branching rules for Co-Path Packing are similar to the two branching rules for Co-Path/Cycle Packing.
Branching-Rule (B1). For a vertex of degree at least 3, branch on it to generate branches by either (i) deleting from the graph and including it in the deletion set, or (ii) for every pair of vertices and in , deleting from the graph and including in the deletion set.
Branching-Rule (B2). Assume that a vertex of degree at least 3 dominates a vertex u. Branch on to generate branches by either (i) deleting from the graph and including it in the deletion set, or (ii) for each vertex , deleting from the graph and including in the deletion set.
4.2.2.2. Steps.
When we execute one step, we assume that all previous steps are not applicable in the current graph anymore. In this subsection, we present four steps: Step 1, Step 2, Step *3 and Step *4 for Co-Path Packing. Steps 1 and 2 are the Steps 1 and 2 for Co-Path/Cycle Packing. Step *3 is a new step designed for Co-Path Packing. Step *4 is the Step 5 for Co-Path/Cycle Packing.
Step 1 (Vertices of degree at least 5). If there is a vertex of , then branch on with Branching-Rule (B1) to generate branches.
Step 2 (Degree-4 vertices dominating some vertex of degree at least 3). Assume that there is a degree-4 vertex that dominates a vertex , where . Without loss of generality, we assume that the other three neighbors of are and , and is adjacent to and ( is further adjacent to if ). We branch on with Branching-Rule (B2) and get branches.
Step *3 (Degree-4 vertices in a triangle). Assume that a degree-4 vertex is in a triangle. Let , , and be the four neighbors of , where we assume without loss of generality that is a triangle. We branch on with Branching-Rule (B1). In the branch of deleting , we can simply assume that the three vertices and are not deleted, otherwise this branch can be covered by another branch and then it can be ignored. Since , and form a triangle, we know this case is impossible, so we can ignore this subbranch. We generate the following branches
The corresponding recurrence is
The branching factor of it is 2.7913.
After Step *3, no degree-4 vertex is in a triangle.
Step *4 (Degree-4 vertices adjacent to some vertex of degree at least 3). Assume there is a degree-4 vertex adjacent to at least one vertex of degree at least 3. Let , , and be the four neighbors of , where we assume without loss of generality that . First, we branch on by either (b1) including it in the solution set or (b2) excluding it from the solution set. Next, we focus on the latter case (b2). In (b2), we further branch on by (b2.1) either including it in the solution set or (b2.2) excluding it from the solution set. For case (b2.1), there are at least vertices in that should be deleted by the same argument for Branching-Rule (B1). Thus, we can generate three subbranches by deleting , , and , respectively. For case (b2.2), there are still at least vertices in that should be deleted, which can be one of the following three sets , , and . Furthermore, there are also at least vertices in that should be deleted. Note that is not allowed to be deleted now. Thus, at least vertices in should be deleted. We will generate branches by decreasing by . Since after Step *3, the degree-4 vertex is not in any triangle, we know that is disjoint with . For case (b2.2), we will generate subbranches by decreasing by at least in each, where or 4.
The worst branching factors in the above steps are listed in Table 3. After Step *4, any degree-4 vertex can be only adjacent to vertices of degree at most 2. It is easy to see that the remaining graph after Step *4 is a proper graph. We call the algorithm in Lemma 4.12 to solve the instance for Co-Path Packing in time with probability at least 2/3.
Steps | Step 1 | Step 2 | Step *3 | Step *4 |
---|---|---|---|---|
Branching factors | 2.5445 | 2.3028 | 2.7913 | 2.8192 |
Theorem 4.16.
Co-Path Packing can be solved in time with probability at least 2/3.
5 Conclusion
In this paper, we show that given a path decomposition of width , Co-Path Packing can be solved by a randomized fpt algorithm running in time. Additionally, by combining this algorithm with a branch-and-search algorithm, we show that Co-Path/Cycle Packing can be solved in time and Co-Path Packing can be solved in time with probability at least 2/3. For Co-Path/Cycle Packing, the new bottleneck in our algorithm is Step 5, which is to deal with degree-4 vertices not in any triangle. For Co-Path Packing, the new bottleneck in our algorithm is the dynamic programming phase. The idea of using path/tree decomposition to avoid bottlenecks in branch-and-search algorithms may have the potential to be applied to more problems. It would also be interesting to design a deterministic algorithm for Co-Path Packing faster than .
References
- [1] Radovan Δervenα»³ and OndΕej Suchα»³. Generating faster algorithms for d-path vertex cover. In International Workshop on Graph-Theoretic Concepts in Computer Science, pages 157β171. Springer, 2023.
- [2] Maw-Shang Chang, Li-Hsuan Chen, Ling-Ju Hung, Peter Rossmanith, and Ping-Chen Su. Fixed-parameter algorithms for vertex cover p3. Discrete Optimization, 19:12β22, 2016.
- [3] Jianer Chen, IyadΒ A Kanj, and GeΒ Xia. Improved upper bounds for vertex cover. Theoretical Computer Science, 411(40-42):3736β3756, 2010.
- [4] Zhi-Zhong Chen, Michael Fellows, Bin Fu, Haitao Jiang, Yang Liu, Lusheng Wang, and Binhai Zhu. A linear kernel for co-path/cycle packing. In Algorithmic Aspects in Information and Management: 6th International Conference, AAIM 2010, Weihai, China, July 19-21, 2010. Proceedings 6, pages 90β102. Springer, 2010.
- [5] Marek Cygan, FedorΒ V Fomin, Εukasz Kowalik, Daniel Lokshtanov, DΓ‘niel Marx, Marcin Pilipczuk, MichaΕ Pilipczuk, and Saket Saurabh. Parameterized algorithms, volumeΒ 5. Springer, 2015.
- [6] Marek Cygan, Jesper Nederlof, Marcin Pilipczuk, Michal Pilipczuk, JohamΒ MM van Rooij, and JakubΒ Onufry Wojtaszczyk. Solving connectivity problems parameterized by treewidth in single exponential time. In 2011 IEEE 52nd Annual Symposium on Foundations of Computer Science, pages 150β159. IEEE, 2011.
- [7] MichaelΒ R Fellows, Jiong Guo, Hannes Moser, and Rolf Niedermeier. A generalization of nemhauser and trotterβs local optimization theorem. Journal of Computer and System Sciences, 77(6):1141β1158, 2011.
- [8] Qilong Feng, Jianxin Wang, Shaohua Li, and Jianer Chen. Randomized parameterized algorithms for -packing and co-path packing problems. Journal of Combinatorial Optimization, 29:125β140, 2015.
- [9] FedorΒ V Fomin, Serge Gaspers, Daniel Lokshtanov, and Saket Saurabh. Exact algorithms via monotone local search. Journal of the ACM (JACM), 66(2):1β23, 2019.
- [10] FedorΒ V Fomin, Serge Gaspers, Saket Saurabh, and AlexeyΒ A Stepanov. On two techniques of combining branching and treewidth. Algorithmica, 54:181β207, 2009.
- [11] DavidΒ G Harris and NSΒ Narayanaswamy. A faster algorithm for vertex cover parameterized by solution size. arXiv preprint arXiv:2205.08022, 2022.
- [12] JΓ‘n KatreniΔ. A faster fpt algorithm for 3-path vertex cover. Information Processing Letters, 116(4):273β278, 2016.
- [13] Dieter Kratsch and FVΒ Fomin. Exact exponential algorithms. Springer, 2010.
- [14] Michael Lampis and Manolis Vasilakis. Structural parameterizations for two bounded degree problems revisited. ACM Transactions on Computation Theory, 2023.
- [15] Ketan Mulmuley, UmeshΒ V Vazirani, and VijayΒ V Vazirani. Matching is as easy as matrix inversion. In Proceedings of the nineteenth annual ACM symposium on Theory of computing, pages 345β354, 1987.
- [16] StephenΒ B Seidman and BrianΒ L Foster. A graph-theoretic generalization of the clique concept. Journal of Mathematical sociology, 6(1):139β154, 1978.
- [17] BlairΒ D Sullivan and Andrew vanΒ der Poel. A fast parameterized algorithm for co-path set. arXiv preprint arXiv:1603.04376, 2016.
- [18] Dekel Tsur. Parameterized algorithm for 3-path vertex cover. Theoretical Computer Science, 783:1β8, 2019.
- [19] Dekel Tsur. Faster deterministic algorithms for co-path packing and co-path/cycle packing. Journal of Combinatorial Optimization, 44(5):3701β3710, 2022.
- [20] Jianhua Tu. A fixed-parameter algorithm for the vertex cover p3 problem. Information Processing Letters, 115(2):96β99, 2015.
- [21] JohanΒ MM van Rooij. A generic convolution algorithm for join operations on tree decompositions. In Computer ScienceβTheory and Applications: 16th International Computer Science Symposium in Russia, CSR 2021, Sochi, Russia, June 28βJuly 2, 2021, Proceedings 16, pages 435β459. Springer, 2021.
- [22] Mingyu Xiao. A parameterized algorithm for bounded-degree vertex deletion. In International Computing and Combinatorics Conference, pages 79β91. Springer, 2016.
- [23] Mingyu Xiao. On a generalization of nemhauser and trotterβs local optimization theorem. Journal of Computer and System Sciences, 84:97β106, 2017.
- [24] Mingyu Xiao and Shaowei Kou. Kernelization and parameterized algorithms for 3-path vertex cover. In International Conference on Theory and Applications of Models of Computation, pages 654β668. Springer, 2017.
Appendix
Appendix A Proofs
Theorem 3.5 Given a path decomposition of with width . For any , -Bounded-Degree Vertex Deletion can be solved in time and space.
Proof A.1.
We can simply assume that the path decomposition is a nice path decomposition by Lemma 2.2.
Let for each . We have . For any , let be an arbitrary partition of . We consider the following subproblem: to find a minimum-size vertex set in the induced graph such that , the maximum degree of graph is at most , and each vertex in is a degree- vertex in . We also let denote the corresponding size of the solution to this problem. For some partitions of , there may not exist any feasible solution , and we will let for this case. To solve -Bounded-Degree Vertex Deletion, we only need to check the minimum value among for all possible partitions of . Next, we use a dynamic programming method to compute all .
For the case that , and it trivially holds that . Since the path decomposition is nice, there are two cases for each .
Case 1: for some . By the definition of path decomposition, we know that all neighbors of in the graph must be in . For every partition of , the following holds.
-
1.
. It holds .
-
2.
for some . We further consider two subcases.
Case (a): oder . For this case, the partition is infeasible and we can simply let , .
Case (b): and . Let ), and for . Let . We have that
where for .
Case 2: for some . It is not hard to see that the following equation holds.
For each bag , there are at most different partitions, where . For and each partition of , it takes at most time to compute by using the above recurrence relations. Therefore, our dynamic programming algorithm runs in time, where is bounded by a polynomial of the graph size. This theorem holds.