Abstract 1 Introduction 2 Preliminaries 3 XP Algorithm Parameterized by Cliquewidth 4 FPT Algorithm Parameterized by Neighborhood Diversity 5 FPT Algorithm Parameterized by Twin Cover Number 6 Computational Complexity of Shortest Secluded Path 7 Conclusion References

On the Complexity of Secluded Path Problems

Tesshu Hanaka ORCID Kyushu University, Fukuoka, Japan Daisuke Tsuru Kyushu University, Fukuoka, Japan
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 G=(V,E), two vertices s,tV, and two integers k,l, the Short Secluded Path problem asks whether there exists an s-t path of length at most k with at most l neighbors. This problem is known to be computationally hard: it is W[1]-hard when parameterized by the path length k or by cliquewidth, and para-NP-complete when parameterized by the number l of neighbors. The fixed-parameter tractability is known for k+l 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 s-t k-Path problem. Furthermore, we introduce the Shortest Secluded Path problem, which seeks a shortest s-t 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 s and t.

Keywords and phrases:
Secluded path, Parameterized complexity, Polynomial-time algorithm
Funding:
Tesshu Hanaka: JSPS KAKENHI Grant Numbers JP21K17707, JP22H00513, JP25K03077, and JST, CRONOS, Japan Grant Number JPMJCS24K2.
Copyright and License:
[Uncaptioned image] © Tesshu Hanaka and Daisuke Tsuru; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Parameterized complexity and exact algorithms
Editors:
Akanksha Agrawal and Erik Jan van Leeuwen

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 UV is called l-secluded if it has at most l neighbors. Formally, Short Secluded Path is defined as follows.

Short Secluded Path  Instance: An undirected graph G=(V,E) where |V|=n and |E|=m, two vertices s,tV, and two integers k,l. Goal: Determine whether G has an l-secluded s-t path of length at most k.

Figure 1 is an illustration of an l-secluded s-t path of length at most k when l=5 and k=5.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 s-t Hamiltonian Path if we set k=n and l=0. Due to the NP-hardness of s-t 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.

Figure 1: An illustration of a 5-secluded s-t path P of length 5. The s-t path P consists of the red vertices. The blue vertices are neighbors of P.

Thus, there has been considerable interest in its parameterized complexity. For the natural parameters k and l, Luckow and Fluschnik [21] show that Short Secluded Path is W[1]-hard when parameterized by k, whereas it is fixed-parameter tractable (FPT) when parameterized by k+l. Note that the problem is para-NP-complete when parameterized by l due to the hardness of s-t 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 2O(tw)nO(1) time. For kernelization, the problem admits a polynomial kernel when parameterized by the combination of k,l, 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 l and feedback vertex set number, or by the combination of k,l, 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).

Figure 2: Parameterized complexity of Short Secluded Path with respect to structural graph parameters. The connection between two parameters indicates that the upper parameter p is bounded by some computable function f() of the lower parameter q; that is, pf(q). Parameters marked with an asterisk () represent our contributions in this paper. Double-bordered rectangles indicate that the parameterized problem belongs to XP but is W[1]-hard; rounded rectangles indicate that the parameterized problem is fixed-parameter tractable (FPT); and dotted rectangles represent cases that remain open.

First, we propose an XP algorithm when parameterized by clique-width. Since s-t 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 nd(G)O(nd(G)2)nO(1)-time algorithm and a 2O(tc(G)2)nO(1)-time algorithm for Short Secluded Path when parameterized by neighborhood diversity nd(G) and twin cover number tc(G), respectively.

Here, it is worth mentioning that our algorithms are designed for Secluded k-Path, which asks whether G has an l-secluded s-t path of length exactly k. Thus, by setting l=n, our results provide parameterized algorithms for the classical graph problem s-t k-Path. To the best of our knowledge, the parameterized complexity of s-t k-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 s-t path among all shortest s-t paths. Formally, Shortest Secluded Path is defined as follows.

