Skip to main content
Springer logoLink to Springer
. 2021 Dec 27;84(8):2292–2308. doi: 10.1007/s00453-021-00911-x

Parameterized Complexity of Directed Spanner Problems

Fedor V Fomin 1, Petr A Golovach 1,, William Lochet 1, Pranabendu Misra 2, Saket Saurabh 1,3, Roohani Sharma 2
PMCID: PMC9304079  PMID: 35880198

Abstract

We initiate the parameterized complexity study of minimum t-spanner problems on directed graphs. For a positive integer t, a multiplicative t-spanner of a (directed) graph G is a spanning subgraph H such that the distance between any two vertices in H is at most t times the distance between these vertices in G, that is, H keeps the distances in G up to the distortion (or stretch) factor t. An additive t-spanner is defined as a spanning subgraph that keeps the distances up to the additive distortion parameter t, that is, the distances in H and G differ by at most t. The task of Directed Multiplicative Spanner is, given a directed graph G with m arcs and positive integers t and k, decide whether G has a multiplicative t-spanner with at most m-k arcs. Similarly, Directed Additive Spanner asks whether G has an additive t-spanner with at most m-k arcs. We show that (i) Directed Multiplicative Spanner admits a polynomial kernel of size O(k4t5) and can be solved in randomized (4t)k·nO(1) time, (ii) the weighted variant of Directed Multiplicative Spanner can be solved in k2k·nO(1) time on directed acyclic graphs, (iii) Directed Additive Spanner is W[1]-hard when parameterized by k for every fixed t1 even when the input graphs are restricted to be directed acyclic graphs. The latter claim contrasts with the recent result of Kobayashi from STACS 2020 that the problem for undirected graphs is FPT when parameterized by t and k.

Keywords: Graph spanners, Directed graphs, Parameterized complexity, Kernelization

Introduction

Given a (directed) graph G, a spanner is a spanning subgraph of G that approximately preserves distances between the vertices of G. Graph spanners were formally introduced by Peleg and Schäffer in [16] (see also [17]). Originally, the concept was introduced for constructing network synchronizers [17]. However, graph spanners have a plethora of theoretical and practical applications in various areas like efficient routing and fast computing of shortest paths in networks, distributed computing, robotics, computational geometry and biology. We refer to the recent survey of Ahmed et al. [1] for the introduction to graph spanners and their applications.

We are interested in the classical multiplicative and additive graph spanners in graphs. Let G be a (directed) graph. For two vertices u,vV(G), distG(u,v) denotes the distance between u and v in G, that is, the number of edges (arcs, respectively, for the directed case) of a shortest (uv)-path. Let t be a positive integer. It is said that a spanning subgraph H of G is a multiplicative t-spanner if distH(u,v)t·distG(u,v) for every two vertices u,vV(G), i.e., H approximates distances in G within factor t. A spanning subgraph H of G is called an additive t-spanner if distH(u,v)distG(u,v)+t for every u,vV(G), that is, H approximates the distances in G within the additive parameter t. The standard task in the graph spanner problems is, given an allowed distortion parameter t, find a sparsest t-spanner, i.e., a spanner with the minimum number of edges. We consider the parameterized versions of this task:graphic file with name 453_2021_911_Figa_HTML.jpg

andgraphic file with name 453_2021_911_Figb_HTML.jpg

Informally, the task of these problems is to decide whether we can delete at least k edges (arcs, respectively, for the directed case) in such a way that all the distances in the resulting graph are “t-close” to the original ones.

Previous work. We refer to [1] for the comprehensive survey of the known results and mention here only those that directly concern our work. First, we point that the considered graph spanner problems are computationally hard. It was already shown by Peleg and Schäffer in [16] that deciding whether an undirected graph G has a multiplicative t-spanner with at most edges is NP-complete even for fixed t=2. In fact, the problem is NP-complete for every fixed t2 [2]. Moreover, for every t2, it is NP-hard to approximate the minimum number of edges of a multiplicative t-spanner within the factor clogn for some c>1 [12]. The same complexity lower bounds for directed graphs were also shown by Cai [2] and Kortsarz [12]. Stronger inapproximability bounds were given by Elkin and Peleg [7]. Additive t-spanners for undirected graphs were introduced by Liestman and Shermer in [13, 14]. In particular, they proved in [14], that for every fixed t1, it is NP-complete to decide whether a graph G admits an additive t-spanner with at most edges. It was shown by Chlamtác et al. [4] that for every integer t1 and any constant ε>0, there is no polynomial-time 2log1-εn/t3-approximation for the minimum number of edges of an additive t-spanner unless NPDTIME(2polylog(n)).

The aforementioned hardness results make it natural to consider these spanner problems in the parameterized complexity framework. The investigation of Multiplicative Spanner and Additive Spanner on undirected graphs was initiated by Kobayashi in [10] and [11]. In [10], it was proved that Multiplicative Spanner admits a polynomial kernel of size O(k2t2). For Additive Spanner, it was shown in [11] that the problem can be solved in time 2O((k2+kt)logt)·nO(1), that is, the problem is fixed-parameter tractable (FPT) when parameterized by k and t.

