# Faster FPT Algorithm for 5-Path Vertex Cover

The problem of d-Path Vertex Cover, d-PVC lies in determining a subset F of vertices of a given graph G=(V,E) such that G ∖ F does not contain a path on d vertices. The paths we aim to cover need not to be induced. It is known that the d-PVC problem is NP-complete for any d > 2. When parameterized by the size of the solution k, 5-PVC has direct trivial algorithm with O(5^kn^O(1)) running time and, since d-PVC is a special case of d-Hitting Set, an algorithm running in O(4.0755^kn^O(1)) time is known. In this paper we present an iterative compression algorithm that solves the 5-PVC problem in O(4^kn^O(1)) time.

## Authors

• 3 publications
• 11 publications
09/07/2018

### Parameterized algorithm for 3-path vertex cover

In the 3-path vertex cover problem, the input is an undirected graph G a...
07/26/2021

### On Kernels for d-Path Vertex Cover

In this paper we study the kernelization of d-Path Vertex Cover (d-PVC) ...
07/12/2021

### Sparsifying, Shrinking and Splicing for Minimum Path Cover in Parameterized Linear Time

A minimum path cover (MPC) of a directed acyclic graph (DAG) G = (V,E) i...
07/30/2018

### Vertex Covers Revisited: Indirect Certificates and FPT Algorithms

The classical NP-complete problem Vertex Cover requires us to determine ...
12/29/2017

### Interesting Paths in the Mapper

The Mapper produces a compact summary of high dimensional data as a simp...
11/10/2021

### Generating faster algorithms for d-Path Vertex Cover

For a constant d, the d-Path Vertex Cover problem (d-PVC) is as follows:...
10/01/2017

### Orthogonal Terrain Guarding is NP-complete

A terrain is an x-monotone polygonal curve, i.e., successive vertices ha...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

The problem of -Path Vertex Cover, -PVC lies in determining a subset  of vertices of a given graph such that does not contain a path on  vertices (even not a non-induced one). The problem was first introduced by Brešar et al. [1], but its NP-completeness for any follows already from the meta-theorem of Lewis and Yannakakis [11]. The 2-PVC problem corresponds to the well known Vertex Cover problem and the 3-PVC problem is also known as Maximum Dissociation Set. The -PVC problem is motivated by the field of designing secure wireless communication protocols [12] or in route planning and speeding up shortest path queries [9].

Since the problem is NP-hard, any algorithm solving the problem exactly is expected to have exponential running time. If one measures the running time solely in terms of the input size, then several efficient (faster than trivial enumeration) exact algorithms are known for 2-PVC and 3-PVC. In particular, 2-PVC (Vertex Cover) can be solved in time and polynomial space due to Xiao and Nagamochi [20] and 3-PVC can be solved in time and polynomial space due to Xiao and Kou [18].

In this paper we aim on the parameterized analysis of the problem, that is, to confine the exponential part of the running time to a specific parameter of the input, presumably much smaller than the input size. Algorithms achieving running time are called parameterized, fixed-parameter tractable, or FPT. See Cygan et al. [3] for a broader introduction to parameterized algorithms.

When parameterized by the size of the solution , the -PVC problem is directly solvable by a trivial FPT algorithm that runs in time.111The notation suppresses all factors polynomial in the input size. However, since -PVC is a special case of -Hitting Set, it was shown by Fomin et al. [6] that for any we have an algorithm solving -PVC in . In order to find more efficient solutions, the problem has been extensively studied in a setting where  is a small constant. For the 2-PVC (Vertex Cover) problem, the algorithm of Chen, Kanj, and Xia [2] has the currently best known running time of . For 3-PVC, Tu [16] used iterative compression to achieve a running time . This was later improved by Katrenič [10] to , by Xiao and Kou [19] to by using a branch-and-reduce approach and it was further improved by Tsur [15] to . For the 4-PVC problem, Tu and Jin [17] again used iterative compression and achieved a running time and Tsur [14] claims to have an algorithm with running time .

We present an algorithm that solves the 5-PVC problem parameterized by the size of the solution  in time by employing the iterative compression technique. Using the result of Fomin et al. [7] this also yields time algorithm improving upon previously known time algorithm.

#### Organization of this paper.

