1 Introduction
The study of the KnotFree Vertex Deletion problem emerges from its application in resolution of deadlocks, where a deadlock is detected in a distributed system and then a minimum cost deadlockbreaking set must be found and removed from the system. More precisely, distributed computations are usually represented by directed graphs called waitfor graphs. In a waitfor graph , the vertex set represents processes, and the set of directed arcs represents wait conditions [barbosa1998]. An arc exists in directed away from towards if is blocked waiting for a signal from . The graph changes dynamically according to a set of prescribed rules (the deadlock model), as the computation progresses. In essence, the deadlock model governs how processes should behave throughout computation, i.e., the deadlock model specifies rules for vertices that are not sinks (vertices with at least one outneighbor) in to become sinks [barbosa2002] (vertices without outneighbors). The two main classic deadlock models are the AND model, in which a process can only become a sink when it receives a signal from all the processes in , where stands for the set of outneighbors of (a conjunction of resources is needed); and the OR model, in which it suffices for a process to become a sink to receive a signal from at least one of the processes in (a disjunction of resources is sufficient). Distributed computations are dynamic, however deadlock is a stable property, in the sense that once it occurs in a consistent global state of a distributed computation, it still holds for all the subsequent states. Therefore, as is typical in deadlock studies, represents a static waitfor graph that corresponds to a snapshot of the distributed computation in the usual sense of a consistent global state [chandy1985]. Thus, the motivation of our work comes from deadlock resolution, where deadlocks are detected into a consistent global state , and must be solved through some external intervention such as aborting one or more processes to break the circular wait condition causing the deadlock.
Deadlock resolution problems differ according to the considered deadlock model, i.e., according to the graph structure that characterizes the deadlock situation. In the ANDmodel, the occurrence of deadlocks is characterized by the existence of cycles [barbosa2002, barbosaetal16]. Therefore, deadlock resolution by vertex deletion in the ANDmodel corresponds precisely to the wellknown Directed Feedback Vertex Set (DFVS) problem, proved to be NPhard in the seminal paper of Karp [karp1972], and proved to be FPT in [chen2008fixed]. On the other hand, the occurrence of deadlocks in waitfor graphs working according to the ORmodel are characterized by the existence of knots in [barbosaetal16, holt1972]. A knot in a directed graph is a strongly connected subgraph of with at least two vertices such that there is no arc of with and . Thus, deadlock resolution by vertex deletion in the ORmodel can be viewed as the following problem.
KnotFree Vertex Deletion (KFVD) Instance: A directed graph ; a positive integer . Question: Determine if has a set such that and is knotfree.
Notice that a digraph is knotfree if and only if for any vertex of , has a path to a sink.
In [carneiro2019deadlock], Carneiro, Souza, and Protti proved that KFVD is NPcomplete; and, in [cocoon2018], it was shown that KFVD is W[1]hard when parameterized by .
KFVD is closely related to DFVS not only because of their relation to deadlocks, but also some structural similarities between them: the goal of DFVS is to obtain a direct acyclic graph (DAG) via vertex deletion (in such graphs all maximal directed paths end at a sink); the goal of KFVD is to obtain a knotfree graph, and in such graphs for every vertex there exists at least one maximal path containing that ends at a sink. Finally, every directed feedback vertex set is a knotfree vertex deletion set; thus an optimum for DFVS provides an upper bound for KFVD. Although Directed Feedback Vertex Set is a wellknown problem, this is not the case of KnotFree Vertex Deletion, which we propose to analyze more deeply in this work.
Let be a solution for KFVD, and let be the set of sinks in . One can see that any has a path (that does not use any vertex in ) to a vertex in . Thus, KFVD can be seen as the problem of creating a set of sinks (doing at most vertex removals) such that every remaining vertex has a path (in ) to a vertex in . In this paper, we denote the set of deleted vertices by , and the set of sinks in by .
To get intuition on KFVD, note that the choice of the vertices to be removed must be carefully done, since the removal of a subset of vertices can turn some strongly connected components into new knots that will need to be broken by the removal of some internal vertices. Ideally, it is desirable to solve the current knots by removing as few vertices as possible for each knot, without creating new ones. Unfortunately, the generation of other knots can not always be avoided.
In [cocoon2017, carneiro2019deadlock], Carneiro, Souza, and Protti present a polynomialtime algorithm for KFVD in graphs with maximum degree three. They also show that the problem is NPcomplete even restricted to planar bipartite graphs with maximum degree four. Later, in [cocoon2018], a parameterized analysis of KFVD is presented, where it was shown that: KFVD is W[1]hard when parameterized by the size of the solution; and it can be solved in time, but assuming SETH it cannot be solved in time, where is the size of the largest strongly connected subgraph.
Since the introduction of directed treewidth, much effort has been devoted to identify algorithmically useful digraph width measures [Oliveira2016]. Useful width measures imply polynomial time tractability for many combinatorial problems on digraphs of constant width. Since KFVD is W[1]hard when parameterized by , in this paper we investigate the ecology of width measures in order to find useful parameters to solve KFVD in FPT time. First, taking as parameter, we show that KFVD remains W[1]hard even on instances with both longest directed path and Kwidth bounded by constants. From the same reduction, it follows that KFVD is paraNPhard even considering many width measures as parameters, such as directed treewidth and DAGwidth. Contrasting with the hardness of KFVD on several directed width measure parameterizations, we show that KFVD is FPT when parameterized by the cliquewidth of the underlying undirected graph; and it can be solved in time, but assuming ETH it cannot be solved in time, where is the treewidth of the underlying undirected graph. After that, we consider the most natural width parameter related to KFVD, the size of a minimum directed feedback vertex set (). Such a parameter is at the same time a measure of the distance from the input graph to a DAG as well as an upper bound for the size of a minimum knotfree vertex deletion set. We show that KFVD can be solved in FPT time either parameterized by and Kwidth, or and the length of a longest directed path. The complexity of KFVD parameterized only by remains open. Finally, we present a polynomial Turing kernel when we are given a special directed feedback vertex set whose removal gives a DAG having a directed Hamiltonian path.
In the rest of this section we give necessary definitions and concepts used in this work. In Section 2 we present some useful observations and preliminary results. In Section 3 we discuss digraph width measures and show the W[1]hardness. In Section 4 we discuss the consequences of treewidth parameterization. In Section 5 we explore the directed feedback vertex set number as a parameter. Finally, Section 6 considers the parameterization by distance to a DAG having a Hamiltonian path.
Additional notation. We use standard graphtheoretic and parameterized complexity notations and concepts, and any undefined notation can be found in [bondy1976, cygan2015parameterized]. We consider here directed graphs. Given a vertex and a subset of vertices , we say that there is a path from to iff there exists such that there is a (directed) path. For , let denote the set of descendants of in , i.e. nodes that are reachable from by a nonempty directed path. Given a set of vertices of , we define . Let denote the set of ancestors of in , i.e., nodes that reach through a nonempty directed path. We also define , and given a set of vertices of , we define . For a vertex of , the outneighborhood of is denoted by , and given a set of vertices , we define . We refer to a Strongly Connected Component as an SCC. A knot in a directed graph is an SCC of with at least two vertices such that there is no arc of with and . Finally, a sink (resp. a source) of is a vertex with outdegree (resp. indegree ). Given a subset of vertices , we denote and . Thus, denote the graph obtained by removing .
We denote by the size of a minimum directed feedback vertex set of . We generally use to denote a directed feedback vertex set and by the remaining subset, i.e., . The length of a longest directed path of is denoted by . The Kennywidth [ganian2014] or Kwidth of is denoted by and is the maximum number of distinct directed paths in over all pairs of distinct vertices , where two paths are distinct iff they do not use the exact same set of arcs. For any function (like , , ), will be denoted simply by when the considered graph can be deduced from the context. In what follows we denote by KFVD the KFVD problem parameterized by ( denotes the parameterization by the solution size).
2 Preliminaries
In this section we present some useful remarks and reduction rules. Remind that in the decision version of the problem we are given and a positive integer .
The first observation is immediate, as if we can make the graph acyclic, then it will be knotfree.
Observation 1.
If then is a yesinstance.
The two others observations are less obvious but rather natural.
Observation 2.
Let be a solution with set of sinks in , and . Let and be the set of sinks of . If there is a path from to in then is also a solution.
Proof.
Let . Let us prove that has a path to in . If then it is clear by assumption. Suppose now that . As is a solution, let be a path in from to a sink . As , still exists in . Thus, if we are done. Otherwise, it implies that there is such that is a path in . As has a path to in , we obtain the desired result. ∎
Informally, after deleting a vertex , we can add back to the graph when it is certain that has a path to a sink in the current graph. This is detailed by the following lemma and its corollary.
Let be a solution with set of sinks in . If there exists with , then is also a solution.
Proof.
Let be the set of sinks of . According to Observation 2, it suffices to prove that there is a path from to in . If is a sink in we are done. Otherwise, there exists an arc in , with . As is a solution, either is a sink and we are done, or, there exists a path in with . As , still exists in , and , is still a sink in . ∎
The following corollary is immediate.
In any optimal solution with set of sinks in , we have .
Observation 3.
Let be a knotfree vertex deletion with set of sinks in . If then for any vertex with it holds that .
To complete the previous observations, we can design two general reduction rules.
Reduction Rule 1.
If is an SCC of size one then remove .
Proof.
Let be the graph obtained by removing . Let of first show that is a yesinstance implies that is also a yesinstance. Let be a solution of of size at most with set of sinks in . Let , and the set of sinks in . Let us prove that every has a path ot in . Let . As is also in , there is a path in where . As , and thus, the path still exists in . Moreover, implies that , and thus that , implying that .
Let us now consider the reverse implication, and let be a solution of of size at most with set of sinks in and prove that is a solution of . Let us start with . As is a solution of and , there is path in where , and this path still exists in . As , is still a sink in and we are done. Consider now a vertex . As , there is path in . If then is a sink in and we are done. Otherwise, let . As is a SCC of size , , implying that , and thus according to the previous case has a path to a sink in . ∎
The previous reduction rule removes in particular sources and sinks, as they are SCC’s of size one.
Reduction Rule 2.
Let be a strongly connected component of with strictly more than outneighbors in . Then we can safely remove .
Proof.
Let be the graph obtained by removing . Let us first show that is a yesinstance implies that is also a yesinstance. Let be a solution of of size at most and the set of sinks in . Let , and the set of sinks in . Using the same argument (replacing by ) as in the first part of proof of Reduction 1, we get that every has a path ot in .
Let us now consider the reverse implication, and let be a solution of of size at most with set of sinks in and prove that is a solution of . Let us start with . As is a solution of there is path in where , and this path still exists in . As , is still a sink in and we are done. Consider now a vertex . As , there is path in . As has strictly more than outneighbors in , there is arc from to and thus according to the previous case has a path to a sink in . ∎
3 W[1]hardness and directed width measures
KFVD was shown to be W[1]hard using a reduction from Multicolored Independent Set (MIS) [cocoon2018]. However, the gadget used in this reduction to encode each color class has a longest directed path of unbounded length. First, we remark that it is possible to modify the reduction in order to prove that KFVD is W[1]hard even if the input graph has longest path length and Kwidth bounded by constants.
There is a polynomialtime reduction, preserving the size of the parameter, from MIS to KFVD such that the resulting graph has longest directed path of length at most and Kwidth equal to .
Proof.
Let be an instance of Multicolored Independent Set, and let be the color classes of . We construct an instance of KnotFree Vertex Deletion with bounded longest path length and Kwidth as follows.