Our results. We initiate the study of Multiplicative Spanner and Additive Spanner on directed graphs and further refer to them as Directed Multiplicative Spanner and Directed Additive Spanner, respectively. We show that Directed Multiplicative Spanner admits a kernel of size O(k4t5). We complement this result by observing that the problem can be solved in (4t)k·nO(1) time by a Monte Carlo algorithm with false negatives. We leave open the question whether the problem is FPT when parameterized by k only. However we show that this is the case when the inputs are restricted to be directed acyclic graphs (DAGs). In fact, we show the more general claim for the weighted variant of the problem called Weighted Directed Multiplicative Spanner, where the input directed graph G is supplied with a weight function ω(·) with positive values defining the lengths of the arcs and the distances are defined with respect to these arc lengths. Clearly, Directed Multiplicative Spanner is the special case of this problem with unit arc lengths. We show that Weighted Directed Multiplicative Spanner can be solved in k2k·nO(1) on DAGs. We also observe that Directed Multiplicative Spanner is NP-complete on DAGs. For additive spanners, we show that the problem becomes much harder on directed graphs by showing that Directed Additive Spanner is W[1]-hard for every fixed t1 even on DAGs.

Organization of the paper. In Section 2, we introduce basic notions used in the paper. In Section 3, we prove that Directed Multiplicative Spanner admits a polynomial kernel and sketch an FPT algorithm. Further in this section, we show that Directed Multiplicative Spanner is NP-complete on DAGs and prove that Weighted Directed Multiplicative Spanner is FPT for the parameterization by k only for this class of directed graphs. In Section 4, we show hardness for Directed Additive Spanner. We conclude in Section 5 by stating some open problems.

Preliminaries

Parameterized Complexity and Kernelization. We refer to the recent books [5, 6, 8] for the detailed introduction. In the Parameterized Complexity theory, the computational complexity is measured as a function of the input size n of a problem and an integer parameter k associated with the input. A parameterized problem is said to be fixed-parameter tractable (or FPT) if it can be solved in time f(k)·nO(1) for some function f(·). A kernelization algorithm for a parameterized problem Π is a polynomial algorithm that maps each instance (Ik) of Π to an instance (I,k) of Π such that

  • (i)

    (Ik) is a yes-instance of Π if and only if (I,k) is a yes-instance of Π, and

  • (ii)

    |I|+k is bounded by f(k) for a computable function f(·).

Respectively, (I,k) is a kernel and f(·) is its size. A kernel is polynomial if f(·) is polynomial. It is common to present a kernelization algorithm as a series of reduction rules. A reduction rule for a parameterized problem is an algorithm that takes an instance of the problem and computes in polynomial time another instance that is more “simple” in a certain way. A reduction rule is safe if the computed instance is equivalent to the input instance.

Graphs. Recall that an undirected graph is a pair G=(V,E), where V is a set of vertices and E is a set of unordered pairs {u,v} of distinct vertices called edges. A directed graph G=(V,A) is a pair, where V is a set of vertices and A is a set of ordered pairs (uv) of distinct vertices called arcs. We say that u and v are incident to (uv). Note we do not allow loops and multiple arcs (that are irrelevant for distances). We use V(G) and E(G) (A(G), respectively) to denote the set of vertices and the set of edges (set of arcs, respectively) of G. For a (directed) graph G and a subset XV(G) of vertices, we write G[X] to denote the subgraph of G induced by X. For a set of vertices S, G-S denotes the (directed) graph obtained by deleting the vertices of S, that is, G-S=G[V(G)\S]; for a vertex v, we write G-v instead of G-{v}. Similarly, for a set of edges (arcs, respectively) S (an edge or arc e, respectively), G-S (G-e, respectively) denotes the graph obtained by the deletion of the elements of S (the deletion of e, respectively). A subgraph H of a (directed) graph G is a spanning subgraph of G if V(H)=V(G). Every directed acyclic graph (DAG) G has a topological ordering of its vertex set, that is there exists π:V(G){1,,|V(G)|} such that if (u,v)A(G) then π(u)<π(v). The notation uv denotes π(u)<π(v) and uv denotes that either π(u)<π(v) or u=v.

We write P=v1vk to denote a path with the vertices v1,,vk and the edges {v1,v2},,{vk-1,vk} (arcs (v1,v2),,(vk-1,vk), respectively); v1 and vk are the end-vertices of P and we say that P is a (v1,vk)-path. A single vertex path is trivial, and for a trivial P=v, P is a (vv)-path. All considered paths are assumed to be simple, that is, v1,,vk are distinct. The length of a path is the number of edges (arcs, respectively) in the path. Also A(P) denotes the arc set of the path P. For a (uv)-path P1 and a (vw)-path P2, we denote by P1P2 the concatenation of P1 and P2. We use similar notation for walks; the difference between and a path and a walk is that, the vertices of a walk W=v1vk are not required to be distinct and a walk may go through the same edges (arcs, respectively) several times. Notice that the concatenation of two paths is a walk but not necessarily a path. For two vertices u,vV(G), distG(u,v) denotes the distance between u and v in G, that is, the length of a shortest (uv)-path; we assume that distG(u,v)=+ if there is no (uv)-path in G. Clearly, distG(u,v)=distG(v,u) for undirected graphs but this not always the case for directed graphs.

Let t be a positive integer. It is said that a spanning subgraph H of G is a multiplicative t-spanner if distH(u,v)t·distG(u,v) for every u,vV(G). A spanning subgraph H of G is called an additive t-spanner if distH(u,v)distG(u,v)+t for every u,vV(G).

We also consider the weighted variant of spanners for directed graph. Let G be an arc wighted directed graph, that is, we a given a weight (or length) function ω:A(G)R+ with positive values; we say that ω(e) is the length of an arc e. The length of a weighted path P=v1vk is i=2k=ω(vi-1,vi); the length of a trivial path is zero. Then the weighted distance distGω(u,v) is the length of a shortest path with respect to the arc lengths. For real t1 and a weighted directed graph G, it is said that a spanning subgraph H a weighted multiplicative t-spanner if distHω(u,v)t·distGω(u,v) for every u,vV(G); note that the stretch factor t is not required to be an integer.