We introduce the notation and define the 5-PVC problem in Section 2. Our disjoint compression routine for iterative compression is exposed in Section 3. We conclude this paper with a few open questions.

## 2 Preliminaries

We use the notation as described by Fomin and Kratsch [8], which is a modification of the big- notation suppressing all polynomially bounded factors. We use the notation of parameterized complexity as described by Cygan et al. [3]. We use standard graph notation and consider simple and undirected graphs unless otherwise stated. Vertices of graph  are denoted by , edges by . By we denote the subgraph of  induced by vertices of . By we denote the set of neighbors of in . Analogically, denotes the set of neighbors of vertices in . The degree of vertex  is denoted by . For simplicity, we write for and for as shorthands for and , respectively.

k-path, denoted as an ordered -tuple , is a path on  vertices . A path starts at vertex  when . A -cycle is a cycle on  vertices. A triangle is a 3-cycle. A -free graph is a graph that does not contain a  as a subgraph (the need not to be induced). The 5-Path Vertex Cover problem is formally defined as follows:

 5-Path Vertex Cover, 5-PVC Input: A graph G=(V,E), an integer k∈Z+0. Output: A set F⊆V, such that |F|≤k and G∖F is a P5-free graph.

star is a graph  with vertices , and edges . Vertex  is called a center, vertices are called leaves.

star with a triangle is a graph with vertices , and edges . Vertex  is called a center, vertices are called triangle vertices and vertices are called leaves.

di-star is a graph  with vertices , and edges . Vertices are called centers, vertices and are called leaves.

If a connected graph is -free and has more than 5 vertices, then it is a star, a star with a triangle, or a di-star.

###### Proof.

Suppose we have a -free graph  on at least 5 vertices. Firstly,  does not contain a -cycle, as a subgraph, since is a subgraph of such a -cycle. Secondly,  does not contain a 4-cycle as a subgraph, since  has at least 5 vertices and it is connected which implies that there is at least one vertex connected to the 4-cycle which in turn implies a  in . Finally,  does not contain two edge-disjoint triangles as a subgraph, since  is connected, the two triangles are either sharing a vertex or are connected by some path, which in both cases implies a  in . Consequently,  contains either exactly one triangle or is acyclic.

Consider the first case where  contains exactly one triangle. Label the vertices of the triangle with . Then we claim that all vertices outside the triangle are connected by an edge to exactly one vertex of that triangle, let that vertex be . Indeed, for contradiction suppose they are not. Since we have at least 5 vertices in , label the two existing vertices outside the triangle  and . Then we either have  and  connecting to two different vertices of the triangle, let them be , which immediately implies a  in , or we have a  connected to the triangle, which again implies a . Hence, if  contains a triangle, then it is a star with a triangle.

Consider the second case where  is acyclic. Then we claim that there is a dominating edge in , i.e. an edge such that . Indeed, for contradiction suppose that there is no such edge. Then we have that for each edge in  there must be a vertex  that is adjacent neither to , nor to . Assume that  is connected to  through some vertex . The same also holds for the edge , so assume that there is a vertex that is connected to  through some vertex . But then we have a  in .

Label the dominating edge . Here, if only one of the vertices has degree greater than one, we have a star, otherwise we have a di-star. ∎

## 3 5-PVC with P5-free bipartition

We employ the generic iterative compression framework as described by Cygan et al. [3, pages 80–81]. We skip the generic steps and only present the disjoint compression routine (see also Subsection 3.11 for a brief discussion of the whole iterative compression algorithm). That is, we assume that we are given a solution to the problem and search for another solution which is strictly smaller than and disjoint from the given one. Moreover, if the graph induced by the given solution contains a , then we can directly answer no. Hence our routine disjoint_r restricts itself to a problem called 5-PVC with -free Bipartition and we need it to run in time.

-free bipartition of graph is a pair such that , and are -free. The 5-PVC with -free Bipartition problem is formally defined as follows:

 5-PVC with P5-free Bipartition, 5-PVCwB Input: A graph G=(V,E) with P5-free bipartition (V1,V2), an integer k∈Z+0. Output: A set F⊆V2, such that |F|≤k and G∖F is a P5-free graph.