for each , create a directed cycle of size two with the vertices and in ;

for a color class in , create one vertex ;

for each vertex in corresponding to a vertex of the color class in , create an arc from to and from to .

for each vertex in corresponding to a vertex of the color class in , create an arc from to

for each edge in create a set with two artificial vertices and and the arcs and ;

for each artificial vertex , create an edge from towards in .
Finally, set , is the set of vertices of corresponding to the vertices of in the same color class . Notice that, the longest path of has at most vertices, and for any pair in there are at most distinct directed paths in .
Now, suppose that now is a independent set with exactly one vertex of each set of . By construction, has knots which are . Thus, at least vertex removals are necessary to make free of knots. We set and show that is knotfree. For the vertex is a sink in , and every vertex of still reaches . Now, as is a independent set of each set in is adjacent to at least one vertex that is not in . Hence, each will still have at least one arc pointing outside , i.e., no new knots are created, and is knotfree.
Conversely, suppose that has a set of vertices of size such that is knotfree. In particular has to contain exactly one vertex of each of the knot , for . Since at least one sink has to be created in order to untie the knot , and since the only vertices of with only one outneighbor are the ’s ones, has to contain a vertex of each set . Moreover by deleting one vertex in a knot , the vertex is turned into sink and every other vertex of the same knot still has a path to . Since is knotfree, no new knots are created by the deletion of ; thus, every SCC will still have at least one arc pointing outside it. So, we set . Since each SCC corresponds to an edge of , and at least one vertex of each edge of is not in , the set contains no pair of adjacent vertices. Moreover, is composed by one vertex of each knot, which corresponds to a color of . Therefore, is a multicolored independent set of . ∎
Since MIS is W[1]hard, the following holds.
KFVD is W[1]hard even if the input graph has longest directed path of length at most and Kwidth equal to .
After the introduction of the notion of directed treewidth (dtw) [jhonson2001], a large number of width measures in digraphs were developed, such as: cycle rank [gruber2012] (cr); directed pathwidth [barat2006] (dpw); zigzag number [Oliveira2013] (zn); TreeZigZag number [Oliveira2016] (Tzn); Kellywidth [hunter2008] (Kelw); DAGwidth [berwanger2012] (dagw); Dwidth [safari2005] (Dw); weak separator number [Oliveira2016] (s); entanglement [berwanger2005] (ent); DAGdepth [ganian2014] (ddp). However, if a graph problem is hard when both the longest directed path length and the Kwidth are bounded, then it is hard for all these measures (see Figure 1).
Therefore, from the reduction presented in Theorem 3 we can observe that KFVD is paraNPhard with respect to all these width measures, and KFVD is W[1]hard even on inputs where such width measures are bounded. Thus, it seems to be extremely hard to identify nice width parameters for which KFVD can be solved in FPTtime or even in XPtime. Fortunately, there remain some parameters for which, at least, XPtime solvability is achieved. One of them is the directed feedback vertex set number (). This invariant is an upper bound on the size of a minimum knotfree vertex deletion set, so XPtime algorithms are trivial. This parameter is discussed in more detail in Section 5.
Another interesting width parameter for directed graphs that is not bounded by a function of the Kwidth and the length of a longest directed path is the cliquewidth of . Courcelle et al. [courcelle2000linear] showed that every graph problem definable in LinEMSOL can be solved in time on graphs with cliquewidth at most , when a expression is given as input. Using a result of Oum [Oum08], the same follows even if no expression is given.
[see [courcelle2012graph]] There is a monadic secondorder formula expressing the following property of vertices and of a set of vertices of a directed graph :
“ and there is a directed path from to in the subgraph induced by .” 
KFVD is FPT when parameterized by cliquewidth of the underlying undirected graph .
Proof.
From Proposition 1, we can construct (using shortcuts) a formula such that “ is knotfree vertex deletion set of ” , as follows:
Since is an formula, the problem of finding is definable in LinEMSOL. Thus we can find satisfying in time . ∎
The fixedparameter tractability for cliquewidth parameterization implies fixedparameter tractability of KFVD for many other popular parameters. For example, it is wellknown that the cliquewidth of a directed graph is at most , where is the treewidth of the underlying undirected graph (see [courcelle2012graph, Proposition 2.114]). However, although Theorem 3 implies the FPTmembership of the problem parameterized by the treewidth of the underlying undirected graph, the dependence on provided by the model checking framework is huge. So, it is still a pertinent question whether such a parameterized problem admits a single exponential algorithm, which is discussed in Section 4.
4 The treewidth of the underlying undirected graph as parameter
Given a tree decomposition , we denote by one node of and by the vertices contained in the bag of . We assume, without loss of generality, that is a nice tree decomposition (see [cygan2015parameterized]), that is, we assume that there is a special root node such that and all edges of the tree are directed towards and each node has one of the following four types: Leaf, Introduce vertex, Forget vertex, and Join.
Based on the following results we can assume that we are given a nice tree decomposition of .
[bodlaender2016c] There exists an algorithm that, given an vertex graph and an integer , runs in time and either outputs that the treewidth of is larger than , or constructs a tree decomposition of of width at most .
[cygan2015parameterized] Given a tree decomposition of of width at most , one can in time compute a nice tree decomposition of of width at most that has at most nodes.
Now we are ready to use a nice tree decomposition in order to obtain an FPTtime algorithm with single exponential dependency on and linear with respect to .
KnotFree Vertex Deletion can be solved in time, but assuming ETH there is no time algorithm for KFVD, where is the treewith of the underlying undirected graph of the input .
Proof.
Let be a nice tree decomposition of the input digraph , with width equal to . First, we consider the following additional notation and definitions: is the index of a bag of ; is the graph induced by all vertices such that either or is a descendant of in ; Given a knotfree vertex deletion set , for any bag there is a partition of into where