Directed Multiplicative t-spanners

In this section, we consider Directed Multiplicative Spanner. We show that the problem admits a polynomial kernel and then complement this result by obtaining an FPT algorithm. Further, we consider multiplicative spanners on DAGs. We prove that Directed Multiplicative Spanner is NP-complete on this class of directed graphs and show that Weighted Directed Multiplicative Spanner is FPT when parameterized by k only. These results are based on locality of multiplicative spanners in the sense of the following observation made by Peleg and Schäffer [16].

Observation 1

([16]). Let t be a positive integer (or t>1 be a real for the weighted case). A spanning subgraph H of a directed graph G is a (weighted) multiplicative t-spanner if and only if for every arc (u,v)A(G), there is a (uv)-path in H of length at most t (t times the length of (uv) in the weighted case).

Let t be a positive integer (or real for the weighted spanners) and let G be a directed graph. For an arc a=(u,v) of G, we say that a (uv)-path P is a t-detour for a if the length of P is at most t (t times the length of a in the weighted case) and P does not contain a. By Observation 1, to solve Directed Multiplicative Spanner for (Gtk), it is necessary and sufficient to identify k arcs that have t-detours that do not contain selected arcs. Then H can be constructed by deleting these arcs. Notice that this observation holds for both unweighted and weighted spanners. However, for the weighted case, the number of arcs in a t-detour may be arbitrary and depends on the length of a.

Polynomial Kernel for Directed Multiplicative Spanner

In this subsection, we show that Directed Multiplicative Spanner admits a polynomial kernel.

Theorem 1

Directed Multiplicative Spanner has a kernel of size O(k4t5).

Proof

Let (Gtk) be an instance of Directed Multiplicative Spanner. Clearly, if k=0, then (Gtk) is a yes-instance, and our algorithm returns a trivial yes-instance in this case. We assume from now that k>0.

We say that aA(G) is t-good if G has a t-detour for a. Let S be the set of t-good arcs. Clearly, S can be constructed in polynomial time by making use of Dijkstra’s algorithm. We follow the idea of Kobayashi [10] for constructing a polynomial kernel for undirected case and show that if S is sufficiently big, then (Gtk) is a yes-instance of Directed Multiplicative Spanner.

Claim 1

If |S|12k(t+1)((k-1)t+2), then (Gtk) is a yes-instance of Directed Multiplicative Spanner.

Proof of Claim 1

Let |S|12k(t+1)((k-1)t+2). For every aS, let Pa be a t-detour for a.

Let S0=. For i=1,,k, we iteratively construct sets of arcs S1,,Sk such that

S0S1SkS

and sets of arcs Ri such that RiSi\Si-1 and |Ri|=(k-i)t+1 for i{1,,k} using the following procedure. For i=1,,k,

  • select an arbitrary set Ri of size (k-i)t+1 in S\Si-1,

  • set Si=Si-1aRi((A(Pa)S){a}).

We show by induction, that the sets S1,,Sk and R1,,Rk exist. Since |S\S0|=|S|(k-1)t+1, we conclude that R1 of size (k-1)t+1 can be selected. Assume that the sets Sj and Rj have been constructed for 0j<ik. Observe that because |aRj((A(Pa)S){a})|(t+1)|Rj|,

|Sj\Sj-1||Rj|(t+1)=((k-j)t+1)(t+1)

for 1j<i. Therefore,

|Si-1|j=1i-1(((k-j)t+1)(t+1)). 1

Notice that

12k(t+1)((k-1)t+2)=j=1k(((k-j)t+1)(t+1)). 2

Then by (1) and (2),

|S\Si-1|j=ik(((k-j)t+1)(t+1))(k-i)t+1.

This means that Ri can be selected and we can construct Si.

Now we select arcs aiRi for i=k,k-1,,1. Since |Rk|=1, the choice of ak is unique. Assume that ak,,ai+1 have been selected for 1<i+1k. Then we select an arbitrary

aiRi\j=i+1kA(Paj).

Because |j=i+1kA(Paj)|(k-i)t and |Ri|=(k-i)t+1, ai exists.

Let i{1,,k}. By the choice of ai, we have that aiA(Paj) for i<jk. From the other side, aiA(Pj) for 1j<i, because aiRi and Ri does not contain the arcs of Pa for aRj for 1j<i by the construction of the sets R1,,Rk. We obtain that the t-detours Pai for i{1,,k} do not contain any aj for j{1,,k}. By Observation 1, H=G-{a1,,ak} is a multiplicative t-spanner. Therefore, (Gtk) is a yes-instance of Directed Multiplicative Spanner.

By Claim 1, we can apply the next rule:

Reduction Rule 1

If |S|12k(t+1)((k-1)t+2), then return a trivial yes-instance of Directed Multiplicative Spanner and stop.

From now, we assume that |S|<12k(t+1)((k-1)t+2).

The analog of Reduction Rule 1 is a main step of the kernelization algorithm of Kobayashi [10] for the undirected case, because it almost immediately allows to upper bound the total number of edges of the graph. However, the directed case is more complicated, since the arcs of t-detours for aS may be outside S contrary to the undirected case, where all the edges of t-detours are in cycles of length at most t+1 and, therefore, have t-detours themselves. We use the following procedure to mark the crucial arcs of potential detours.