Throughout this paper the vertices from will be also referred to as “red” vertices and vertices from will be also refereed to as “blue” vertices. The same colors will also be used in figures with the same meaning.

### 3.1 Algorithm

Our algorithm is a recursive procedure , where  is the input graph, are the partitions of the -free bipartition of  is the solution being constructed, and  is the maximum number of vertices we can still add to . The procedure repeatedly tries to apply a series of rules with a condition that a rule can be applied only if all rules that come before cannot be applied. It is paramount that in every call of disjoint_r at least one rule can be applied. The main work is done in rules of two types: reduction rules and branching rules. To make it easier for the reader we also use rules called context rules, which only describe the configuration we are currently in and serve as some sort of a parent rules for their subrules.

reduction rule is used to simplify a problem instance, i.e. remove some vertices or edges from  and possibly add some vertices to a solution, or to halt the algorithm. A branching rule splits the problem instance into at least two subinstances. The branching is based on subsets of vertices that we try to add to a solution and by adding them to the solution we also remove them from .

The notation we use to denote the individual branches of a branching rule is as follows: . Such a rule has  branches and are subsets of which we try to add to the solution. This rule is translated into the following  calls of the procedure:

 \textscdisjoint_r(G∖Xi,V1,V2∖Xi,F∪Xi,k−|Xi|) for i∈{1,…,l}

A rule is applicable if the conditions of the rule are satisfied and none of the previous rules is applicable. If a context rule is not applicable, it means that none of its subrules is applicable.

A reduction rule is correct if it satisfies that the problem instance has a solution if and only if the simplified problem instance has a solution. A branching rule is correct if it satisfies that if the problem instance has a solution, then at least one of the branches of the rule will return a solution.

When we say we delete a vertex, we mean that we remove it from  and also add it to the solution . When we say we remove a vertex, we mean that we remove it from  and do not add it to the solution .

For the rest of this paper assume that the parameters of the current call of disjoint_r are .

### 3.2 Preprocessing

###### Reduction rule (R0).

This rule stops the recursion of disjoint_r. It has three stopping conditions:

1. If , return no solution;

2. else if  is -free, return ;

3. else if , return no solution.

###### Reduction rule (R1).

Let be a vertex such that there is no in  that uses . Then remove  from .

Proof of correctness. Let be a vertex that is not used by any in  and let  be a solution to the 5-PVCwB instance . Then  is also a solution to since is not used by any in .

If does not have a solution, then we claim that also does not have a solution. Indeed, adding vertices can only create new paths.

###### Branching rule (R2).

Let  be a  in  with such that . Then branch on , i.e. branch on the blue vertices of .

Proof of correctness. We have to delete at least one blue vertex in , thus branching on the blue vertices of  is correct.

Assume that Rules (R0)(R2) are not applicable. Then for each vertex there exists a in that uses ; every in  uses exactly one red vertex; and there are only isolated vertices in .

###### Proof.

If (R1) is not applicable, then for each vertex there exists a in that uses . If (R2) is not applicable, then every in  uses at most one red vertex and since is a -free bipartition we cannot have a  in  that uses no red vertex.

To prove that there are only isolated vertices in , assume for contradiction that there is an edge in . Since (R1) and (R2) are not applicable, there must be a path in that uses and not uses and in that uses and not uses . Paths and are not necessarily disjoint.

Now consider the following cases for nad . If , then there is a path contradicting (R2) not being applicable. Similarly, if , then there is a path contradicting (R2) not being applicable. The same arguments apply for the cases where and respectively and the same logic applies also when considering and .

Thus we have that and . Now it suffices to see that either or . In the first case we get a path and in the second case we get a path . In both cases we get a contradiction with (R2) not being applicable. ∎

### 3.3 Dealing with isolated vertices in G[v2]

Assume that Rules (R0)(R2) are not applicable. Let  be an isolated vertex in and let  be a solution to 5-PVCwB which uses vertex . Then there exists a solution that does not use vertex  and .

###### Proof.

From Lemma 3.2 we get that each in  which contains  must also start in , otherwise it would imply a  that uses more than one red vertex. Suppose that there exists a path where  is a red vertex and (see Figure 1). If there is no such , then we have that each starting in  has at least one of the vertices in  or there is no starting in . In both cases we can put and the lemma holds.