Shortest Secluded Path  Instance: An undirected graph G=(V,E) where |V|=n and |E|=m, and two vertices s,tV. Goal: Find a shortest s-t path P that minimizes the size of its open neighborhood |N(V(P))| in G.

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 d between s and t. To complement this, we finally present an XP algorithm when parameterized by d.

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 l-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 l, and Donkers et al. [8] present a faster FPT algorithm for Secluded Induced Tree parameterized by l. 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 G=(V,E) be an undirected graph, where V is the set of vertices and E is the set of edges. We let n=|V| and m=|E|. For a positive integer n, let [n]:={1,2,,n}

For a vertex vV, its neighborhood is NG(v)={uV{v,u}E}. For a vertex subset UV, NG(U)={vVUuU,{u,v}E} denotes the set of neighbors of U. For simplicity, we sometimes use N(v) and N(U) instead of NG(v) and NG(U). The subgraph induced by U is denoted by G[U].

The length of a path is defined by the number of vertices on the path. For two vertices u,vV, the shortest path distance between u and v, denoted by dist(u,v), is defined as the number of edges (resp., the sum of the weights of edges) in a shortest u-v path on unweighted graphs (resp., edge-weighted graphs). Two distinct vertices u and v are called twins if N(u){v}=N(v){u}. In particular, twins u and v are called true twins if the edge {u,v} 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 G. The definition relies on the concept of a k-labeled graph, which we introduce first.

Definition 1 (k-labeled graph).

Let k be a positive integer. A k-labeled graph is a pair (G,𝚕𝚊𝚋G) of a graph G and a function 𝚕𝚊𝚋G:V{1,,k}.

Definition 2 (Cliquewidth).