Marking Procedure Let G=G-S.

  • (i)

    For every (u,v)S, find a shortest (uv)-path P in G and if the length of P is at most t, then mark the arcs of P.

  • (ii)
    For every ordered pair of two distinct arcs (u1,v1),(u2,v2)S,
    1. find a shortest (u1,u2)-path P1 in G and if the length of P1 is at most t, then mark the arcs of P1,
    2. find a shortest (v2,v1)-path P2 in G and if the length of P2 is at most t, then mark the arcs of P2,
    3. find a shortest (v1,u2)-path P3 in G and if the length of P3 is at most t, then mark the arcs of P3.

Observe that marking can be done in polynomial time by Dijkstra’s algorithm. Denote by L the set of marked arcs. Our final rule constructs the output instance.

Reduction Rule 2

Consider the graph H=(V(G),SL). Delete the isolated vertices of H, and for the obtained G, output (G,t,k).

We argue that the rule is safe.

Claim 2

(Gtk) is a yes-instance of Directed Multiplicative Spanner if and only if (G,t,k) is a yes-instance.

Proof of Claim 2

Suppose that (Gtk) is a yes-instance of Directed Multiplicative Spanner. Then, by Observation 1, there are k distinct arcs a1,,akS with their t-detours P1,,Pk, respectively, such that aij=1kA(Pj). Notice that a1,,akA(G). Consider i{1,,k} and let ai=(u,v).

Suppose that Pi does not contain arcs from S. Then Pi is a (uv)-path in G=G-S. By the first step of Marking Procedure, there is a t-detour Pi for ai whose arcs are in G and are marked. Then Pi is a t-detour for ai in G and ajA(Pi) for j{1,,k}.

Assume that Pi contains some arcs from S. Let e1,,es be these arcs (in the path order with respect to Pi starting from u). Note that e1,,esA(G) and they are distinct from a1,,ak. Let ej=(xj,yj) for j{1,,s}. Then Pi can be written as the concatenation of the paths Pi=Q1x1y1Q2xsysQs+1, where Q1 is the (u,x1)-subpath of Pi, Qj is the (yj-1,xj)-subpath of Pi for j{2,,s}, and Qs+1 is the (ys,v)-subpath of Pi; note that some of the paths Q1,,Qs+1 may be trivial, i.e., contain a single vertex. We allow trivial paths to make the notation for Pi uniform. Let j{1,,s+1}. If Qj is trivial, then Qj=Qj is a path in G, because the vertices incident to the arcs of S are vertices of G. Suppose that Qj is not trivial. If j=1, then by step (ii)(a) of Marking Procedure, there is a (u,x1)-path Q1, whose arcs are in G and are marked, and the length of Q1 is at most the length of Q1. For j=s+1, we have, by step (ii)(b), that there is a (ys,v)-path Qs+1, whose arcs are in G and are marked, and the length of Qs+1 is at most the length of Qs+1. Suppose that 2js. Then by step (ii)(c), there is a (yj-1,xj)-path Qj, whose arcs are in G and are marked, and the length of Qj is at most the length of Qj. Consider the (uv)-walk Wi=Q1x1y1Q2xsysQs+1. We have that Wi is a (uv)-walk of length at most t in G such that ajA(Wi) for j{1,,k}. This implies that G has a t-detour Pi in G such that ajA(Pi) for j{1,,k}.

We obtain that for every i{1,,k}, aiA(G) has a t-detour Pi such that a1,,akA(Pi). By Observation 1, we conclude that G-{a1,,ak} is a multiplicative spanner for G, that is, (G,t,k) is a yes-instance of Directed Multiplicative Spanner.

For the opposite direction, assume that (G,t,k) is a yes-instance of Directed Multiplicative Spanner. By Observation 1, there are k distinct arcs a1,,akA(G) with their t-detours P1,,Pk, respectively, such that aij=1kA(Pj). Since G is a subgraph of G, a1,,ak have the same t-detours in G. By Observation 1, (Gtk) is a yes-instance.

To upper bound the size of G, observe that Marking Procedure marks at most t arcs for each aS in step (i), that is, at most |S|t arcs are marked in this step. In step (ii), we mark at most 3t arcs for each ordered pair of arcs of S. Hence, at most 3|S|(|S|-1)t arcs are marked in total in the second step. Since |S|<12k(t+1)((k-1)t+2), we have that G has O(k4t5) arcs. Because G has no isolated vertices, the number of vertices is O(k4t5).

Since each of the reduction rules and Marking Procedure can be applied in polynomial time, we conclude that the total running time of our kernelization algorithm is polynomial.

FPT Algorithm for Directed Multiplicative Spanner

Combining Theorem 1 with the brute-force procedure that guesses k arcs of G and verifies whether the deletion of these arcs gives a multiplicative t-spanner, we obtain the straightforward 2O(klog(kt))+nO(1) algorithm for Directed Multiplicative Spanner. If we use the intermediate steps of the kernelization algorithm, then the running time may be improved (upto some constants in the exponent) to (kt)2k·nO(1). Namely, we can construct the set S of t-good arcs and execute Reduction Rule 1 of the kernelization algorithm. Then we either solve the problem or obtain an instance, where the set S has size at most 12k(t+1)((k-1)t+2)-1k2t2. Then for every RS of size k, we check whether G-R is a multiplicative t-spanner by computing the distances between every pair of vertices. However, we can slightly improve the parameter dependence by making use of the random separation technique proposed by Cai, Chan, and Chan in [3] (we refer to [5, Chapter 5] for the detailed introduction to the technique). In this subsection, we briefly sketch a Monte Carlo algorithm with false negatives for Directed Multiplicative Spanner.