There cannot exist another path such that and , otherwise we would have a  in  that is not hit by . Consequently, each that is hit only by vertex  also contains vertex , which implies that is a solution and , thus the lemma holds. ∎

###### Branching rule (R3).

Let  be an isolated vertex in and let be a  where  is a red vertex. Then branch on .

Proof of correctness. From Lemma 3.3 we know that if there exists a solution, then there exists a solution that does not contain . Therefore branching on is correct.

Assume that Rules (R0)(R3) are not applicable. Then there are no isolated vertices in .

###### Proof.

For contradiction assume that Rules (R0)(R3) are not applicable and there is an isolated vertex  in . If there is no that uses , then (R1) is applicable on . So suppose that there is a  path  that uses . If there are at least two red vertices connected to , then there also exists a  path that uses  and at least two red vertices and (R2) is applicable. So suppose that there is only one red vertex  connected to . Then (R3) is applicable. ∎

### 3.4 Dealing with isolated edges in G[v2]

Assume that Rules (R0)(R3) are not applicable. Let  be a blue vertex to which at least two red vertices are connected and let be a connected component of which contains . Then for each red vertex  connected to  we have that .

###### Proof.

Let be red vertices connected to . For contradiction assume that is connected to some vertex in such that . From Lemma 3.3 we know that has degree at least one in . Label some neighbor of in as . We obtained a  which contradicts Lemma 3.2. ∎

Assume that Rules (R0)(R3) are not applicable. Let be a blue edge to which at least two red vertices are connected in a way that to both  and  there is at least one red vertex connected. Let be a connected component of which contains . Then for each red vertex  connected to  we have that .

###### Proof.

Let be red vertices connected to  and assume that is connected to  and is connected to . For contradiction assume that is connected to some vertex in such that . We obtain a  which contradicts Lemma 3.2. ∎

Let  be a subset of such that and . If there exists a solution  such that , then there exists a solution such that and .

###### Proof.

Assume that . Then each that uses some vertex in  must also use vertex , otherwise it would be contained in  which contradicts being -free. Consequently, any that is hit by a vertex from  in the solution  can be also hit by vertex  and thus is also a solution and . ∎

We say that two nodes are twins if .

Let be blue vertices that are twins. Let  be a solution and . Then at least one of the following holds:

1. ,

2. is a solution.

###### Proof.

Assume that and . Since are twins, for each path with and , there also exists a path such that for and . Firstly, if there is no containing , then trivially (2) holds. Secondly, if all paths that contain  are hit by some other vertex , then again (2) holds. So suppose that there exists a  path  that is hit only by . If , then we know that there is a path as described above and we get a contradiction with  being a solution since is not hit by  and (1) must hold. Otherwise, all paths that contain  also contain  and (2) holds. ∎

###### Branching rule (R4).

Let be an isolated edge in . We know from Lemmata 3.4 and 3.4 that there is only one red vertex  connected to , because if there were at least two red vertices connected to , then there would be no that uses vertices from . Let there be a red vertex  connected to at least one vertex in . If  is connected only to one vertex in , let that vertex be . Assume that  is some vertex to which  connects outside  and let  be a neighbor of  in . Then branch on .

Proof of correctness. Firstly, assume that  is connected only to one vertex of . Then from Lemma 3.4 we know that we do not have to try vertex . Secondly, assume that  is connected to both vertices of . Since are twins, from Lemma 3.4 it follows that we can try deleting only one of them. Thus branching on is correct.

Assume that Rules (R0)(R4) are not applicable. Then there are no isolated edges in .

###### Proof.

For contradiction assume that Rules (R0)(R4) are not applicable and there is an isolated edge in . If there is no that uses vertices from , then (R1) is applicable on . If there are at least two red vertices connected to , then from Lemmata 3.4 and 3.4 we know that those red vertices are not connected to any other vertices outside  and there again cannot be a  that uses vertices from  and (R1) is applicable on .

So suppose that there is a  that uses vertices from  and there is only one red vertex  connected to . But then (R4) is applicable in both cases where  is connected to both vertices in  or to exactly one vertex in . ∎

### 3.5 Dealing with isolated P3 paths in G[v2]

###### Context rule (R5).

