On the Complexity of Secluded Path Problems
Abstract
This paper investigates the complexity of finding secluded paths in graphs. We focus on the Short Secluded Path problem and a natural new variant we introduce, Shortest Secluded Path. Formally, given an undirected graph , two vertices , and two integers , the Short Secluded Path problem asks whether there exists an - path of length at most with at most neighbors. This problem is known to be computationally hard: it is W[1]-hard when parameterized by the path length or by cliquewidth, and para-NP-complete when parameterized by the number of neighbors. The fixed-parameter tractability is known for or treewidth. In this paper, we expand the parameterized complexity landscape by designing (1) an XP algorithm parameterized by cliquewidth and (2) fixed-parameter algorithms parameterized by neighborhood diversity and twin cover number, respectively. As a byproduct, our results also provide parameterized algorithms for the classic - -Path problem. Furthermore, we introduce the Shortest Secluded Path problem, which seeks a shortest - path with the minimum number of neighbors. In contrast to the hardness of the original problem, we reveal that this variant is solvable in polynomial time on unweighted graphs. We complete this by showing that for edge-weighted graphs, the problem becomes W[1]-hard yet remains in XP when parameterized by the shortest path distance between and .
Keywords and phrases:
Secluded path, Parameterized complexity, Polynomial-time algorithmFunding:
Tesshu Hanaka: JSPS KAKENHI Grant Numbers JP21K17707, JP22H00513, JP25K03077, and JST, CRONOS, Japan Grant Number JPMJCS24K2.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithmsEditors:
Akanksha Agrawal and Erik Jan van LeeuwenSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Path-finding problems are one of the most fundamental graph problems. These problems have been well studied due to their high practicality [7, 9, 3, 1]. However, in many real-world scenarios, simply finding the shortest path is not sufficient. For instance, for secure communication, one may seek a data transmission path for sensitive information that minimizes exposure to potential eavesdroppers. Similarly, in a transportation network, a convoy path that avoids potential attackers could lead to more reliable and secure traveling. In robotics, a path for a robot might need to avoid areas with high sensor noise or potential collisions. These scenarios highlight the need for path-finding problems that consider the seclusion of the path from undesirable elements.
Motivated by these applications, the Short Secluded Path problem has been well studied [2, 11, 28, 21]. A vertex subset is called -secluded if it has at most neighbors. Formally, Short Secluded Path is defined as follows.
Short Secluded Path Instance: An undirected graph where and , two vertices , and two integers . Goal: Determine whether has an -secluded - path of length at most .
Figure 1 is an illustration of an -secluded - path of length at most when and .111In this paper, the length of a path is defined as the number of vertices in the path. Unfortunately, Short Secluded Path is NP-complete in general since it is equivalent to - Hamiltonian Path if we set and . Due to the NP-hardness of - Hamiltonian Path on restricted graph classes [6, 16], Short Secluded Path is NP-hard even on planar bipartite graphs of maximum degree 3, strongly chordal split graphs, and chordal bipartite graphs.
Thus, there has been considerable interest in its parameterized complexity. For the natural parameters and , Luckow and Fluschnik [21] show that Short Secluded Path is W[1]-hard when parameterized by , whereas it is fixed-parameter tractable (FPT) when parameterized by . Note that the problem is para-NP-complete when parameterized by due to the hardness of - Hamiltonian Path. In [28], van Bevern et al. study the fixed-parameter tractability and kernelization complexity of Short Secluded Path for structural parameters related to tree-like structures such as treewidth, vertex cover number, feedback vertex set number, and feedback edge set number. For treewidth tw, the authors presented an FPT algorithm for Short Secluded Path that runs in time. For kernelization, the problem admits a polynomial kernel when parameterized by the combination of and feedback vertex set number, and also when parameterized by feedback edge set number alone. In contrast, it does not admit a polynomial kernel when parameterized by vertex cover number, by the combination of and feedback vertex set number, or by the combination of and treewidth.
1.1 Our contribution
In this paper, we present parameterized algorithms for Short Secluded Path with respect to structural parameters related to dense structures such as clique-width, twin cover number, and neighborhood diversity. Our results lead to a more comprehensive understanding of the parameterized complexity of Short Secluded Path under structural graph parameters (see Figure 2).
First, we propose an XP algorithm when parameterized by clique-width. Since - Hamiltonian Path is known to be W[1]-hard when parameterized by clique-width [12, 16], this XP algorithm provides a tight complexity bound for this parameter. Furthermore, we design a -time algorithm and a -time algorithm for Short Secluded Path when parameterized by neighborhood diversity and twin cover number , respectively.
Here, it is worth mentioning that our algorithms are designed for Secluded -Path, which asks whether has an -secluded - path of length exactly . Thus, by setting , our results provide parameterized algorithms for the classical graph problem - -Path. To the best of our knowledge, the parameterized complexity of - -Path with respect to clique-width, twin cover number, and neighborhood diversity was unsettled.
Then we consider the Shortest Secluded Path problem. Unlike Short Secluded Path, the goal of this problem is to find a minimally secluded - path among all shortest - paths. Formally, Shortest Secluded Path is defined as follows.
Shortest Secluded Path Instance: An undirected graph where and , and two vertices . Goal: Find a shortest - path that minimizes the size of its open neighborhood in .
Interestingly, we show that Shortest Secluded Path is solvable in polynomial time on unweighted graphs. This is in contrast to the hardness of Short Secluded Path. However, for positive integer edge-weighted graphs, the problem becomes W[1]-hard when parameterized by the shortest path distance between and . To complement this, we finally present an XP algorithm when parameterized by .
1.2 Related work
There has been extensive literature on secluded subgraph problems. The study of this area is initiated by Chechik et al. [2], who first introduced the notion of seclusion for connectivity problems on graphs. Their original formulation, which they term exposure, is defined as the size of the closed neighborhood of a vertex subset. In their seminal work, Chechik et al. consider two problems: Secluded Path and its generalization Secluded Steiner Tree, where the goal is to find a path or a Steiner tree that minimizes its exposure. The authors show that while Secluded Path is hard to approximate, it is solvable in polynomial time on graphs with bounded degree. For Secluded Steiner Tree, they present a fixed-parameter algorithm parameterized by treewidth. Subsequently, Fomin et al. show that Secluded Steiner Tree is also FPT when parameterized by the exposure of a solution.
A significant shift in perspective came from van Bevern et al. [27], who decouple the solution size from the exposure, and introduce the notion of -secludedness. Within this framework, they investigate the parameterized complexity for finding secluded versions of several fundamental substructures on graphs, such as separators, dominating sets, -free vertex deletion sets, and independent sets. Building on this work, Golovach et al. [15] show that Connected Secluded -Free Subgraph is FPT when parameterized by , and Donkers et al. [8] present a faster FPT algorithm for Secluded Induced Tree parameterized by . Recently, the concept of seclusion has been extended further, with Mallek et al. [22] studying secluded subgraph problems on directed graphs.
2 Preliminaries
In this paper, we use standard graph-theoretic notations. Let be an undirected graph, where is the set of vertices and is the set of edges. We let and . For a positive integer , let
For a vertex , its neighborhood is . For a vertex subset , denotes the set of neighbors of . For simplicity, we sometimes use and instead of and . The subgraph induced by is denoted by .
The length of a path is defined by the number of vertices on the path. For two vertices , the shortest path distance between and , denoted by , is defined as the number of edges (resp., the sum of the weights of edges) in a shortest - path on unweighted graphs (resp., edge-weighted graphs). Two distinct vertices and are called twins if . In particular, twins and are called true twins if the edge exists, and otherwise called false twins.
We assume that the readers are familiar with the basic notions of parameterized complexity [5].
2.1 Cliquewidth
In this subsection, we define the cliquewidth of a graph . The definition relies on the concept of a -labeled graph, which we introduce first.
Definition 1 (-labeled graph).
Let be a positive integer. A -labeled graph is a pair of a graph and a function .
Definition 2 (Cliquewidth).
The cliquewidth of a graph , denoted by , is the minimum integer such that a -labeled graph can be constructed by repeatedly applying the following operations.
-
(O1)
Add a new vertex with label .
-
(O2)
Take the disjoint union of two -labeled graphs and , with
-
(O3)
Take distinct labels for a -labeled graph , and add an edge between every pair of vertices labeled by and by .
-
(O4)
Take distinct labels for a -labeled graph , and relabel the vertices of label to label .
This construction process for a -labeled graph can be represented by a rooted binary tree, called a -expression tree. Each node in this tree corresponds to one of the four operations: an introduce node (O1), a union node (O2), a join node (O3), or a relabel node (O4). The leaves of a -expression tree are always introduce nodes, and conversely, all introduce nodes are leaves. The graph associated with any node is the one constructed by the operations in its subtree, and thus the root of the tree represents the final graph .
A -expression tree is irredundant if for each edge , there is exactly one corresponding join node that adds this edge. Any -expression tree can be transformed into an irredundant one with nodes in linear time [4]. Therefore, we can assume without loss of generality that any given -expression tree is irredundant.
2.2 Neighborhood diversity and twin cover
A partition of is called a twin partition of if every is a set of twins. We call a module of . Then the neighborhood diversity of is defined as follows.
Definition 3 (Neighborhood diversity).
The neighborhood diversity of is the minimum number of modules among all twin partitions of .
We can compute the neighborhood diversity of and its twin partition in linear time [20, 23, 26]. By definition, each module forms either a clique (if it contains true twins) or an independent set (if it contains false twins).
The quotient graph corresponding to a twin partition is the graph , where . We observe that for any two modules and , either there are no edges between them, or every vertex in is adjacent to every vertex in .
A vertex set is called a twin cover if, for every edge , at least one of the following holds: (i) or , or (ii) and are true twins (i.e., adjacent and have identical open neighborhoods). The twin cover number of , denoted , is the size of a minimum twin cover of .
2.3 Integer linear programming
In this subsection, we introduce Integer Linear Programming (ILP) and its fixed-parameter tractability.
Definition 4 (-Variable Integer Linear Programming Feasibility (-ILP)).
Given a matrix and a vector , -Variable Integer Linear Programming Feasibility asks whether there exists a vector satisfying .
It is known that -ILP is fixed-parameter tractable with respect to the number of variables.
3 XP Algorithm Parameterized by Cliquewidth
In this section, we design an -time algorithm parameterized by cliquewidth for the problem of determining whether has an - path of length with exactly neighbors. By solving this for each and , Secluded -Path and Short Secluded Path can also be solved in time .
Theorem 6.
There is an -time algorithm that, for a graph of cliquewidth cw, determines whether it contains an - path of length with neighbors.
Our algorithm is based on dynamic programming on a cliquewidth expression tree of . It is known that for a graph with cliquewidth , a -expression tree with nodes can be computed in time [25, 24, 17]. For our algorithm, we must distinguish the source and target . We achieve this by assigning them two new, unique labels. We can thus assume that we are given an -expression tree with where is assigned label and is assigned label .
For a given expression tree , we execute dynamic programming in a bottom-up manner, from the leaves to the root. For each node in , let be the labeled subgraph associated with . The DP table at each node stores boolean values for states defined by a tuple of parameters. A state corresponds to the properties of a set of vertex-disjoint paths within , denoted by . Intuitively, each path in represents a sub-path of a potential solution in , i.e., an - path of length with neighbors. Thus, the DP state needs to track the number of vertices of the solution, the number of their neighborhoods, the number of other vertices, and the number of sub-paths with respect to the labels of the endpoints. The information on endpoint labels of sub-paths is used when merging sub-paths at a join node. We use the notation as a shorthand for , the set of all vertices in any path in . The parameters in our DP state are defined as follows:
-
For each label :
-
–
: the number of vertices in with label .
-
–
: the number of vertices in with label .
-
–
: the number of vertices with label in that belong to neither nor its neighborhood.
-
–
-
For each pair of labels with :
-
–
: the number of paths in having one endpoint with label and the other with label .
-
–
We call the solution count vector, the neighborhood count vector, the remaining vertex count vector, and the path count vector, respectively. The DP entry is a boolean value. It is true if and only if there exists a set of vertex-disjoint paths in that satisfies all of the following conditions:
-
1.
For each label , the number of vertices in with label is exactly , i.e., .
-
2.
For each label , the number of vertices in the neighborhood with label is exactly , i.e., .
-
3.
For each label , the number of vertices with label in that belong to neither nor its neighborhood is exactly , i.e., .
-
4.
For each pair of labels , the number of paths in with endpoints labeled and is exactly .
For convenience, if a set of paths is empty, . In this case, its neighborhood is also empty, and this corresponds to the state where for all .
From these definitions, for all parameters. Thus, the size of the DP table at each node is bounded by . As initialization, we set all entries of the DP tables to false.
The existence of a solution in the original graph is determined by checking the DP table of the root node, . A key observation is that an - path of length with neighbors exists if and only if there exists a path whose endpoints are labeled by and in satisfying , and . Note that and have the unique labels and , respectively. Therefore, an - path of length with neighbors exists if and only if and only if at the root node such that:
-
,
-
,
-
,
-
,
-
,
-
,
-
, and
-
for except and .
In the following, we describe the recursive formulas for updating the DP table at each node of the expression tree. The updates for introduce, union, and relabel nodes are relatively straightforward, while the update at a join node is the most challenging part. Intuitively, our DP state tracks, for each label, the number of vertices in the solution, their neighborhoods, and the other vertices, as well as the number of vertex-disjoint paths distinguished by their endpoint labels. For an introduce node, which adds a single labeled vertex, we only need to generate the initial states corresponding to this new vertex, forming a trivial path of length one, or being an isolated vertex not part of the solution. For a union node, which combines two disjoint subgraphs, the new DP table is computed by merging states from its two children. As no edges are added between the subgraphs, paths from each part remain separate. Thus, for any pair of valid states (one from each child), we can compute the resulting state’s parameters by simple addition. The update for a relabel node that changes label to is also based on addition: for each state, the counts associated with label are consolidated into the counts for label .
The main challenge lies with the join node, which adds edges between all vertices of label and all vertices of label . These new edges may connect multiple existing paths into longer ones. Therefore, the core of the update is to iterate through all valid states of the child node and, for each state, enumerate all feasible ways that the paths can be connected. Although the number of ways to connect paths can be large, it can be shown that this process can be handled in time . The running time for a join node is determined by iterating through all possible resulting states. Since the size of the DP table is , and we must process each state from the child’s table, the update at a join node can be performed in time . As the expression tree has nodes, the total running time is dominated by the join operations, yielding . The details of the algorithm are provided in the appendix.
By applying Theorem 6 for each , we can also solve Secluded -Path and Short Secluded Path.
Corollary 7.
Secluded -Path and Short Secluded Path can be solved in time .
4 FPT Algorithm Parameterized by Neighborhood Diversity
In this section, we propose a fixed-parameter algorithm for Short Secluded Path parameterized by neighborhood diversity, which runs in time. To show this, we first provide a fixed-parameter algorithm for - -Path by neighborhood diversity.
4.1 FPT algorithm for - -Path
We give an ILP formula with variables for determining whether has an - path of length passing through every module.
Let be the quotient graph with respect to a twin partition , where is the number of modules in the partition of . Suppose that and for are modules in , and is connected.
We define the ILP instance (P) with variables (for ), and (for ) subject to the following constraints.
-
1.
For every :
-
2.
-
(a)
(if )
-
(b)
-
(c)
-
(a)
-
3.
-
(a)
(if is an independent set)
-
(b)
(if is a clique)
-
(a)
For every partition of into vertex sets and :
-
4.
For every variable :
-
5.
For every variable :
-
6.
The core idea is to extend the standard flow-conservation principle commonly used in network flow problems. We imagine one unit of flow originating at a source module , being consumed at a sink module , and being conserved at all intermediate modules.
The variables and model the flow moving in either direction between two modules and . They also correspond to the number of arcs from to on a directed path from to . This approach captures the path’s traversal, potentially back and forth, through the graph of modules. The integer variables track the number of vertices used within each module that the path visits.
The constraint (1) guarantees that the size of a solution is exactly . The constraints (2) are the low conservation constraints. Constraint (2.a) ensures that for any intermediate module (not a source or sink), the incoming flow equals the outgoing flow, implying that the number of incoming edges and the number of outgoing edges are equal in the intermediate modules. Constraints (2.b) and (2.c) define the source and sink, respectively: exactly one unit of flow leaves the source module , and exactly one unit of flow enters the sink module . Note that and by assumption.
The constraints (3) govern the relationship between the flow passing through a module and the number of vertices used within it (). The constraint (3.a) implies that every incoming edge immediately goes out in an independent set module . Thus, the number of incoming edges is equal to the number of used vertices in . The constraint (3.b) implies that may pass through several vertices and then go out in a clique module . Thus, the number of incoming edges is at most the number of used vertices in .
The constraint (4) is the connectivity condition, which ensures that a solution forms a single path. This disallows invalid solutions, such as a subgraph composed of a path and disjoint cycles.
The constraint (5) is a non-negativity constraint. The constraint (6) ensures that for each module, a solution contains at least one vertex in the module and no more vertices than the size of the module.
Lemma 8.
The ILP instance (P) is feasible if and only if there is an - path in with vertices that includes at least one vertex from each module .
Lemma 9.
Given a twin partition with modules, the problem of determining whether there is an - path of length passing through every module can be solved in time.
4.2 FPT algorithm for Short Secluded Path
Using Lemma 9, we present an FPT algorithm for Secluded -Path and Short Secluded Path parameterized by neighborhood diversity. A key observation is that if a path visits a module , then all vertices from this module not on the path are in the neighborhood of the path. Also, all the vertices in modules adjacent to are in the neighborhood of the path. Therefore, what we only have to do is to solve the problem of determining whether there is an - path of length passing through every guessed module by using Lemma 9.
Theorem 10.
Secluded -Path parameterized by neighborhood diversity can be solved in time.
Proof.
First, we compute a twin partition for with modules in linear time [20, 23, 26]. We ensure that and are in their own singleton modules by splitting the modules containing them. If , we replace with and add a new module . We do the same for . This results in a new twin partition with . The algorithm proceeds by guessing which modules contain the vertices of a potential -secluded - path of length at most . We must always include and in . There are possible choices for .
Let . For each guess, we check if there exists a valid solution containing at least one vertex in each module in in the subgraph induced by the vertices of . If or the induced subgraph is not connected, we can discard this guess.
Let be the set of modules adjacent to at least one module in . For any - path with , its neighborhood consists of two parts: (1) all vertices in the modules of , and (2) all vertices in modules of that are not on the path . Therefore, . The size of the neighborhood is . Since , is given by for a fixed guess (which fixes ). Thus, if , we discard such a guess.
Finally, we only have to determine whether there exists a path of length in the graph that visits every module in . By Lemma 9, this can be determined in time . We repeat this for all guesses of . The total runtime is .
By applying Theorem 10 to Secluded -Path for , Short Secluded Path can also be solved in time.
Corollary 11.
For a graph of neighborhood diversity nd, Short Secluded Path can be solved in time.
5 FPT Algorithm Parameterized by Twin Cover Number
In this section, we design a -time algorithm for Short Secluded Path and Secluded -Path parameterized by twin cover number.
Theorem 12.
Secluded -Path can be solved in time.
Proof.
For any graph , a twin cover of size tc can be computed in time [14]. Let and .
First, we guess the set of edges from that are part of the secluded path. The number of edges in is at most . Since a path on vertices has at most edges, we guess subsets of at most edges as candidates for partial solutions inside of . The number of guessed subsets is bounded by .
For each guess, we check if the subgraph formed by these edges consists of a collection of disjoint paths, if and are part of the subgraph because they must be endpoints of a path, and if the sum of the number of vertices in the guessed disjoint paths is at most . This clearly can be done in polynomial time. If these conditions are not satisfied, we discard the current guess.
Let be sub-paths within of a guessed partial solution, where . Let be the set of vertices in these paths.
Next, we construct a full - path by ordering these sub-paths and connecting them with cliques from . First, we guess the orderings of the sub-paths. If and belong to the same sub-path , then this must be the entire path. In this case, we check if , , and . If so, is indeed an -secluded - path of length , and otherwise we safely conclude that the guess is invalid. If and are in different sub-paths, we fix the path containing at the beginning and the one containing at the end. We then guess the ordering of the remaining paths. Since , the number of such orderings is .
For a fixed ordering of sub-paths, we need to connect them. Since is a separator and is a union of disjoint cliques, vertices in exactly one clique connect two sub-paths in .
Here, we categorize cliques in with respect to neighbors in , and we define the sets of vertices where vertices in have the common neighbors in , that is, for . Note that . By the definition of a twin cover, each connected component of is a clique and is fully contained in some . We say that a clique in is from if .
To connect the gaps between the ordered sub-paths, we guess which set provides the connecting clique for each gap. Since there are gaps and choices for each, the total number of ways to choose the sequence of ’s is .
For each such guess, we verify whether it is valid. If a chosen cannot connect the corresponding sub-paths, we reject it. We also calculate the minimum possible path length. Since we must use at least one vertex from a clique in each of the gaps, the length of an - path constructed is at least . If , we safely reject it. Furthermore, if the number of times a set is selected is more than , then we reject it because we cannot construct an - path even by using all the vertices in .
Now, for each gap between two sub-paths, we must select a specific clique from the chosen . Then by the following claim, we can focus on at most largest cliques in each .
Claim 13.
Suppose that contains cliques ordered by non-increasing size (). Then if there exists an - path that passes through cliques from , there exists an - path that passes through the largest cliques from , (or all cliques if ), such that and .
Now we need to decide vertices to take from the selected cliques. Here, we observe that the vertex set can be partitioned into four parts: (1) the set of vertices on inside , (2) the set of vertices in the selected cliques in , (3) the set of neighbors of except for vertices in , and (4) The set of the other vertices which lie outside both and (see Figure 3). Then the following claim holds.
Claim 14.
Let be an - path and let be the set of cliques in that intersect with . The number of neighbors of the path is given by:
| (1) |
If we have fixed the sub-paths in and the cliques connecting them, we observe that the first three terms , , and in the right-hand side of Equation 1 are determined. Note that . Since , from Claim 14, is also determined.
After fixing the sub-paths in and the ’s for connecting pairs of sub-paths, we can identify the set of candidate cliques (the largest ones, by Claim 13). Since each clique in have the same neighbors by the definition of a twin cover, if is satisfied, we can obtain a path of length (we just need to arbitrarily choose vertices from selected cliques in such that at least one vertex is chosen from each selected clique). This is clearly done in polynomial time.
Finally, we analyze the running time. Guessing the sub-paths in , the orderings of the sub-paths, and the ’s for connecting pairs of sub-paths can be done in time . After the guesses, we can check whether each guess is valid by verifying whether in polynomial time. Therefore, the total time is .
Corollary 15.
Short Secluded Path can be solved in time.
6 Computational Complexity of Shortest Secluded Path
In this section, we study the computational complexity of Shortest Secluded Path.
6.1 Polynomial-time algorithm on unweighted graphs
In this subsection, we present a polynomial-time algorithm for Shortest Secluded Path on unweighted graphs.
Let be the distance between and . For , we define the layer and as the set of vertices whose distance from is and from is . These layers can be computed in linear time by performing a breadth-first search from and from , respectively. By definition, and . Let and . It is easily seen that every vertex satisfying is contained in , and any vertex in satisfies that . Thus, every shortest - path is contained in . Then, the following lemmas hold.
Lemma 16.
For any integer , the neighbors of any vertex in that are also in must belong to it’s layer or adjacent layers. Formally:
(Here, we define .)
Proof.
For a vertex , let be a neighbor of . By the triangle inequality, we must have , which means . Symmetrically, . Together, these imply that satisfies .
Lemma 17.
For any vertex and any integer , if has a neighbor in , then its set of neighbors in , denoted by , must satisfy one of the following three conditions: (1) , (2) , and (3) .
From Lemmas 16 and 17, the neighbors of vertices in are in . Moreover, the neighbors in are also adjacent to only . This locality is the key to our dynamic programming approach, as it ensures that when extending a path to layer , the change in the neighborhood of the path only depends on the most recent layers.
Our dynamic programming table, , stores values for pairs of adjacent vertices where and . The entry is defined as the minimum size of the neighborhood of a shortest - path that uses the edge as its last edge. If no such path exists, or if , then . The solution to the overall problem is then .
For (the base case), we consider paths of length 2 from to a vertex . Since , the edge must exist. The path consists of edge . The size of its neighborhood is . Thus, we initialize .
For , the recursive formula for is computed as follows:
Here, represents the number of new neighbors added when extending the path from to . Due to the locality shown by Lemmas 16 and 17, never shares neighbors of . Thus, these new neighbors are precisely those in that are not already neighbors of the path ending in .
Finally, we analyze the running time. The sets can be computed in time. The size of the DP table is since the number of layers is at most . For three vertices , can be computed in polynomial time in advance. Thus, each entry can be computed in time from . Therefore, the total running time is .
Theorem 18.
Shortest Secluded Path can be solved in time.
6.2 Shortest Secluded Path on weighted graphs
In this subsection, we discuss Shortest Secluded Path on edge-weighted graphs. We assume that each edge weight is a positive integer. We first show Shortest Secluded Path on weighted graphs is W[1]-hard with respect to the shortest path distance between and by a reduction from Multicolored Clique. Here, the shortest path distance between and is defined by the minimum weight of an - path.
Multicolored Clique Instance: A graph with vertices where each forms an independent set. Goal: Determine whether has a clique of size .
Multicolored Clique is W[1]-hard when parameterized by even on regular graphs [10].
Theorem 19.
Shortest Secluded Path on edge-weighted graphs is W[1]-hard parameterized by the shortest path distance between and in the input graph.
Proof.
We show the parameterized reduction from Multicolored Clique to Shortest Secluded Path.
Let an -regular graph be an instance of Multicolored Clique, where . Then, we construct an equivalent instance of Shortest Secluded Path on edge-weighted graphs. We first define where and . Then we connect to all vertices in and to all vertices in with edges of weight . Moreover, for each , we connect to all vertices in with edges of weight . Finally, for , we connect to and with edges of weight . Figure 4 illustrates the constructed graph .
Clearly, can be constructed in polynomial time. By the construction of , the shortest path distance between and is . In the following, we show that there is a clique of size in if and only there is a shortest - path of weight satisfying in where is the set of vertices of on .
Let be a clique of size in , where . We define an - path of weight . Since all edges in have weights , the weight of is , and thus is a shortest - path in .
We next show satisfies . We observe that holds. Since , the neighborhood of includes vertices in . Furthermore, since is an -regular graph, any vertex in has neighbors in in . Since is a clique in , for , any pair has an edge . Thus, and have a common neighbor . Therefore, has only neighbors in . Consequently, holds.
Conversely, suppose that there is a shortest - path of weight satisfying in . If contains any vertex in , the weight of is at least . Thus, does not contain any vertex in . Hence, by the construction of , must pass through and exactly one vertex in each , and holds. Consequently, and has at most neighbors in . Since every vertex in has neighbors in , they must share vertices in . Since , every pair of must share , which implies that there exists edge in . This means that forms a clique of size , which completes the proof.
Finally, we present an XP algorithm for Shortest Secluded Path that runs in time where is the shortest path distance between and in the input graph.
Theorem 20.
Shortest Secluded Path on edge-weighted graphs can be solved in time, where is the shortest path distance between and in the input graph.
Proof.
Given an input graph , we first compute the shortest path distance between and by Dijkstra’s algorithm [7]. Since the edge weights are nonnegative integers, any shortest - path contains at most edges. Thus, all shortest - paths can be enumerated in time. Since the neighborhood of a shortest - path can be computed in polynomial time, Shortest Secluded Path can be solved in time.
7 Conclusion
In this paper, we investigated the structural parameterizations of Short Secluded Path and the computational complexity of Shortest Secluded Path.
For the structural parameterizations of Short Secluded Path, we presented an XP algorithm parameterized by cliquewidth and FPT algorithms parameterized by neighborhood diversity and twin cover number, respectively. Regarding Shortest Secluded Path, we first proposed a polynomial-time algorithm for unweighted graphs. For edge-weighted graphs, however, we proved that the problem is W[1]-hard but is in XP when parameterized by the shortest path distance between and .
A natural future direction is to investigate the parameterized complexity of Short Secluded Path with respect to other structural parameters, such as the cluster vertex deletion number and modular-width. Furthermore, improving the running times of our algorithms is an interesting challenge. In particular, given an -expression tree, our XP algorithm parameterized by cliquewidth runs in time. It is worth considering whether this running time can be improved to . It would also be interesting to design a single-exponential FPT algorithm parameterized by the twin cover number, since our current algorithm runs in time.
References
- [1] R. Bellman. On a routing problem. Quarterly of Applied Mathematics, 16:87–90, 1958.
- [2] Shiri Chechik, Matthew P. Johnson, Merav Parter, and David Peleg. Secluded connectivity problems. Algorithmica, 79(3):708–741, 2017. doi:10.1007/S00453-016-0222-Z.
- [3] Boris V. Cherkassky, Andrew V. Goldberg, and Tomasz Radzik. Shortest paths algorithms: Theory and experimental evaluation. Math. Program., 73(2):129–174, May 1996. doi:10.1007/BF02592101.
- [4] Bruno Courcelle and Stephan Olariu. Upper bounds to the clique width of graphs. Discret. Appl. Math., 101(1-3):77–114, 2000. doi:10.1016/S0166-218X(99)00184-5.
- [5] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [6] Alexsander Andrade de Melo, Celina M. H. de Figueiredo, and Uéverton S. Souza. On the computational difficulty of the terminal connection problem. RAIRO Theor. Informatics Appl., 57:3, 2023. doi:10.1051/ITA/2023002.
- [7] Edsger W. Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik, 1(1):269–271, 1959. doi:10.1007/BF01386390.
- [8] Huib Donkers, Bart M. P. Jansen, and Jari J. H. de Kroon. Finding k-secluded trees faster. J. Comput. Syst. Sci., 138:103461, 2023. doi:10.1016/J.JCSS.2023.05.006.
- [9] David Eppstein. Finding the shortest paths. SIAM J. Comput., 28(2):652–673, 1998. doi:10.1137/S0097539795290477.
- [10] Michael R. Fellows, Danny Hermelin, Frances A. Rosamond, and Stéphane Vialette. On the parameterized complexity of multiple-interval graph problems. Theor. Comput. Sci., 410(1):53–61, 2009. doi:10.1016/J.TCS.2008.09.065.
- [11] Fedor V. Fomin, Petr A. Golovach, Nikolay Karpov, and Alexander S. Kulikov. Parameterized complexity of secluded connectivity problems. Theory Comput. Syst., 61(3):795–819, 2017. doi:10.1007/S00224-016-9717-X.
- [12] Fedor V. Fomin, Petr A. Golovach, Daniel Lokshtanov, and Saket Saurabh. Intractability of clique-width parameterizations. SIAM J. Comput., 39(5):1941–1956, 2010. doi:10.1137/080742270.
- [13] András Frank and Éva Tardos. An application of simultaneous diophantine approximation in combinatorial optimization. Comb., 7(1):49–65, 1987. doi:10.1007/BF02579200.
- [14] Robert Ganian. Improving vertex cover as a graph parameter. Discret. Math. Theor. Comput. Sci., 17(2):77–100, 2015. doi:10.46298/DMTCS.2136.
- [15] Petr A. Golovach, Pinar Heggernes, Paloma T. Lima, and Pedro Montealegre. Finding connected secluded subgraphs. J. Comput. Syst. Sci., 113:101–124, 2020. doi:10.1016/J.JCSS.2020.05.006.
- [16] Tesshu Hanaka and Yasuaki Kobayashi. Finding a minimum spanning tree with a small non-terminal set. Theor. Comput. Sci., 1033:115092, 2025. doi:10.1016/J.TCS.2025.115092.
- [17] Petr Hlinený and Sang-il Oum. Finding branch-decompositions and rank-decompositions. SIAM J. Comput., 38(3):1012–1032, 2008. doi:10.1137/070685920.
- [18] Hendrik W. Lenstra Jr. Integer programming with a fixed number of variables. Math. Oper. Res., 8(4):538–548, 1983. doi:10.1287/MOOR.8.4.538.
- [19] Ravi Kannan. Minkowski’s convex body theorem and integer programming. Math. Oper. Res., 12(3):415–440, 1987. doi:10.1287/MOOR.12.3.415.
- [20] Michael Lampis. Algorithmic meta-theorems for restrictions of treewidth. Algorithmica, 64(1):19–37, 2012. doi:10.1007/S00453-011-9554-X.
- [21] Max-Jonathan Luckow and Till Fluschnik. On the computational complexity of length- and neighborhood-constrained path problems. Inf. Process. Lett., 156:105913, 2020. doi:10.1016/J.IPL.2019.105913.
- [22] Nadym Mallek, Jonas Schmidt, and Shaily Verma. A parameterized study of secluded structures in directed graphs. CoRR, abs/2502.06048, 2025. doi:10.48550/arXiv.2502.06048.
- [23] Ross M. McConnell and Jeremy P. Spinrad. Modular decomposition and transitive orientation. Discret. Math., 201(1-3):189–241, 1999. doi:10.1016/S0012-365X(98)00319-7.
- [24] Sang-il Oum. Approximating rank-width and clique-width quickly. ACM Trans. Algorithms, 5(1):10:1–10:20, 2008. doi:10.1145/1435375.1435385.
- [25] Sang-il Oum and Paul D. Seymour. Approximating clique-width and branch-width. J. Comb. Theory B, 96(4):514–528, 2006. doi:10.1016/J.JCTB.2005.10.006.
- [26] Marc Tedder, Derek G. Corneil, Michel Habib, and Christophe Paul. Simpler linear-time modular decomposition via recursive factorizing permutations. In Luca Aceto, Ivan Damgård, Leslie Ann Goldberg, Magnús M. Halldórsson, Anna Ingólfsdóttir, and Igor Walukiewicz, editors, Automata, Languages and Programming, 35th International Colloquium, ICALP 2008, Reykjavik, Iceland, July 7-11, 2008, Proceedings, Part I: Tack A: Algorithms, Automata, Complexity, and Games, volume 5125 of Lecture Notes in Computer Science, pages 634–645. Springer, 2008. doi:10.1007/978-3-540-70575-8_52.
- [27] René van Bevern, Till Fluschnik, George B. Mertzios, Hendrik Molter, Manuel Sorge, and Ondrej Suchý. The parameterized complexity of finding secluded solutions to some classical optimization problems on graphs. Discret. Optim., 30:20–50, 2018. doi:10.1016/J.DISOPT.2018.05.002.
- [28] René van Bevern, Till Fluschnik, and Oxana Yu. Tsidulko. Parameterized algorithms and data reduction for the short secluded --path problem. Networks, 75(1):34–63, 2020. doi:10.1002/NET.21904.