Theorem 2

Directed Multiplicative Spanner can be solved in time (4t)k·nO(1) by a Monte Carlo algorithm with false negatives.

Proof

Let (Gtk) be an instance of Directed Multiplicative Spanner. If k=0 or t=1, then the problem is trivial: if k=0, then (Gtk) is a yes-instance, and if k>0 and t=1, then (Gtk) is a no-instance. From now we assume that k1 and t2.

By Observation 1, (Gtk) is a yes-instance of Directed Multiplicative Spanner for (Gtk) if and only if there are k arcs that have t-detours avoiding these arcs. We use random separation to distinguish the arcs that have t-detours and the arcs of the detours. We randomly color the arcs of G by two colors red and blue. An arc is colored red with probability 1t and is colored blue with probability t-1t. Then we try to find k red arcs that have t-detours composed by blue arcs. Let R be the set of arcs colored red and let B the set of blue arcs. For (u,v)R, it can be checked in polynomial time whether (uv) has a t-detour with blue arcs by finding the distance between u and v in GB=(V(G),B). Then we greedily construct the set S of all red arcs with blue t-detours. If |S|k, then we conclude that (Gtk) is a yes-instance by Observation 1.

Suppose that (Gtk) is a yes-instance of Directed Multiplicative Spanner. Then by Observation 1, there are k distinct arcs a1,,ak and their t-detours P1,,Pk, respectively, such that a1,,akL=i=1kA(Pi). Notice that |L|tk. Then the probability that the considered random coloring colors the arcs a1,,ak red is t-k and the probability that the arcs of L are colored blue is at least (t-1t)tk. We have that

(t-1t)t=(1-1t)t14.

Therefore, the probability that the arcs a1,,ak are red and their t-detours are blue is at least (4t)-k. Respectively, the probability that the random coloring fails to color the arcs a1,,ak red and their t-detours blue is at most 1-1(4t)k. This implies that if we iterate our algorithm for (4t)k colorings, then we either find a solution and stop or we conclude that (Gtk) is a no-instance with the mistake probability at most (1-1(4t)k)(4t)ke-1. This gives us a Monte Carlo algorithm with running time (4t)k·nO(1).

The same approach can be used for undirected graphs and it can be shown that Multiplicative Spanner can be solved by a Monte Carlo algorithm with false negatives in (4t)k·nO(1) time. This improves the running time given in [10] at the cost of randomization.

The algorithm from Theorem 2 can be derandomized by using universal sets [15] instead of random colorings (see also  [5, Chapter 5]). However, this leads to an algorithm with worst running time that is not better than (kt)2k·nO(1).

Directed Multiplicative Spanners on Acyclic Graphs

In this section, we show that Weighted Directed Multiplicative Spanner is FPT on DAGs when parameterized by k only. Formally, the problem is stated as follows: graphic file with name 453_2021_911_Figc_HTML.jpg

Multiplicative Spanner is know to be NP-complete for restricted graph families. However, we are not aware of hardness results for the directed variants of the problem on DAGs. Hence, we begin with showing that Directed Multiplicative Spanner and Weighted Directed Multiplicative Spanner are NP-hard on DAGs. As we are mainly interested in Parameterized Complexity, we do not try to push down the value of t for which Directed Multiplicative Spanner becomes NP-hard.

Theorem 3

Directed Multiplicative Spanner is NP-complete for every t7 on DAGs. Moreover, Weighted Directed Multiplicative Spanner is NP-hard for every t>1 when the input is restricted to DAGs.

Proof

We show the theorem for Directed Multiplicative Spanner and then explain how to modify the reduction for Weighted Directed Multiplicative Spanner. We reduce from the Independent Set problem that is well-known to be NP-complete [9]. Given a graph G and a positive integer k, the problem asks whether G has an independent set of size at least k.

Let (Gk) be an instance of Independent Set and let t7 be an integer. Denote by v1,,vn the vertices of G and denote m=|E(G)|.

  • For every i{1,,n}, construct two vertices xi,yi, an arc (xi,yi), and then construct a directed (xi,yi)-path Ri of length t-5.

  • For every {vi,vj}E(G) such that i<j, do the following:
    • construct a vertex zij and arcs (yi,zij) and (zij,xj),
    • construct n+1 vertices uij(0),,uij(n) and n+1 vertices wij(0),,wij(n),
    • for every h{1,,n}, construct arcs (uij(h),wij(h)), (uij(h),xi), and (yj,wij(h)), and set Aij={(uij(0),wij(0)),,(uij(n),wij(n))}.

Denote the obtained directed graph by D (see Figure 1). Clearly, D is a DAG. To complete the reduction, we set k=m(n+1)+k. Let also A=(vi,vj)E(G),i<jAij.

Fig. 1.

Fig. 1

Construction of D for t=7

We claim that (Gk) is a yes-instance of Independent Set if and only if (D,t,k) is a yes-instance of Directed Multiplicative Spanner.

For the forward direction, assume that X={vi1,,vik} is an independent set of G. Consider

S={(xij,yij)1jk}A.