Let  be a  that forms a connected component in . From Lemmata 3.2, 3.4 and 3.4 we know that there is only one red vertex  connected to . We further know that  must be connected to some component of other than , otherwise no could be formed. Assume that  is some vertex to which  connects outside  and let  be a neighbor of  in . This rule is split into four subrules (R5.1), (R5.2), (R5.3) and (R5.4) based on how  is connected to .

###### Branching rule (R5.1).

Vertex  is connected only to  in  (see (a)). Then branch on .

Proof of correctness. If we do not delete vertex , then we have to delete something in . From Lemma 3.4 we know that we do not have to try vertices . Thus branching on is correct.

###### Branching rule (R5.2).

Vertex  is connected only to in  (see (b)). Then branch on .

Proof of correctness. If we do not delete vertex , then we have to delete something in . From Lemma 3.4 we know that we do not have to try vertex . Thus branching on is correct.

###### Branching rule (R5.3).

Vertex  is connected only to  in  (see (c)). Then branch on .

Proof of correctness. If none of the vertices is deleted, then we have to delete something in . From Lemma 3.4 we know that we do not have to try vertices . Thus branching on is correct.

###### Branching rule (R5.4).

Vertex  is connected to in  and  can be also connected to  in  (see (d)). Then branch on .

Proof of correctness. If we do not delete vertex , then we have to delete something in . In both cases, when  is connected to  and when not, are twins and from Lemma 3.4 we know that we have to try only one of . Thus branching on is correct.

Assume that Rules (R0)(R5) are not applicable. Then there are no isolated paths in .

###### Proof.

For contradiction assume that Rules (R0)(R5) are not applicable and there is an isolated path in . If there is no that uses vertices from , then (R1) is applicable on . Suppose there are at least two red vertices connected to . If they are connected to vertices , then (R2) is applicable, since there is a  that uses at least two red vertices. So suppose the red vertices are connected to a single vertex or a single edge in . Then from Lemmata 3.4 and 3.4 we know that those red vertices are not connected to any other vertices outside . Consequently, there cannot be a  that uses vertices from  and again (R1) is applicable on .

So suppose that there is a  that uses vertices from  and there is only one red vertex  connected to . There are seven possibilities how  can be connected to  from which only five are not mutually isomorphic. Table 1 summarizes which rule should be applied in each situation (for clarity the isomorphic cases are omitted). ∎

### 3.6 Dealing with isolated triangles in G[v2]

###### Context rule (R6).

Let  be a  that forms a connected component in . From Lemmata 3.2 and 3.4 we know that there is only one red vertex  connected to . We further know that  must be connected to some component of other than , otherwise no could be formed. Assume that  is some vertex to which  connects outside  and let  be a neighbor of  in . This rule is split into three subrules (R6.1), (R6.2) and (R6.3) based on how  is connected to .

###### Branching rule (R6.1).

Vertex  is connected only to one vertex in , let that vertex be  (see (a)). Then branch on .

Proof of correctness. If we do not delete vertex , then we have to delete something in . From Lemma 3.4 we know that we do not have to try vertices . Thus branching on is correct.

###### Branching rule (R6.2).

Vertex  is connected to exactly two vertices in , let those vertices be (see (b)). Then branch on .

Proof of correctness. As in (R6.1), if we do not delete vertex , then we have to delete something in . Since are twins, from Lemma 3.4 we know that we have to try only one of . Thus branching on is correct.

###### Branching rule (R6.3).

Vertex  is connected to all vertices in  (see (c)). Then branch on .

Proof of correctness. As in (R6.1), if we do not delete vertex , then we have to delete something in . Since vertices in  are pairwise twins, from Lemma 3.4 we know that we have to try only one of . Thus branching on is correct.

Assume that Rules (R0)(R6) are not applicable. Then there are no isolated triangles in .

###### Proof.

For contradiction assume that Rules (R0)(R6) are not applicable and there is an isolated triangle in . If there is no that uses vertices from , then (R1) is applicable on . Suppose there are at least two red vertices connected to . If the red vertices are not connected to a single vertex in , then (R2) is applicable, since there is a  that uses at least two red vertices. So suppose the red vertices are connected to a single vertex in . Then from Lemma 3.4 we know that those red vertices are not connected to any other vertices outside . Consequently, there cannot be a  that uses vertices from  and again (R1) is applicable on .