(removed) is the set of vertices of that are going to be removed ();

(sinks) is the set of vertices of that are going to be turned into sinks after the removal of ;

(free/released) is the set of vertices of that, after the removal of , are going to reach a sink that belongs to ;

(blocked) is the set of vertices of that, after the removal of , are going to reach no sink that belongs to ;
Let . We denote by the set of vertices in that reach some vertex of in the graph induced by .
The recurrence relation of our dynamic programming has the signature , representing the minimum number of vertices in that must be removed in order to produce a graph such that for every remaining vertex either reaches a vertex in (meaning that it may still be released in the future) or reaches a vertex that became a sink (possibly the vertex itself), where every vertex in is removed, every vertex in becomes a sink, every vertex in will have a path to a sink in , and form a partition of . Notice that the generated table has size , and when , and therefore contains the size of a minimum knotfree vertex deletion set of .
The recurrence relation for each type of node is described as follows.
First, notice that if and there is an outneighbor of that is not in , there is an inconsistency, i.e. must be deleted (must belong to ). In addition, if but has an outneighbor in , there is another inconsistency ( is not blocked), and if but the removal of turns into an isolated vertex, is not released, and it must belong to . For the inconsistent cases, . Such cases can be recognized and treated by simple preprocessing in linear time on the size of the table. Therefore, we consider next only consistent cases.
Leaf Node: If is a leaf node then . Therefore
Insertion Node: Let be a node of with a child such that for some . We have the following:
Recall that is the set of vertices in that reach in the graph induced by , i.e., the set of vertices that can be released by if it was blocked in . Also note that, for simplicity, we consider only consistent cases, thus in case 2 it holds that , in case 3 it holds that , and in case 4 it holds that .
Forget Node: Let be a forget node with a child such that , for some . The forget node selects the best scenario considering all the possibilities for the forgotten vertex, discarding cases that lead to nonfeasible solutions. In this problem, unfeasible cases are identified when the forgotten vertex of was blocked and reached no other node in . Hence:

If then

If then
Join Node: Let be a join node with children and , such that . For any optimal knotfree vertex deletion set of it holds that . Clearly, if then we can assume that . In addition, otherwise we will have an inconsistency. Also note that a vertex is released in if it reaches a vertex (possibly the vertex itself) that is released either in or . Thus:
Note that is the set of vertices that either are released in () or can be released in by vertices of , even if they are blocked in both and ; this can occur, for example, if a blocked vertex reaches another blocked node in , and in vertex is released.
Now, in order to run the algorithm, one can visit the bags of in a bottomup fashion, performing the queries described for each type of node. Since the reachability between the vertices of a bag can be stored in a bottomup manner on , one can fill each entry of the table in time, and as the table has size , the dynamic programming can be performed in time .
Regarding correctness, let be a minimum knotfree vertex deletion set of a digraph with a tree decomposition . Let be a partition of the vertices of into removed, sinks, released and blocked, with respect to after the removal of . Note that .
Fact 1. There is no vertex such that reaches a vertex in and . Otherwise, since every vertex in will reach a sink that is not in , by Observation 2 one can remove from every vertex that reaches in , obtaining a subset of which is also a knotfree vertex deletion set, contradicting the fact that S is minimum.
This fact implies that the paths considered to compute ’ can in fact be used to release blocked vertices. Similarly, Fact 2 also holds.
Fact 2. Let be a set for which the minimum is attained in the definition of . Then is also a solution (which is minimum) for KFVD. Otherwise, from we can also obtain a knotfree vertex deletion set smaller than , which is a contradiction.
Fact 2 implies that we have stored enough information. At this point, the correctness of the recursive formulas is straightforward.
Finally, to show a lower bound based on ETH, we can transform an instance of 3SAT into an instance of KFVD using the polynomial reduction presented in [cocoon2018, Theorem 4], obtaining in polynomial time a graph with , and so . Therefore, if KFVD can be solved in time, then we can solve 3SAT in time, i.e., ETH fails. ∎
5 The size of a minimum directed feedback vertex set as parameter
Recall that KFVD is hard (for fixed Kwidth and longest directed path) and that, as noticed in Observation 1, we can assume . This motivates us to determining the status of KFVD. In this section, we present two FPTalgorithms. Both with the size of a minimum directed feedback vertex set as parameter but with an aggregate parameter, the Kwidth, , for the first one and the length of a longest directed path, , for the second one. Since finding a minimum directed feedback vertex set in can be solved in FPTtime (with respect to ) [chen2008fixed], we consider that , a minimum DFVS, is given. Namely, we show that both KFVD and KFVD are FPT.
At this point, we need to define the following variant of KFVD.
Disjoint KnotFree Vertex Deletion (DisjointKFVD) Instance: A directed graph ; a subset ; and a positive integer . Question: Determine if has a set such that , and is knotfree.
We call forbidden vertices the vertices of the set . It is clear that DisjointKFVD generalizes KFVD by taking .
Let us now define two more steps that are FPT parameterized by and that will be used for both KFVD and KFVD. The next step will allow us to consider that the vertices of are forbidden. We need the following straightforward observation.
Observation 4.
Let be an instance of KFVD and .