Observe that |S|=k+|A|=k+m(n+1)=k. We show that H=D-S is a multiplicative t-spanner. For this, observe that every arc of S has a t-detour with its arcs in H. For every j{1,,k}, the path Rij is a t-detour for (xij,yij). Consider an arbitrary arc aA. Then a=(uij(h),wij(h)) for some indices i<j such that {vi,vj}E(G) and some h{0,,n}. Because X is an independent set, either viX or vjX. In the first case, uij(h)xiyizijxjRjyjwij(h) has length t and, therefore, is a t-detour for a. Symmetrically, uij(h)xiRiyizijxjyjwij(h) is a t-detour if vjX. We conclude that every arc of S has a t-detour in H. Hence, H is a multiplicative t-spanner by Observation 1.

For the opposite direction, assume that H is a multiplicative t-spanner of D with at most |A(D)|-k arcs. Let S=A(D)\A(H). Recall that every arc of S should have a t-detour in D by Observation 1. Then our construction implies that S{(xi,yi)1in}A, because only these arcs have detours. Let S=S\A. Because |S|k, |S|k. Let S={(xi1,yi1),,(xis,yis)} for some sk. We show that X={vi1,,vis} is an independent set of G. For the sake of contradiction, assume that vi and vj are adjacent in G for some vi,vjX. Consider an arc (uij(h),wij(h))Aij for arbitrary h{0,,n}. Notice that every (uij(h),wij(h))-path P in D avoiding (uij(h),wij(h)) contains the arcs (uij(h),xi) and (yj,wij(h)), the paths Ri and Rj, and some (yi,xj)-path Q. Clearly, the length of Q is at least 2. Then the length of P is at least 2+2(t-5)+2=t+(t-6)>t, because t7. This implies that (uij(h),wij(h))S. Then AijS= and |AS|(m-1)(n+1). Since sn, we obtain that |S|=|SA|+|S|(m-1)(n+1)+n<m(n+1)k; a contradiction. This proves that X is an independent set of G and concludes the proof of the theorem for Directed Multiplicative Spanner.

For the second claim, we modify the above reduction. Let (Gk) be an instance of Independent Set and let t>1. We construct the instance (D,ω,t,k) of Weighted Directed Multiplicative Spanner as follows. First, we construct D for t=7 and define k exactly in the same way as above. Then we define the weight function ω(·):

ω(a)=1+5/t,ifaA,t/2,ifaA(Ri)for somei{1,,n},1,otherwise.

Then by the essentially the same arguments as above, one can show that (Gk) is a yes-instance of Independent Set if and only if (D,ω,t,k) is a yes-instance of Weighted Directed Multiplicative Spanner.

Now we show the main claim of the subsection that Weighted Directed Multiplicative Spanner is FPT on DAGs when parameterized by k only.

Theorem 4

Weighted Directed Multiplicative Spanner can be solved in k2k·nO(1) time on DAGs.

Proof

Let (G,ω,t,k) be an instance of Weighted Directed Multiplicative Spanner. Consider the set S of arcs of G having t-detours. For every aS, denote by Pa an arbitrary t-detour for a.

Let a1,a2S be distinct arcs, and let a1=(u1,v1) and a2=(u2,v2). Assume that G has a path P such that a1,a2A(P). We claim that a2A(Pa1) and a1A(Pa2). To show this, assume that a1 occurs in P before a2. Then u1v1u2v2 with respect to an arbitrary topological ordering of the vertices of D. Suppose that a2A(Pa1). Then Pa1 has the (v2,v1)-subpath Q. However, this contradict that v1v2. Symmetrically, if a1A(Pa2), then Pa2 has the (u2,u1)-subpath contradicting that u1u2. This proves the claim.

Using the above claim, we now show that if |S|>k(k-1), then (G,ω,t,k) is a yes-instance. If there exists an arc aS such that the set S=A(Pa)S contains at least k arcs, then G-S is a multiplicative t-spanner by Observation 1. Indeed, because the arcs of S are on the same path Pa, the detours Pe for eS do not contain any arc of S from the previous claim. In the other case, |A(Pa)S|k-1 for every aS. Clearly, |(A(Pa){a})S|k for every aS. Then because |S|>k(k-1), we can greedily select k distinct arcs a1,,akS such that the sets (A(Pai){ai})S for i{1,,k} are disjoint. We choose a1S arbitrarily. Let 2ik and assume that a1,,ai-1 are selected. Because |S|>k(k-1) and |(A(Paj){aj})S|k for every j{1,,i-1}, we have that |S\j=1i-1(A(Paj){aj})|>k(k-1)-k(i-1)0. Then we arbitrary choose aiS\j=1i-1(A(Paj){aj}). This way we construct a1,,ak. Then we conclude that G-{a1,,ak} is a multiplicative t-spanner from Observation 1.

This leads to the following algorithm for Weighted Directed Multiplicative Spanner. First, we construct S. Clearly, it can be done in polynomial time by Dijkstra’s algorithm. If |S|>k(k-1), then we return the answer yes. Otherwise, we consider all subsets RS of size k, and for each R, we check whether G-R is a multiplicative t-spanner. This can be done by making use of Observation 1 and the Dijkstra’s algorithm. The algorithm returns yes if G-R is a multiplicative t-spanner. We return no if we fail to find a spanner this way. Since there are at most k(k-1)k sets R, the algorithm runs in k2k·nO(1) time. This concludes the proof.

Note that unlike Directed Multiplicative Spanner, the arguments of Theorem 4 do not yield a kernel because even though the weight of t-detours of the arcs of S is bounded, their lengths could be very long because the weights are real numbers.

Directed Additive t-spanners

In this section, we consider Directed Additive Spanner and show that the problem is hard on DAGs for every t1.

Theorem 5

Directed Additive Spanner is W[1]-hard on DAGs when parameterized by k for every t1.

Proof