So suppose that there is a  that uses vertices from  and there is only one red vertex  connected to . There are seven possibilities how  can be connected to  from which only three are not mutually isomorphic. Table 2 summarizes which rule should be applied in each situation (for clarity the isomorphic cases are omitted). ∎

### 3.7 Dealing with 4-cycles in G[v2]

Let  be a connected component of and . Let  be a solution that deletes at least vertices in . Then is also a solution and .

###### Proof.

Each that uses some vertex in  must also use some vertex , otherwise it would be contained in  which contradicts being -free. Consequently, any that is hit by a vertex from  in the solution  can be also hit by some vertex and thus is also a solution and . ∎

###### Context rule (R7).

Let  be a connected component in such that is a subgraph of and a 4-cycle is a subgraph of , label the vertices of the 4-cycle . We will call pairs of vertices and diagonal, all other pairs will be called non-diagonal. Edges corresponding to diagonal (non-diagonal) pairs are called diagonal (non-diagonal) edges, respectively. This rule is split into two subrules (R7.1), (R7.2) based on the number of red vertices connected to .

###### Reduction rule (R7.1).

Assume that there are at least two red vertices connected to . Then delete any vertex in  and add it to the solution .

Proof of correctness. We have to delete something in . From Lemmata 3.2, 3.4 and 3.4 we know that if there are at least two red vertices connected to , then they must be connected either to a single vertex or a single edge in  and these vertices are not connected to any component in other than .

Firstly, consider the case (a) when the red vertices are connected to a single vertex (see (a)). Then after deleting any vertex in  and adding it to the solution , there is not enough vertices remaining in to form a and the rule is correct.

Secondly, consider the case (b) when the red vertices are connected to the vertices of a single edge, let them be (see (b)). Observe that there are no diagonal edges in , since they would allow a  that uses at least two red vertices, which would contradict Lemma 3.2. Also observe that the red vertices are connected to or by exactly one edge, i.e. there is not a red vertex among them connected to both and , otherwise we would contradict Lemma 3.2 again. Consequently, after deleting any vertex in  there is not enough vertices remaining in to form a and the rule is correct.

###### Context rule (R7.2).

Assume that there is only one red vertex  connected to  and . This rule is split into five subrules (R7.2a), (R7.2b), (R7.2c), (R7.2d) and (R7.2e) based on how  is connected to  and whether  is connected to other components.

###### Reduction rule (R7.2a).

Vertex  is connected only to one vertex in , let it be (see (a)). Then delete and add it to the solution .

Proof of correctness. We have to delete something in  and Lemma 3.7 implies that we have to try only , thus deleting and adding it to the solution  is correct.

###### Branching rule (R7.2b).

Set  contains at least one diagonal pair, let that pair be (see (b)). Then branch on .

Proof of correctness. We have to delete something in . Since are twins, from Lemma 3.4 we know that we have to try only one of . Thus branching on is correct.

(R7.2b) also covers configurations where , since the conditions of the rule would be satisfied in that case.

###### Branching rule (R7.2c).

Set  contains exactly one non-diagonal pair, let that pair be , and case (a) either both diagonal edges are in  (see (c)), or case (b) none of them is (see (d)). Then branch on

Proof of correctness. We have to delete something in . Vertices are twins and Lemma 3.4 applies. Thus branching on is correct.

###### Reduction rule (R7.2d).

Set  contains exactly one non-diagonal pair, let that pair be and exactly one diagonal edge is in , let that edge be . Furthermore,  is connected only to , i.e. (see (e)). Then delete any vertex in  and add it to the solution .

Proof of correctness. Since  is connected only to , after deleting some vertex in , there can be no formed in the component containing . Thus deleting any vertex in  and adding it to the solution  is correct.

###### Branching rule (R7.2e).

Set  contains exactly one non-diagonal pair, let that pair be and exactly one diagonal edge is in , let that edge be . Furthermore,  is connected to at least one more component of other than , label the vertex to which  connects outside  as  and let  be a neighbor of  in (see (f)). Then branch on .

Proof of correctness. If none of the vertices is deleted, then we have to delete at least two vertices in . From Lemma 3.7 we know that we only have to try deleting vertices . Thus branching on is correct.