The cliquewidth of a graph G, denoted by cw(G), is the minimum integer k such that a k-labeled graph (G,𝚕𝚊𝚋G) can be constructed by repeatedly applying the following operations.

  1. (O1)

    Add a new vertex v with label i[k].

  2. (O2)

    Take the disjoint union (GH,𝚕𝚊𝚋GH) of two k-labeled graphs (G,𝚕𝚊𝚋G) and (H,𝚕𝚊𝚋H), with

    𝚕𝚊𝚋GH(v)={𝚕𝚊𝚋G(v)ifvV(G),𝚕𝚊𝚋H(v)otherwise.
  3. (O3)

    Take distinct labels i,j[k] for a k-labeled graph G, and add an edge between every pair of vertices labeled by i and by j.

  4. (O4)

    Take distinct labels i,j[k] for a k-labeled graph G, and relabel the vertices of label i to label j.

This construction process for a k-labeled graph can be represented by a rooted binary tree, called a k-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 k-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 G.

A k-expression tree is irredundant if for each edge {u,v}E(G), there is exactly one corresponding join node that adds this edge. Any k-expression tree can be transformed into an irredundant one with O(n) nodes in linear time [4]. Therefore, we can assume without loss of generality that any given k-expression tree is irredundant.

While computing the exact cliquewidth and an optimal expression tree is NP-hard, a polynomial-time approximation algorithm exists. Specifically, a (2cw(G)+11)-expression tree for a graph G with cliquewidth cw(G) can be computed in O(n3) time [25, 24, 17].

2.2 Neighborhood diversity and twin cover

A partition ={M1,,Mr} of V is called a twin partition of G if every Mi is a set of twins. We call Mi a module of . Then the neighborhood diversity of G is defined as follows.

Definition 3 (Neighborhood diversity).

The neighborhood diversity nd(G) of G is the minimum number of modules among all twin partitions of G.

We can compute the neighborhood diversity nd(G) of G 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 ={M1,M2,,Mr} is the graph Q=(,E()), where E()={{Mi,Mj}{u,v}E,uMi,vMj}. We observe that for any two modules Mi and Mj, either there are no edges between them, or every vertex in Mi is adjacent to every vertex in Mj.

A vertex set XV is called a twin cover if, for every edge {u,v}E, at least one of the following holds: (i) uX or vX, or (ii) u and v are true twins (i.e., adjacent and have identical open neighborhoods). The twin cover number of G, denoted tc(G), is the size of a minimum twin cover of G.

2.3 Integer linear programming

In this subsection, we introduce Integer Linear Programming (ILP) and its fixed-parameter tractability.

Definition 4 (p-Variable Integer Linear Programming Feasibility (p-ILP)).

Given a matrix Am×p and a vector bm, p-Variable Integer Linear Programming Feasibility asks whether there exists a vector xp satisfying Axb.

It is known that p-ILP is fixed-parameter tractable with respect to the number p of variables.

Theorem 5 (​​[18, 13, 19]).

p-Variable Integer Linear Programming Feasibility can be solved in O(p2.5p+o(p)L) time, where L is the number of bits in the input.

3 XP Algorithm Parameterized by Cliquewidth

In this section, we design an n2O(cw)-time algorithm parameterized by cliquewidth for the problem of determining whether G has an s-t path P of length k with exactly l neighbors. By solving this for each k and l, Secluded k-Path and Short Secluded Path can also be solved in time n2O(cw).

Theorem 6.

There is an n2O(cw)-time algorithm that, for a graph G of cliquewidth cw, determines whether it contains an s-t path of length k with l neighbors.

Our algorithm is based on dynamic programming on a cliquewidth expression tree of G. It is known that for a graph G with cliquewidth cw(G), a (2cw(G)+11)-expression tree 𝒯 with O(n) nodes can be computed in O(n3) time [25, 24, 17]. For our algorithm, we must distinguish the source s and target t. We achieve this by assigning them two new, unique labels. We can thus assume that we are given an r-expression tree 𝒯 with r2cw(G)+1+1 where s is assigned label r1 and t is assigned label r.

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 Gμ=(Vμ,Eμ) 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 Gμ, denoted by 𝒫μ. Intuitively, each path in 𝒫μ represents a sub-path of a potential solution in Gμ, i.e., an s-t path of length k with l 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 V(𝒫μ) as a shorthand for P𝒫μV(P), the set of all vertices in any path in 𝒫μ. The parameters in our DP state are defined as follows:

  • For each label i{1,,r}:

    • xiμ: the number of vertices in V(𝒫μ) with label i.

    • yiμ: the number of vertices in N(V(𝒫μ))Vμ with label i.

    • ziμ: the number of vertices with label i in Vμ that belong to neither V(𝒫μ) nor its neighborhood.

  • For each pair of labels i,j with 1ijr:

    • pijμ: the number of paths in 𝒫μ having one endpoint with label i and the other with label j.

We call (x1μ,,xrμ) the solution count vector, (y1μ,,yrμ) the neighborhood count vector, (z1μ,,zrμ) the remaining vertex count vector, and (p11μ,,prrμ) the path count vector, respectively. The DP entry DPμ[(x1μ,,xrμ),(y1μ,,yrμ),(z1μ,,zrμ),(p11μ,,prrμ)] is a boolean value. It is true if and only if there exists a set of vertex-disjoint paths 𝒫μ in Gμ that satisfies all of the following conditions:

  1. 1.

    For each label i, the number of vertices in V(𝒫μ) with label i is exactly xiμ, i.e., |V(𝒫μ)|=i=1rxiμ.

  2. 2.

    For each label i, the number of vertices in the neighborhood N(V(𝒫μ))Vμ with label i is exactly yiμ, i.e., |N(V(𝒫μ))|=i=1ryiμ.

  3. 3.

    For each label i, the number of vertices with label i in Vμ that belong to neither V(𝒫μ) nor its neighborhood is exactly ziμ, i.e., |Vμ(V(𝒫μ)N(V(𝒫μ)))|=i=1rziμ.

  4. 4.

    For each pair of labels (i,j), the number of paths in 𝒫μ with endpoints labeled i and j is exactly pijμ.

For convenience, if a set 𝒫μ of paths is empty, |V(𝒫μ)|=0. In this case, its neighborhood is also empty, and this corresponds to the state where xiμ=yiμ=pijμ=0 for all i,j.

From these definitions, 0xiμ,yiμ,ziμ,pijμn for all parameters. Thus, the size of the DP table at each node is bounded by nO(r2). As initialization, we set all entries of the DP tables to false.

The existence of a solution in the original graph G is determined by checking the DP table of the root node, γ. A key observation is that an s-t path of length k with l neighbors exists if and only if there exists a path P whose endpoints are labeled by r1 and r in Gγ satisfying |V(P)|=k,|N(V(P))|=l, and |Vγ(V(P)N(V(P)))|=nkl. Note that s and t have the unique labels r1 and r, respectively. Therefore, an s-t path of length k with l neighbors exists if and only if and only if DPγ[(x1γ,y1γ,z1γ),,(xrγ,yrγ,zrγ),(p11γ,,prrγ)]=true at the root node γ such that:

  • xr1γ=xrγ=1,

  • yr1γ=yrγ=0,

  • zr1γ=zrγ=0,

  • i=1rxiγ=k,

  • i=1ryiγ=l,

  • i=1rziγ=nkl,

  • p(r1)rγ=1, and

  • pijγ=0 for i,j(ij) except i=r1 and j=r.

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 i to j is also based on addition: for each state, the counts associated with label i are consolidated into the counts for label j.

The main challenge lies with the join node, which adds edges between all vertices of label i and all vertices of label j. 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 nO(r2). The running time for a join node is determined by iterating through all possible resulting states. Since the size of the DP table is nO(r2), and we must process each state from the child’s table, the update at a join node can be performed in time nO(r2). As the expression tree has O(n) nodes, the total running time is dominated by the join operations, yielding nO(r2)=n2O(cw(G)). The details of the algorithm are provided in the appendix.

By applying Theorem 6 for each k,l, we can also solve Secluded k-Path and Short Secluded Path.

Corollary 7.

Secluded k-Path and Short Secluded Path can be solved in time n2O(cw).

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 ndO(nd2)nO(1) time. To show this, we first provide a fixed-parameter algorithm for s-t k-Path by neighborhood diversity.

4.1 FPT algorithm for 𝒔-𝒕 𝒌-Path

We give an ILP formula with O(nd2) variables for determining whether G has an s-t path of length k passing through every module.

Let 𝒢 be the quotient graph with respect to a twin partition ={M1,M2,,Mr}, where r is the number of modules in the partition of G. Suppose that Ms={s} and Mt={t} for s,tV(G) are modules in , and 𝒢 is connected.

We define the ILP instance (P) with variables xij,xji (for {Mi,Mj}E(𝒢)), and yi (for i[r]) subject to the following constraints.

  1. 1.

    i=1ryi=k

For every i[r]:

  1. 2.
    1. (a)

      j{l:MlN𝒢(Mi)}xij=j{l:MlN𝒢(Mi)}xji  (if MiMs,Mt)

    2. (b)

      j{l:MlN𝒢(Ms)}xsj=1
      j{l:MlN𝒢(Ms)}xjs=0

    3. (c)

      j{l:MlN𝒢(Mt)}xjt=1
      j{l:MlN𝒢(Mt)}xtj=0

  2. 3.
    1. (a)

      j{l:MlN𝒢(Mi)}xij=yi  (if Mi is an independent set)

    2. (b)

      1j{l:MlN𝒢(Mi)}xijyi  (if Mi is a clique)

For every partition of V(𝒢) into vertex sets A and B:

  1. 4.

    1i<jr:{Mi,Mj}E(𝒢)|{Mi,Mj}A|=1xij+xji1

For every variable xij:

  1. 5.

    xij0

For every variable yi:

  1. 6.

    1yi|Mi|

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 Ms, being consumed at a sink module Mt, and being conserved at all intermediate modules.

The variables xij and xji model the flow moving in either direction between two modules Mi and Mj. They also correspond to the number of arcs from Mi to Mj on a directed path P from s to t. This approach captures the path’s traversal, potentially back and forth, through the graph of modules. The integer variables yi track the number of vertices used within each module Mi that the path visits.

The constraint (1) guarantees that the size of a solution is exactly k. 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 Ms, and exactly one unit of flow enters the sink module Mt. Note that Ms={s} and Mt={t} by assumption.

The constraints (3) govern the relationship between the flow passing through a module and the number of vertices used within it (yi). The constraint (3.a) implies that every incoming edge immediately goes out in an independent set module M. Thus, the number of incoming edges is equal to the number of used vertices in M. The constraint (3.b) implies that P may pass through several vertices and then go out in a clique module M. Thus, the number of incoming edges is at most the number of used vertices in M.

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 s-t path in G with k vertices that includes at least one vertex from each module Mi.

From Lemma 8 and Theorem 5, we obtain the following lemma.

Lemma 9.

Given a twin partition with r modules, the problem of determining whether there is an s-t path of length k passing through every module can be solved in rO(r2)nO(1) time.

4.2 FPT algorithm for Short Secluded Path

Using Lemma 9, we present an FPT algorithm for Secluded k-Path and Short Secluded Path parameterized by neighborhood diversity. A key observation is that if a path visits a module M, 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 M 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 s-t path of length k passing through every guessed module by using Lemma 9.

Theorem 10.

Secluded k-Path parameterized by neighborhood diversity nd(G) can be solved in nd(G)O(nd(G)2)nO(1) time.

Proof.

First, we compute a twin partition for G with nd(G) modules in linear time [20, 23, 26]. We ensure that s and t are in their own singleton modules by splitting the modules containing them. If sM, we replace M with M{s} and add a new module Ms={s}. We do the same for t. This results in a new twin partition ={M1,M2,,Mr} with rnd(G)+2. The algorithm proceeds by guessing which modules contain the vertices of a potential l-secluded s-t path of length at most k. We must always include Ms and Mt in . There are O(2r2)=O(2nd) possible choices for .

Let r=||. 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 |r|>k 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 s-t path P with V(P)MM, its neighborhood N(V(P)) consists of two parts: (1) all vertices in the modules of 𝒩, and (2) all vertices in modules of that are not on the path P. Therefore, N(V(P))=(M𝒩M)((MM)V(P)). The size of the neighborhood is |N(V(P))|=|M𝒩M|+|MM||V(P)|. Since |V(P)|=k, |N(V(P))| is given by |M𝒩M|+|MM|k for a fixed guess (which fixes 𝒩). Thus, if |N(V(P))|>l, we discard such a guess.

Finally, we only have to determine whether there exists a path of length k in the graph G[MM] that visits every module in . By Lemma 9, this can be determined in time rO(r2)nO(1)=ndO(nd2)nO(1). We repeat this for all O(2nd) guesses of . The total runtime is 2ndndO(nd2)nO(1)=ndO(nd2)nO(1).

By applying Theorem 10 to Secluded k-Path for 2kk, Short Secluded Path can also be solved in ndO(nd2)nO(1) time.

Corollary 11.

For a graph G of neighborhood diversity nd, Short Secluded Path can be solved in ndO(nd2)nO(1) time.

5 FPT Algorithm Parameterized by Twin Cover Number

In this section, we design a 2O(tc2)nO(1)-time algorithm for Short Secluded Path and Secluded k-Path parameterized by twin cover number.

Theorem 12.

Secluded k-Path can be solved in 2O(tc(G)2)nO(1) time.

Proof.

For any graph G, a twin cover S of size tc can be computed in O(m+ntc+1.2738tc) time [14]. Let X:=S{s,t} and τ:=|X|(=tc+2).

First, we guess the set of edges from G[X] that are part of the secluded path. The number of edges in G[X] is at most (τ2)τ2. Since a path on τ vertices has at most τ1 edges, we guess subsets of at most τ1 edges as candidates for partial solutions inside of X. The number of guessed subsets is bounded by i=0τ1(τ2i)=τO(τ).

For each guess, we check if the subgraph formed by these edges consists of a collection of disjoint paths, if s and t 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 k. This clearly can be done in polynomial time. If these conditions are not satisfied, we discard the current guess.

Let P1,P2,,Pd be sub-paths within G[X] of a guessed partial solution, where dτ. Let X=i=1dV(Pi) be the set of vertices in these paths.

Next, we construct a full s-t path by ordering these sub-paths and connecting them with cliques from G[VX]. First, we guess the orderings of the sub-paths. If s and t belong to the same sub-path Pi, then this must be the entire path. In this case, we check if d=1, |X|=|V(P1)|=k, and |N(V(P1))|l. If so, P1 is indeed an l-secluded s-t path of length k, and otherwise we safely conclude that the guess is invalid. If s and t are in different sub-paths, we fix the path containing s at the beginning and the one containing t at the end. We then guess the ordering of the remaining d2 paths. Since d2τ, the number of such orderings is (d2)!= τO(τ).

For a fixed ordering of sub-paths, we need to connect them. Since X is a separator and G[VX] is a union of disjoint cliques, vertices in exactly one clique connect two sub-paths in G[X].

Here, we categorize cliques in G[VX] with respect to neighbors in X, and we define the sets of vertices Y1,,Yq where vertices in Yi have the common neighbors in X, that is, N(u)X=N(v)X for u,vYi. Note that q2τ. By the definition of a twin cover, each connected component of G[VX] is a clique and is fully contained in some Yi. We say that a clique C in G[VX] is from Yi if V(C)Yi.

To connect the d1 gaps between the ordered sub-paths, we guess which set Yj provides the connecting clique for each gap. Since there are d1=O(τ) gaps and q=O(2τ) choices for each, the total number of ways to choose the sequence of Yj’s is qd1=2O(τ2).

For each such guess, we verify whether it is valid. If a chosen Yj 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 d1 gaps, the length p of an s-t path constructed is at least pi=1d|V(Pi)|+d1. If p>k, we safely reject it. Furthermore, if the number of times a set Yi is selected is more than |Yi|, then we reject it because we cannot construct an s-t path even by using all the vertices in Yi.

Now, for each gap between two sub-paths, we must select a specific clique from the chosen Yi. Then by the following claim, we can focus on at most r largest cliques in each Yi.

Claim 13.

Suppose that Yi contains r cliques C1,,Cr ordered by non-increasing size (|C1||Cr|). Then if there exists an s-t path P that passes through b cliques from Yi, there exists an s-t path P that passes through the b largest cliques from Yi, C1,,Cb (or all r cliques if br), such that |V(P)|=|V(P)| and |N(V(P))|=|N(V(P))|.

Now we need to decide vertices to take from the selected cliques. Here, we observe that the vertex set V can be partitioned into four parts: (1) the set V(P)X of vertices on P inside X, (2) the set of vertices C𝒞PC in the selected cliques in G[VX], (3) the set N((V(P)X)C𝒞PC) of neighbors of P except for vertices in C𝒞PC, and (4) The set VV(P)N(V(P)) of the other vertices which lie outside both X and N(V(P)) (see Figure 3). Then the following claim holds.

Figure 3: An illustration of a partition of V with respect to a path P in Claim 14.
Claim 14.

Let P be an s-t path and let 𝒞P be the set of cliques in VX that intersect with V(P). The number of neighbors of the path P is given by:

|N(V(P))|=|N((V(P)X)C𝒞PC)|+|C𝒞PC|+|V(P)X||V(P)|. (1)

If we have fixed the sub-paths in X and the cliques connecting them, we observe that the first three terms |N((V(P)X)C𝒞PC)V(P)|, |C𝒞PC|, and |V(P)X| in the right-hand side of Equation 1 are determined. Note that |V(P)X|=|X|=i=1d|V(Pi)|. Since |V(P)|=k, from Claim 14, |N(V(P))| is also determined.

After fixing the sub-paths in X and the Yi’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 Yi have the same neighbors by the definition of a twin cover, if |C𝒞C|=C𝒞|C|k|V(P)X| is satisfied, we can obtain a path of length k (we just need to arbitrarily choose k|V(P)X| 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 X, the orderings of the sub-paths, and the Yi’s for connecting pairs of sub-paths can be done in time τO(τ)nO(1)2O(τ2)nO(1)=2O(τ2)nO(1). After the guesses, we can check whether each guess is valid by verifying whether C𝒞|C|k|V(P)X| in polynomial time. Therefore, the total time is 2O(τ2)nO(1)=2O(tc2)nO(1).

Corollary 15.

Short Secluded Path can be solved in 2O(tc(G)2)nO(1) 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 k=dist(s,t) be the distance between s and t. For i{0,1,,k}, we define the layer Li={vVdist(s,v)=i and dist(v,t)=ki} as the set of vertices whose distance from s is i and from t is ki. These layers L0,,Lk can be computed in linear time by performing a breadth-first search from s and from t, respectively. By definition, L0={s} and Lk={t}. Let L=iLi and R=VL. It is easily seen that every vertex v satisfying dist(s,v)+dist(v,t)=k is contained in L, and any vertex in R satisfies that dist(s,v)+dist(v,t)>k. Thus, every shortest s-t path is contained in G[L]. Then, the following lemmas hold.

Lemma 16.

For any integer i{0,1,,k}, the neighbors of any vertex in Li that are also in L must belong to it’s layer or adjacent layers. Formally:

N(Li)LLi1Li+1

(Here, we define L1=Lk+1=.)

Proof.

For a vertex viLi, let vjLj(Li) be a neighbor of vi. By the triangle inequality, we must have dist(s,vi)dist(s,vj)+dist(vj,vi), which means ij+1. Symmetrically, ji+1. Together, these imply that j satisfies |ij|1.

Lemma 17.

For any vertex rR and any integer i{0,1,,k}, if r has a neighbor in Li, then its set of neighbors in L, denoted by N(r)L, must satisfy one of the following three conditions: (1) N(r)LLi, (2) N(r)LLi1Li, and (3) N(r)LLiLi+1.

From Lemmas 16 and 17, the neighbors of vertices in Li are in Li1LiLi+1R. Moreover, the neighbors in R are also adjacent to only Li1LiLi+1R. This locality is the key to our dynamic programming approach, as it ensures that when extending a path to layer Li+1, the change in the neighborhood of the path only depends on the most recent layers.

Our dynamic programming table, DP, stores values for pairs of adjacent vertices (ui,ui+1) where uiLi and ui+1Li+1. The entry DP[ui,ui+1] is defined as the minimum size of the neighborhood of a shortest s-ui+1 path that uses the edge {ui,ui+1} as its last edge. If no such path exists, or if {ui,ui+1}E, then DP[ui,ui+1]=. The solution to the overall problem is then minuk1Lk1DP[uk1,t].

For i=0 (the base case), we consider paths of length 2 from s to a vertex u1L1. Since dist(s,u1)=1, the edge {s,u1} must exist. The path consists of edge {s,u1}. The size of its neighborhood is |(N(s)N(u1)){s,u1}|. Thus, we initialize DP[s,u1]=|N(s)N(u1)|2.

For 1i<k, the recursive formula for DP[ui,ui+1] is computed as follows:

DP[ui,ui+1]={if {ui,ui+1}E,minui1Li1{DP[ui1,ui]+|N(ui+1)(N(ui1)N(ui))|}otherwise.

Here, |N(ui+1)(N(ui1)N(ui))| represents the number of new neighbors added when extending the path from ui to ui+1. Due to the locality shown by Lemmas 16 and 17, ui+1 never shares neighbors of j=0i2Lj. Thus, these new neighbors are precisely those in N(ui+1) that are not already neighbors of the path ending in {ui1,ui}.

Finally, we analyze the running time. The sets Li can be computed in O(m+n) time. The size of the DP table is O(n2) since the number of layers is at most n. For three vertices u,v,w, |N(u)(N(v)N(w))| can be computed in polynomial time in advance. Thus, each entry DP[ui,ui+1] can be computed in O(n) time from DP[ui1,ui]. Therefore, the total running time is O(n3).

Theorem 18.

Shortest Secluded Path can be solved in O(n3) 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 s and t by a reduction from Multicolored Clique. Here, the shortest path distance between s and t is defined by the minimum weight of an s-t path.

Multicolored Clique  Instance: A graph G=(V1Vk,E) with n vertices where each Vi forms an independent set. Goal: Determine whether G has a clique of size k.

Multicolored Clique is W[1]-hard when parameterized by k even on regular graphs [10].

Theorem 19.

Shortest Secluded Path on edge-weighted graphs is W[1]-hard parameterized by the shortest path distance d between s and t in the input graph.

Proof.

We show the parameterized reduction from Multicolored Clique to Shortest Secluded Path.

Let an r-regular graph G=(V,E) be an instance of Multicolored Clique, where V=V1V2Vk. Then, we construct an equivalent instance G=(V,E,s,t) of Shortest Secluded Path on edge-weighted graphs. We first define V=V{s,t}VEW where VE={veeE} and W={whh[k1]}. Then we connect s to all vertices in V1 and t to all vertices in Vk with edges of weight 1. Moreover, for each h[k1], we connect wh to all vertices in VhVh+1 with edges of weight 1. Finally, for e={u,v}E, we connect ve to u and v with edges of weight k+1. Figure 4 illustrates the constructed graph G.

Figure 4: The reduction from Multicolored Clique to Shortest Secluded Path in Theorem 19. The weight of each thin edge is 1 and the weight of each bold edge is k+1.

Clearly, G can be constructed in polynomial time. By the construction of G, the shortest path distance between s and t is 2k. In the following, we show that there is a clique of size k in G if and only there is a shortest s-t path P of weight 2k satisfying |N(V(P))|rk(k2)+nk in G where V(P) is the set of vertices of P on G.

Let C={v1,v2,,vk} be a clique of size k in G, where viVi. We define an s-t path P=s,v1,w1,v2,w2,,wk1,vk,t of weight 2k. Since all edges in G[VVE] have weights 1, the weight of P is 2k, and thus P is a shortest s-t path in G.

We next show P satisfies |N(V(P))|rk(k2)+nk. We observe that VV(P)N(V(P)) holds. Since |V(P)V|=k, the neighborhood N(V(P)) of P includes nk vertices in VV(P). Furthermore, since G is an r-regular graph, any vertex in V has r neighbors in VE in G. Since C is a clique in G, for 1i<jk, any pair vi,vjC has an edge {vi,vj}. Thus, vi and vj have a common neighbor v{vi,vj}VE. Therefore, P has only rk(k2) neighbors in VE. Consequently, |N(V(P))|=rk(k2)+nk holds.

Conversely, suppose that there is a shortest s-t path P of weight 2k satisfying |N(V(P))|rk(k2)+nk in G. If P contains any vertex in VE, the weight of P is at least 2k+2>2k. Thus, P does not contain any vertex in VE. Hence, by the construction of G, P must pass through w1,,wk1 and exactly one vertex in each V1,,Vk, and VV(P)N(V(P)) holds. Consequently, |N(V(P))VE|=nk and P has at most rk(k2) neighbors in VE. Since every vertex in V(P)V has r neighbors in VE, they must share (k2) vertices in VE. Since |V(P)V|=k, every pair of u,vV(P)V must share v{u,v}VE, which implies that there exists edge {u,v} in G. This means that V(P)V forms a clique of size k, which completes the proof.

Finally, we present an XP algorithm for Shortest Secluded Path that runs in nO(d) time where d is the shortest path distance between s and t in the input graph.

Theorem 20.

Shortest Secluded Path on edge-weighted graphs can be solved in nO(d) time, where d is the shortest path distance between s and t in the input graph.

Proof.

Given an input graph G=(V,E), we first compute the shortest path distance d=dist(s,t) between s and t by Dijkstra’s algorithm [7]. Since the edge weights are nonnegative integers, any shortest s-t path contains at most d edges. Thus, all shortest s-t paths can be enumerated in nO(d) time. Since the neighborhood of a shortest s-t path can be computed in polynomial time, Shortest Secluded Path can be solved in nO(d) 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 s and t.

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 r-expression tree, our XP algorithm parameterized by cliquewidth runs in nO(r2) time. It is worth considering whether this running time can be improved to nO(r). It would also be interesting to design a single-exponential FPT algorithm parameterized by the twin cover number, since our current algorithm runs in 2O(tc(G)2)nO(1) 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 k 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 s-t-path problem. Networks, 75(1):34–63, 2020. doi:10.1002/NET.21904.