We reduce from the Independent Set problem. Recall that, given a graph G and a positive integer k, the problem asks whether G has an independent set of size at least k. Independent Set parameterized k is well-known to be one of the basic W[1]-complete problems (see [5, 6]).

Let (Gk) be an instance of Independent Set and let t be a positive integer. Denote by v1,,vn the vertices of G.

  • For every i{1,,n}, construct two vertices xi,yi, an arc (xi,yi), and then construct a directed (xi,yi)-path Ri of length t+1.

  • For every i,j{1,,n} such that i<j, do the following:
    • if {vi,vj}E(G), then construct a directed (yi,xj)-path Pij of length t+3,
    • if {vi,vj}E(G), then construct a directed (xi,yj)-path Qij of length t+3.

Denote the obtained directed graph by D (see Figure 2). It is straightforward to verify that D is a DAG. We show that (Gk) is a yes-instance of Independent Set if and only if (Dtk) is a yes-instance of Directed Additive Spanner.

Fig. 2.

Fig. 2

Construction of D for t=1

Suppose that I={vi1,,vik} is an independent set of size k in G. Let S={(xi1,yi1),,(xik,yik)}. We show that D=D-S is an additive t-spanner for D.

We first claim that for every two vertices u and w of D, each shortest (uw)-path in D contains at most one arc of S. The proof is by contradiction. Assume that there are u,wV(D) and a shortest (uw)-path P such that P contains at least two arcs of S. Let (xi,yi) and (xj,yj) be such arcs and let i<j. By the construction, (xi,yi) occurs before (xj,yj) in P. Since the arcs of S correspond to vertices of the independent set I, vi and vj are not adjacent in G. Therefore, D contains the (xi,yj)-path Qij of length t+3. Since P is a shortest path containing (xi,yi) and (xj,yj), the (yi,xj)-subpath of P should have length at most t+1. However, by the construction, the distance between yi and xj is at least t+3; a contradiction proving the claim.

Now let u and w be two vertices of D. Let P be a shortest (uw)-path in D. If P is a path in D, then distD(u,w)=distD(u,w). Suppose that P is not a path in D. Then P contains a unique arc (xi,yi)S by the proved claim. Let P1 be the (u,xi)-subpath of P and let P2 be the (yi,w)-subpath. Let P=P1RiP2. Observe that P is a path in D. Since the length of P is the length of P plus the length of Ri, that is, t+1, distD(u,w)distD(u,w)+t. This implies that D is an additive t-spanner of D.

Now we assume that (Dtk) is a yes-instance of Directed Additive Spanner. Then there is a set of k arcs SA(D) such that D=D-S is an additive t-spanner. Observe that if (u,v)S, then D has an (uv)-path P that does not use the arc (uv). Otherwise, distD(u,v)=+ and distD(u,v)>distD(u,v)+t. Therefore, S{(x1,y1),,(xn,yn)}. Let S={(xi1,yi1),,(xik,yik)}. We claim that I={vi1,,vik} is an independent set of G. Assume, for the sake of contradiction, that this is not the case and there are vi,vjI such that vi and vj are adjacent in G. Let i<j. Consider the vertices xi and yj of D. Since {vi,vj}E(G), P=xiyiPijxjyj is an (xi,yj)-path of length t+5, that is, distD(xi,yj)t+5. The path P=RiPijRj has length 3t+5 and is a path in D. Any other (xi,yj)-path in D uses at least two paths of length t+3: one of the paths Pii and Qii for some i{1,,n} such that ij, and one of the paths Pjj and Qjj for some j{1,,n} such that ji. This means that distD(xi,yj)2(t+3)>(t+5)+tdistD(xi,yj)+t contradicting that D is an additive t-spanner. We conclude that I is an independent set of G and, therefore, (Gk) is a yes-instance of Independent Set.

Conclusion

We proved that Directed Multiplicative Spanner admits a kernel of size O(k4t5) and can be solved in (4t)k·nO(1) randomized time. We also demonstrated that (Weighted) Directed Multiplicative Spanner is NP-complete on DAGs and can be solved in k2k·nO(1) on this class of directed graphs. This leads to the question whether Multiplicative Spanner is FPT on general graphs when parameterized by k only for both undirected and directed cases. Also, is the weighted version of Multiplicative Spanner FPT when parameterized by k and t on general graphs? Again, this question is open for both undirected and directed graphs.

Further we proved that Directed Additive Spanner is W[1]-hard for every fixed t1 even if the input graphs are restricted to DAGs. This result leads to the question whether Directed Additive Spanner is tractable on some special classes of directed graphs, like planar directed graphs. We believe that this problem may be interesting even if the distortion parameter t is assumed to be a constant.

Another possible direction of research is considering different types of directed graph spanners. For example, what can be said about the roundtrips spanners introduced by Roditty, Thorup, and Zwick [18]? A spanning subgraph H of a directed graph G is a multiplicative t-roundtrip-spanner if for every two vertices u and v, distH(u,v)+distH(v,u)t(distG(u,v)+distG(v,u)), that is, H approximates the sum of the distances between any two vertices in both directions. Is the analog of Directed Multiplicative Spanner for roundtrip spanners FPT? Notice that we cannot use Observation 1 that is crucial for our results for the new problem. Consider, for example, the directed graph G constructed as follows: construct two vertices u and v and an arc (uv), and then add a (uv)-path P1 and a (vu)-path P2 of arbitrary length 2 that are internally vertex disjoint. Then it is easy to see that H=G-(u,v) is a 2-roundtrip spanner for G. However, H has no short detour for (uv). It is also possible to define additive t-roundtrip-spanners and consider the analog of Directed Additive Spanner. We conjecture that this problem is at least as hard as Directed Additive Spanner.