if is a yesinstance and there exists a solution with , then is a yesinstance

if is a yesinstance then is a yesinstance
Branching 1 (On the directed feedback vertex set ).
Let be an instance of KFVD. In time we can build instances of DisjointKFVD as follows. We consider all possible partitions of into three parts: , the set of vertices of that will not be removed (i.e., they become forbidden); , the set of vertices in that will be removed; and , the set of vertices in that will be turned into sinks. For each such a partition (indicated by the index ), we remove the set of vertices and we apply exhaustively Reduction Rules 1 and 2 (see Section 2). We denote by the obtained graph, , and .
According to Observation 4, it is clear that is a yesinstance of KFVD if and only if one of the instances , , of DisjointKFVD is a yes instance. Since there are at most partitions of , the branching reduction can be performed in FPT time. Although at this point , in the next steps some vertices of may become forbidden and therefore should be added to . Also, from this point forward, we assume that we are given an instance of DisjointKFVD.
Notice that after applying Reduction Rule 1 (Section 2), each strongly connected component of is at least of size two. Thus, each of them must contain at least one cycle; therefore, the number of strongly connected components of is bounded by . Moreover, for any strongly connected component of , Reduction Rule 2 gives an upper bound for the number of vertices in (i.e., vertices that are not in but it is outneighbour of some vertex in ). This implies that has at most such vertices between its strongly connected components. This observation leads to a branching rule.
Branching 2 (On strongly connected components).
Let be the set of vertices that are extremities of arcs between the strongly connected components of . We have and we can branch in FPTtime trying all possible partitions of into two sets: , the set of vertices to be deleted in such that ; and , the set of vertices marked as forbidden, and then added into .
Notice that this step involves a branching. At this point, we may consider that we have an instance where and such that for any arc between two SCC’s and , . We call such an instance as a nice instance.
[After cleaning of Branching 2] If there is an algorithm running in time for DisjointKFVD restricted to nice instances that are strongly connected, then there is an FPT algorithm running in time (where is a constant) to solve DisjointKFVD for any nice instance.
Proof.
Let be a nice instance and be a solution. Let be the partition of where each is an SCC, and let . Without loss of generality we can assume that for some . Let . Notice that if is a solution then for any , is a solution of . Moreover, for any solutions
Comments
There are no comments yet.