Acknowledgements

The research received funding from European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant no. 819416), Swarnajayanti Fellowship grant DST/SJF/MSA-01/2017-18, and the Research Council of Norway via the project BWCA (grant no. 314528).

Funding

Open access funding provided by University of Bergen (incl Haukeland University Hospital).

Footnotes

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Contributor Information

Fedor V. Fomin, Email: Fedor.Fomin@uib.no

Petr A. Golovach, Email: Petr.Golovach@uib.no

Pranabendu Misra, Email: pmisra@mpi-inf.mpg.de.

Saket Saurabh, Email: saket@imsc.res.in.

Roohani Sharma, Email: rsharma@mpi-inf.mpg.de.

References

  • 1.Ahmed AR, Bodwin G, Sahneh FD, Hamm K, Jebelli MJL, Kobourov SG, Spence R. Graph spanners: A tutorial review. Comput. Sci. Rev. 2020;37:100–252. doi: 10.1016/j.cosrev.2020.100253. [DOI] [Google Scholar]
  • 2.Cai L. NP-completeness of minimum spanner problems. Discret. Appl. Math. 1994;48(2):187–194. doi: 10.1016/0166-218X(94)90073-6. [DOI] [Google Scholar]
  • 3.Cai, L., Chan, S.M., Chan, S.O.: Random separation: A new method for solving fixed-cardinality optimization problems. In: Parameterized and Exact Computation, Second International Workshop, IWPEC 2006, Zürich, Switzerland, September 13-15, 2006, Proceedings. Lecture Notes in Computer Science, vol. 4169, pp. 239–250. Springer, Heidelberg (2006). 10.1007/11847250_22
  • 4.Chlamtác, E., Dinitz, M., Kortsarz, G., Laekhanukit, B.: Approximating spanners and directed steiner forest: Upper and lower bounds. In: Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19, pp. 534–553. SIAM (2017). 10.1137/1.9781611974782.34
  • 5.Cygan, M., Fomin, F.V., Kowalik, L., Lokshtanov, D., Marx, D., Pilipczuk, M., Pilipczuk, M., Saurabh, S.: Parameterized Algorithms. Springer (2015). 10.1007/978-3-319-21275-3
  • 6.Downey RG, Fellows MR. Fundamentals of parameterized complexity. Texts in computer science. Heidelberg: Springer; 2013. [Google Scholar]
  • 7.Elkin M, Peleg D. The hardness of approximating spanner problems. Theory Comput. Syst. 2007;41(4):691–729. doi: 10.1007/s00224-006-1266-2. [DOI] [Google Scholar]
  • 8.Fomin FV, Lokshtanov D, Saurabh S, Zehavi M. Kernelization: Theory of parameterized preprocessing. Cambridge: Cambridge University Press; 2019. p. 515. [Google Scholar]
  • 9.Garey MR, Johnson DS. Computers and intractability: A guide to the theory of NP-completeness. United States: W. H. Freeman & Co.; 1979. [Google Scholar]
  • 10.Kobayashi Y. NP-hardness and fixed-parameter tractability of the minimum spanner problem. Theor. Comput. Sci. 2018;746:88–97. doi: 10.1016/j.tcs.2018.06.031. [DOI] [Google Scholar]
  • 11.Kobayashi, Y.: An FPT algorithm for minimum additive spanner problem. In: Paul, C., Bläser, M. (eds.) 37th International Symposium on Theoretical Aspects of Computer Science, STACS 2020, March 10-13, 2020, Montpellier, France. LIPIcs, vol. 154, pp. 11–11116. Schloss Dagstuhl - Leibniz-Zentrum für Informatik (2020). 10.4230/LIPIcs.STACS.2020.11
  • 12.Kortsarz G. On the hardness of approximating spanners. Algorithmica. 2001;30(3):432–450. doi: 10.1007/s00453-001-0021-y. [DOI] [Google Scholar]
  • 13.Liestman AL, Shermer TC. Additive spanners for hypercubes. Parallel Process. Lett. 1991;1:35–42. doi: 10.1142/S0129626491000197. [DOI] [Google Scholar]
  • 14.Liestman AL, Shermer TC. Additive graph spanners. Networks. 1993;23(4):343–363. doi: 10.1002/net.3230230417. [DOI] [Google Scholar]
  • 15.Naor, M., Schulman, L.J., Srinivasan, A.: Splitters and near-optimal derandomization. In: 36th Annual Symposium on Foundations of Computer Science, Milwaukee, Wisconsin, USA, 23-25 October 1995, pp. 182–191. IEEE Computer Society (1995). 10.1109/SFCS.1995.492475
  • 16.Peleg D, Schäffer AA. Graph spanners. J. Graph Theor. 1989;13(1):99–116. doi: 10.1002/jgt.3190130114. [DOI] [Google Scholar]
  • 17.Peleg D, Ullman JD. An optimal synchronizer for the hypercube. SIAM J. Comput. 1989;18(4):740–747. doi: 10.1137/0218050. [DOI] [Google Scholar]
  • 18.Roditty L, Thorup M, Zwick U. Roundtrip spanners and roundtrip routing in directed graphs. ACM Trans. Algorithms. 2008;4(3):29–12917. doi: 10.1145/1367064.1367069. [DOI] [Google Scholar]

Articles from Algorithmica are provided here courtesy of Springer

RESOURCES