New algorithms for Steiner tree reoptimization

Reoptimization is a setting in which we are given an (near) optimal solution of a problem instance and a local modiﬁcation that slightly changes the instance. The main goal is that of ﬁnding an (near) optimal solution of the modiﬁed instance. We investigate one of the most studied scenarios in reoptimization known as Steiner tree reoptimization . Steiner tree reoptimization is a collection of strongly NP -hard optimization problems that are deﬁned on top of the classical Steiner tree problem and for which several constant-factor approximation algorithms have been designed in the last decade. In this paper we improve upon all these results by developing a novel technique that allows us to design polynomial-time approximation schemes . Remarkably, prior to this paper, no approximation algorithm better than recomputing a solution from scratch was known for the elusive scenario in which the cost of a single edge decreases. Our results are best possible since none of the problems addressed in this paper admits a fully polynomial-time approximation scheme, unless P = NP .


Introduction
Reoptimization is a setting in which we are given an instance I of an optimization problem together with an (near) optimal solution S for I and a local modification that, once applied to I, generates a new instance I which slightly differs from I. The main goal is that of finding an (near) optimal solution of I . Since reoptimization problems defined on top of NP-hard problems are usually NP-hard, the idea beyond reoptimization is to compute a good approximate solution of I by exploiting the structural properties of S. This approach leads to the design of reoptimization algorithms that, when compared to classical algorithms that compute feasible solutions from scratch, are less expensive in terms of running time or output solutions which guarantee a better approximation ratio. Thus, reoptimization finds applications in many real settings (like scheduling problems or network design problems) where prior knowledge is often at our disposal and a problem instance can arise from a local modification of a previous problem instance (for example, a scheduled job is canceled or some links of the network fail). The term reoptimization was mentioned for the first time in the paper of Schäffter [33], where the author addressed an NP-hard scheduling problem with forbidden sets in the scenario of adding/removing a forbidden set. Since then, reoptimization has been successfully applied to other NP-hard problems including: the Steiner tree problem [8,11,13,14,15,29,30,35], the traveling salesman problem and some of its variants [1,5,7,12,15,16,17,18,19,32], scheduling problems [6,21], the minimum latency problem [27], the minimum spanning tree problem [24], the rural postman problem [3], many covering problems [10], the shortest Table 1 The state of the art of the approximability of Steiner tree reoptimization before and after our paper. The value σ is the best approximation ratio we can achieve for STP (actually σ = ln 4 + ≈ 1.387 [26]). If we substitute σ = ln 4 + , we get 10σ−7 7σ−4 ≈ 1.204, 7σ−4 4σ−1 ≈ 1.256, and 5σ−3 3σ−1 ≈ 1.246. The bound of 5σ−3 3σ−1 for the scenario in which the cost of an edge decreases holds when the modified edge can affect only its cost in the shortest-path metric closure. To increase readability, all the bounds are provided for the case in which ρ = 1. Local modifications marked with an asterisk are those for which the condition ρ = 1 is necessary as otherwise the reoptimization problem would be as hard to approximate as the STP. Finally, the question mark means that the problem is still open.
Local modification before our paper after our paper 1 + an edge cost decreases* 5σ−3 3σ−1 [8] 1 + a vertex is added to the graph* ? ? a vertex is deleted from the graph as hard as the STP [30] as hard as the STP [30] a novel algorithm, that we call BuildST, that takes a f (ξ)-restricted Steiner forest S ξ of S with q trees, generated with the algorithm of Borchers and Du, and a positive integer h as inputs and computes a minimum-cost Steiner tree S w.r.t. the set of all the feasible solutions that can be obtained by swapping up to h full components of S ξ with a minimum-cost set of edges (that is computed using the algorithm Connect). The running time of this algorithm is polynomial when all the three parameters f (ξ), q, and h are bounded by a constant.
We prove that the approximation ratio of the solution S returned by the algorithm BuildST is ρ+ (i) by showing that the cost of S is at most the cost of other feasible solutions S 1 , . . . , S and (ii) by proving useful upper bounds to the cost of each S i 's. Intuitively, each S i is obtained by swapping up to h suitable full components, say H i , of a suitable f (ξ)restricted version of a forest in S, say S ξ , with a minimal set of full components, say H i , of a g(ξ)-restricted version of a fixed optimal solution OPT . This implies that we can easily bound the cost of each S i w.r.t. the cost of S ξ , the cost of H i , and the cost of H i . Unfortunately, none of these bounds can be used by itself to prove the claim. We address this issue by carefully defining H i+1 as a function of both OPT and H i , and H i as a function of both S ξ and H i . This trick allows us to derive better upper bounds: we prove that the cost of each S i is at most ρg(ξ) 2 times the cost of OPT plus the i-th term of a telescoping sum. As each term of the telescoping sum can be upper bounded by g(ξ) times the cost of OPT , the bound of (ρ + ) on the approximation ratio of S then follows by averaging the costs of the S i 's and because of the choices of the parameters.
The paper is organized as follows: in Section 2 we provide the basic definitions and some preliminaries; in Section 3 we describe the three main tools that are used in all our algorithms; in Sections 4, 5, 6, and 7 we describe and analyze the algorithms for all the four local modifications addressed in this paper.
The vertices in V (G) \ R are also called Steiner vertices. With a slight abuse of notation, for any subgraph H of G, we denote by c(H) := e∈E(H) c(e) the cost of H.
In Steiner tree reoptimization we are given a triple I, S, I where I is an STP instance, S is a ρ-approximate Steiner tree of I, and I is another STP instance which slightly differs from I. The problem asks to find a ρ-approximate Steiner tree of I .
For a forest F of G (i.e., with E(F ) ⊆ E(G)) and a set of edges E ⊆ E(G), we denote by F + E a (fixed) forest yielded by the addition of all the edges in E \ E(F ) to F , i.e., we scan all the edges of E one by one in any (fixed) order and we add the currently scanned edge to the forest only if the resulting graph remains a forest. Analogously, we denote by F − E the forest yielded by the removal of all the edges in E ∩ E(F ) from F . We use the shortcuts F + e and F − e to denote F + {e} and F − {e}, respectively. Furthermore, if F is another forest of G we also use the shortcuts F + F and F − F to denote F + E(F ) and F − E(F ), respectively. For a set of vertices U ⊆ V (G), we define F + U := (V (F ) ∪ U, E(F )) and use the shortcut F + v to denote F + {v}.
W.l.o.g., in this paper we tacitly assume that all the leaves of a Steiner tree are terminals: if a Steiner tree S contains a leaf which is not a terminal, then we can always remove such a leaf from S to obtain another Steiner tree whose cost is upper bounded by the cost of S. Analogously, we tacitly assume that all the leaves of a Steiner forest (i.e., a forest spanning all the terminals) are terminals. A full component of a Steiner forest F -so a Steiner tree as well -is a maximal (w.r.t. edge insertion) subtree of F whose leaves are all terminals and whose internal vertices are all Steiner vertices. We observe that a Steiner forest can always be decomposed into full components. A k-restricted Steiner forest is a Steiner forest where each of its full components has at most k terminals.
In the rest of the paper, for any superscript s (the empty string is included), we denote by I s an STP instance (we tacitly assume that I s = G s , c s , R s as well as that G s has n vertices), by OPT s a fixed optimal solution of I s , by d s the shortest-path metric induced by c s in G s (i.e, d s (u, v) is equal to the cost of a shortest path between u and v in G s w.r.t. cost function c s ), by K s the complete graph on V (G s ) with edge costs d s , and by K s n the complete graph obtained by adding n − 1 copies of K s to K s and where the cost of an edge between a vertex and any of its copies is equal to 0. With a little abuse of notation, we use d s to denote the cost function of K s n . Moreover, we say that a subgraph H of K s n spans a vertex v ∈ V (G s ) if H spans -according to the standard terminology used in graph theoryany of the n copies of v. Finally, with a little abuse of notation, we denote by I s n the STP instance I s n = K s n , d s , R s . Let I be an STP instance. We observe that any forest F of G is also a forest of K such that d(F ) ≤ c(F ). Moreover, any forestF of K can be transformed in polynomial time into a forest F of G spanning V (F ) and such that c(F ) ≤ d(F ). In fact, F can be build from an empty graph on V (G) by iteratively adding -according to our definition of graph additiona shortest path between u and v in G, for every edge (u, v) ∈ E(F ).
We also observe that any forest F of K can be viewed as a forest of K n . Conversely, any forest F of K n can be transformed in polynomial time into a forest of K spanning V (F ) and having the same cost of F : it suffices to identify each of the 0-cost edges of F between any vertex and any of its copies. Therefore, we have polynomial-time algorithms that convert any forest F of any graph in {G, K, K n } into a forest F of any graph in {G, K, K n } such that F always spans V (F ) and the cost of F (according to the cost function associated with the corresponding graph) is less than or equal to the cost of F (according to the cost function associated with the corresponding graph). All these polynomial-time algorithms will be implicitly used in the rest of the paper; for example, we can say that a Steiner tree of I n is also a Steiner tree of I or that a forest of I n that spans v is also a forest of I that spans v. However, we observe that some of these polynomial-time algorithms do no preserve useful structural properties; for example, when transforming a k-restricted Steiner tree of I n into a Steiner tree of I we may lose the property that the resulting tree is k-restricted. Therefore, whenever we refer to a structural property of a forest, we assume that such a property holds only w.r.t. the underlying graph the forest belongs to.

General tools
In this section we describe the three main tools that are used by all our algorithms. The first tool is the algorithm Connect that has been introduced by Böckenhauer et al. in [14]. This algorithm takes an STP instance I together with a Steiner forest F of I as inputs and computes a minimum-cost set of edges of G whose addition to F yields a Steiner tree of I. The algorithm Connect reduces the STP instance to a smaller STP instance, where each terminal vertex corresponds to a tree of F , and then uses the famous Dreyfus-Wagner algorithm (see [28]) to find an optimal solution of the reduced instance. 3 If F contains q trees, the running time of the algorithm Connect is O * (3 q ); 4 this implies that the algorithm has polynomial running time when q is constant. The call of the algorithm Connect with input parameters I and F is denoted by Connect(I, F ).
The second tool is the algorithmic proof of Borchers and Du on k-restricted Steiner trees [20] that has already been used in Steiner tree reoptimization in the recent paper of Goyal and Mömke [30]. In their paper, Borchers and Du proved that, for every STP instance I and every ξ > 0, there exists a k-restricted Steiner tree S ξ of I n , with k = 2 1/ξ , such that d(S ξ ) ≤ (1 + ξ)c(OPT ). As the following theorem shows, the algorithmic proof of Borchers and Du immediately extends to any (not necessarily optimal!) Steiner tree of I n .
Theorem 1 ([20]). Let I be an STP instance, S a Steiner tree of I, and ξ > 0 a real value. There is a polynomial time algorithm that computes a k-restricted Steiner tree S ξ of I n , with k = 2 1/ξ , such that d(S ξ ) ≤ (1 + ξ)c(S).
The call of Borchers and Du algorithm with input parameters I, S, and ξ, is denoted by RestrictedST(I, S, ξ). By construction, the algorithm of Borchers and Du also guarantees the following properties: (a) if v is a Steiner vertex that has degree at least 3 in S, then S ξ spans v; (b) if the degree of a terminal t in S is 2, then the degree of t in S ξ is at most 4.
As shown in the following corollary, these two properties are useful if we want that a specific vertex of S would also be a vertex of the k-restricted Steiner tree S ξ of I n .

Corollary 2.
Let I be an STP instance, S a Steiner tree of I, v a vertex of S, and ξ > 0 a real value. There is a polynomial time algorithm that computes a k-restricted Steiner tree

Algorithm 1:
The pseudocode of the algorithm BuildST(I, F, h). 1 if F contains less than h full components then return Connect(I, (R, ∅)); 2 S ←⊥; Proof. The cases in which v ∈ R has already been proved in Theorem 1. Moreover, the claim trivially holds by property (a) when v is a Steiner vertex of degree greater than or equal to 3 in S. Therefore we assume that v is a Steiner vertex of degree 2 in S. Let I = G, c, R ∪ {v} . In this case, the call of RestrictedST I , S, ξ outputs a k -restricted Steiner tree S ξ of I n ,

The call of Borchers and Du algorithm with parameters I, S, ξ, and v is denoted by
The third tool, which is the novel idea of this paper, is the algorithm BuildST (see Algorithm 1 for the pseudocode). The algorithm BuildST takes as inputs an STP instance I, a Steiner forest F of I n , and a positive integer value h. The algorithm computes a Steiner tree of I by selecting, among several feasible solutions, the one of minimum cost. More precisely, the algorithm computes a feasible solution for each forestF that is obtained by removing from F up to h of its full components. The Steiner tree of I associated withF is obtained by the call of Connect I n ,F . If F contains a number of full components which is strictly less than h, then the algorithm computes a minimum-cost Steiner tree of I from scratch. The call of the algorithm BuildST with input parameters I, F , and h is denoted by BuildST(I, F, h). The proof of the following lemma is immediate.

Lemma 3. Let I be an STP instance, F a Steiner forest of I n ,F a Steiner forest of I n that is obtained from F by removing up to h of its full components, and H a minimum-cost subgraph of K n such thatF + H is a Steiner tree of I. Then the cost of the Steiner tree of I returned by the call of BuildST(I, F, h) is at most c(F ) + c(H).
Moreover, the following lemmas hold.

Lemma 4.
Let I be an STP instance and F a forest of G spanning R. If F contains q trees, then every minimal (w.r.t. the deletion of entire full components) subgraph H of any graph in {G, K, K n } such that F + H is a Steiner tree of I contains at most q − 1 full components.
Proof. Since H is minimal, each full component of H contains at least 2 vertices each of which respectively belongs to one of two distinct trees of F . Therefore, if we add the full components of H to F one after the other, the number of connected components of the resulting graph strictly decreases at each iteration because of the minimality of H. Hence, H contains at most q − 1 full components.

XX:7
Proof. If F contains at most h full components, then the number of terminals is at most q + hk and the call of Connect(I, (R, ∅)) outputs a Steiner tree of I in time O * (3 q+hk ). Therefore, we assume that F contains a number of full components that is greater than or equal to h. In this case, the algorithm BuildST(I, F, h) computes a feasible solution for each forest that is obtained by removing up to h full components of F from itself. As the number of full components of F is at most |R|, the overall number of feasible solutions evaluated by the algorithm is O(|R| h+1 ). LetF be any forest that is obtained from F by removing h of its full components. Since F is k-restricted,F contains at most q + hk trees. Therefore the call of Connect(I n ,F ) requires O * (3 q+hk ) time to output a solution. Hence, the overall time needed by the call of For the rest of the paper, we denote by I, S, I an instance of the Steiner tree reoptimization problem. Furthermore, we also assume that ρ ≤ 2 as well as ≤ 1, as otherwise we can use classical time-efficient algorithms to compute a 2-approximate solution of I .

A Steiner vertex becomes a terminal
In this section we consider the local modification in which a Steiner vertex Therefore, for the sake of readability, we will drop the superscripts from G , c , and d . Let ξ = /10 and h = 2 2 2/ 1/ξ . The algorithm, whose pseudocode is reported in Algorithm 2, computes a Steiner tree of I first by calling RestrictedST(I, S, ξ) to obtain a k-restricted Steiner tree S ξ of I n , with k = 2 1/ξ , and then by calling BuildST(I , S ξ + t, h). Intuitively, the algorithm guesses the full components of S ξ to be replaced with the corresponding full components of a suitable k -restricted version of a new (fixed) optimal solution, for suitable values of k . Proof. Theorem 1 implies that the computation of S ξ requires polynomial time. Since S ξ is a Steiner tree of I n , S ξ + t is a Steiner forest of I n of at most two trees (observe that S ξ may already contain t). Therefore, using Lemma 5 and the fact that h is a constant value, the call of BuildST(I , S ξ + t, h) outputs a solution S in polynomial time. Hence, the overall time complexity of Algorithm 2 is polynomial.
In the following we show that Algorithm 2 returns a (ρ + )-approximate solution. Let S ξ denote the Steiner tree of I n that is returned by the call of RestrictedST(I , OPT , ξ). Let H 0 be a full component of S ξ that spans t (ties are broken arbitrarily). For every i = 1, . . . , , with = 2/ , we define:

XX:8
New algorithms for Steiner tree reoptimization H i as the forest consisting of a minimal set of full components of S ξ whose addition to S ξ − H i−1 yields a Steiner tree of I n (see Figure 1 (b) and (d)); H i as the forest consisting of a minimal set of full components of S ξ whose addition to S ξ − H i yields a Steiner tree of I n (see Figure 1 (c)).
For the rest of the proof, we denote by S i the Steiner tree of I yielded by the addition of Let k = 2 1/ξ and observe that both S ξ and S ξ are k-restricted Steiner trees of I n and I n , respectively (see Theorem 1). Therefore H 0 spans at most k terminals. Furthermore, by repeatedly using Lemma 4, H i contains at most k 2i−1 full components and spans at most k 2i terminals, while H i contains at most k 2i full components and spans at most k 2i+1 terminals. This implies that the number of the full components of H i , with i = 1, . . . , , is at most

XX:9
Therefore, by Lemma 3, the cost of the solution returned by the call of BuildST(I , S ξ + t, h) is at most c(S i ). As a consequence Now we prove an upper bound to the cost of each S i . Let ∆ OPT = (1 + ξ)c(OPT ) − c(OPT ). As any Steiner tree of I is also a Steiner tree of I, c(OPT ) ≥ c(OPT ); therefore ∆ OPT ≥ 0. Since the addition of H i to S ξ − H i−1 yields a Steiner tree of I, the cost of this tree is lower bounded by the cost of OPT . As a consequence, using Theorem 1 in the second inequality that follows, Using Theorem 1 in the first inequality that follows we have that Using both (2) and (3) in the second inequality that follows, we can upper bound the cost of Observe that the overall sum of the last two terms on the right-hand side of (4) for every i ∈ {1, . . . , } is a telescoping sum. As a consequence, if for every i ∈ {1, . . . , } we substitute the term c(S i ) in (1) with the corresponding upper bound in (4), and use Theorem 1 to where last inequality holds by the choice of ξ and , and because ρ ≤ 2 and ≤ 1. This completes the proof.

The cost of an edge increases
In this section we consider the local modification in which the cost of an edge e = (u, v) ∈ E(G) increases by ∆ > 0. More formally, we have that G = G, R = R, whereas, for every e ∈ E(G), c(e ) otherwise.
For the sake of readability, in this section we drop the superscripts from G and R . Furthermore, we denote by c −e the edge-cost function c restricted to G − e and by d −e the corresponding shortest-path metric. Let ξ = /10 and h = 2 2(1+ 1/ξ ) 2/ . The algorithm, whose pseudocode is reported in Algorithm 3, first checks whether e ∈ E(S). If this is not the case, then the algorithm returns S. If e ∈ E(S), then let S u and S v denote the two trees of S − e containing u and v, respectively. The algorithm first computes a k-restricted Steiner tree S u,ξ (resp., S v,ξ ), with k = 2 2+ 1/ξ , of S u (resp., S v ) such that u ∈ V (S u,ξ ) (resp., v ∈ V (S v,ξ )). Then the algorithm computes a solution S via the call of BuildST(I , S u,ξ + S v,ξ , h), and, finally, it returns the cheapest solution between S and S . As we will see, the removal of e from S is necessary to guarantee that the cost of the processed Steiner forest of I (i.e., S − e) is upper bounded by the cost of OPT .

Theorem 7. Let I, S, I be an instance of Steiner tree reoptimization, where S is a ρ-approximate solution of I and I is obtained from I by increasing the cost of a single edge. Then Algorithm 3 computes a (ρ + )-approximate Steiner tree of I in polynomial time.
Proof. Corollary 2 implies that the computation of both S u,ξ and S v,ξ requires polynomial time. Therefore, using Lemma 5 and the fact that h is a constant value, the call of BuildST(I , S ξ , h) outputs a solution S in polynomial time. Hence, the overall time complexity of Algorithm 3 is polynomial.
In the following we show that Algorithm 3 returns a (ρ + )-approximate solution. Observe that the local modification does not change the set of feasible solutions, i.e., a tree is a Steiner tree of I iff it is a Steiner tree of I . This implies that OPT is a Steiner tree of I as well. i.e., once again, the solution returned by the algorithm is a ρ-approximate solution. Therefore, in the rest of the proof, we assume that e ∈ E(S) as well as e ∈ E(OPT ).
Let S ξ denote the Steiner tree of K n , d −e , R that is returned by the call of RestrictedST( G− e, c −e , R , OPT , ξ). Using Theorem 1 and the fact that e ∈ E(OPT ) we have that Let H 0 be a full component of S ξ whose addition to S ξ yields a Steiner tree of I n (ties are broken arbitrarily). For every i = 1, . . . , , with = 2/ , we define: H i as the forest consisting of a minimal set of full components of S ξ such that the addition of H i and e to S ξ − H i−1 yields a Steiner tree of I n ; 5 H i as the forest consisting of a minimal set of full components of S ξ whose addition to S ξ − H i yields a Steiner tree of I n .
For the rest of the proof, we denote by S i the Steiner tree of I obtained by augmenting S ξ − H i with H i . Observe that S i does not contain e. Therefore Let k = 2 2+ 1/ξ and r = 2 1/ξ . Observe that S ξ is a k-restricted Steiner forest of I n (see Corollary 2), while S ξ is an r-restricted Steiner tree of I n (see Theorem 1). Therefore, H 0 spans at most r terminals. Moreover, by repeatedly using Lemma 4, H i contains at most k i−1 r i full components and spans at most k i r i terminals, while H i contains at most k i r i full components and spans at most k i r i+1 terminals. This implies that the number of full components of H i , with i = 1, . . . , , is at most Therefore, by Lemma 3, the cost of the solution returned by the call of BuildST(I , S ξ , h) is at most the cost of S i . As a consequence Now we prove an upper bound to the cost of each S i , with i ∈ {1, . . . , }. Let ∆ OPT = (1 + ξ)c (OPT ) − c(OPT ) and observe that ∆ OPT ≥ 0. Since the addition of H i and e to S ξ − H i−1 yields a Steiner tree of I, the cost of this tree is lower bounded by the cost of OPT . As a consequence, using (5) together with Theorem 1 in the third inequality that follows, Using Corollary 2 twice in the first inequality that follows we have that Starting from (6) and using both (8) and (9) in the second inequality that follows, we can upper bound the cost of S i , for every i ∈ {1, . . . , }, with 5 We observe that the existence of H i is guarantee by the fact that S ξ + e is a Steiner tree of In: in fact, S ξ = S u,ξ + S v,ξ is a forest of two trees such that u ∈ S u,ξ and v ∈ S v,ξ .

Algorithm 4: A terminal t of G becomes a Steiner vertex.
1 ξ ← /10; 2 h ← (1 + 1/ξ )2 2(1+ 1/ξ ) 2/ ; 3 let P * be a maximal (w.r.t. hop-length) path of OPT starting from t and containing up to 1 + 1/ξ Steiner vertices whose corresponding degrees in OPT are all greater than or equal to 3; 4 let S ξ be the empty graph; 5 for every v ∈ V (P * ) ∩ V (OPT − P * ) do 6 let Sv be the tree of OPT − P * that spans v; As a consequence, if for every i ∈ {1, . . . , } we substitute the term c (S i ) in (7) with the corresponding upper bound in (10), and use (5) where last inequality holds by the choice of ξ and , and because ρ ≤ 2 and ≤ 1. This completes the proof.

A terminal becomes a Steiner vertex
In this section we consider the local modification in which a terminal vertex t ∈ R becomes a Steiner vertex. More precisely, the input instance satisfies the following: G = G, c = c, whereas R = R \ {t}. Therefore, for the sake of readability, in this section we drop the superscripts from c , d , and G . We recall that, unless ρ = 1, the problem is as hard to approximate as the STP [30]. Therefore, in this section we assume that S = OPT is an optimal solution, i.e., ρ = 1. Let ξ = /10 and h = (1 + 1/ξ )2 2(1+ 1/ξ ) 2/ . As c(OPT ) may be much smaller than c(OPT ), we first need to remove a path from OPT to ensure that the obtained Steiner forest of I has a constant number of trees and a cost upper bounded by (1 + ξ)c(OPT ). The algorithm, whose pseudocode is reported in Algorithm 4, precomputes a maximal (w.r.t. hop-length) path P * of OPT having t as one of its endvertices and containing up to 1 + 1/ξ Steiner vertices whose corresponding degrees in OPT are all greater than or equal to 3. As the following lemma shows, P * is exactly the path we are searching for. Proof. By definition of P * , OPT − P * is a Steiner forest of I with at most 1 + 1/ξ trees (we recall that only trees of the forest spanning one or more terminals are kept; therefore, Steiner vertices of P * having degree 2 in S are not contained in OPT − P * ).
To show that c(P * ) ≥ c(OPT ) − (1 + ξ)c(OPT ), we divide the proof into two complementary cases, depending on whether P * spans other terminals other than t.
We consider the case in which P * spans other terminals other than t. In this case OPT + P * is a Steiner tree of I. Therefore, c(OPT ) ≤ c(OPT ) + c(P * ), from which we derive c(P * ) ≥ c(OPT ) − c(OPT ) ≥ c(OPT ) − (1 + ξ)c(OPT ). Now, we consider the case in which P * does not span another terminal other than t. In this case P * contains exactly 1 + 1/ξ Steiner vertices, each of which has degree greater than or equal to 3 in OPT . Therefore, OPT − P * yields a Steiner forest of I of exactly 1 + 1/ξ trees. This implies that OPT − P * contains at least 1 + 1/ξ pairwise edge-disjoint paths connecting vertices of P * with terminals in R . Let P be any of these paths that minimizes its cost (ties are broken arbitrarily). As the addition of both P * and P to OPT yields a Steiner tree of I, (1 + 1/ξ )c(P ) + c(P * ) ≤ c(OPT ) ≤ c(OPT ) + c(P ) + c(P * ), from which we derive c(P ) ≤ ξc(OPT ). As a consequence c(OPT ) ≤ c(OPT ) + c(P ) + c(P * ) ≤ c(OPT ) + ξc(OPT ) + c(P * ), i.e., c(P * ) ≥ c(OPT ) − (1 + ξ)c(OPT ).
The algorithm then computes a k-restricted Steiner forest S ξ of OPT − P * , with k = 2 2+ 1/ξ , such that S ξ + P * yields a Steiner tree of I. Finally, the algorithm calls BuildST(I , S ξ , h) to compute a feasible solution S and returns the cheapest solution between OPT and S . Proof. Corollary 2 implies that the computation of each S v,ξ , with v ∈ V (P * ), requires polynomial time. By Lemma 8, S ξ is a Steiner forest of I n with a constant number of trees. Therefore, using Lemma 5 and the fact that h is a constant value, the call of BuildST(I , S ξ , h) outputs a solution in polynomial time. Hence, the overall time complexity of Algorithm 4 is polynomial.
In the following we show that Algorithm 4 returns a (1+ )-approximate solution. W.l.o.g., we can assume that c(OPT ) > (1 + )c(OPT ) as otherwise the solution returned by the algorithm, whose cost is less than or equal to c(OPT ), would already be a (1 + )-approximate solution.
Let S ξ be the Steiner tree of I n that is returned by the call RestrictedST(I , OPT , ξ) and let H 0 be the forest consisting of a minimal set of full components of S ξ whose addition to S ξ yields a Steiner tree of I n . For every i = 1, . . . , , with = 2/ , we define: H i as the forest consisting of a minimal set of full components of S ξ such that the addition of H i and P * to S ξ − H i−1 yields a Steiner tree of I n ; 6 H i as the forest consisting of a minimal set of full components of S ξ whose addition to S ξ − H i yields a Steiner tree of I n .
For the rest of the proof, we denote by S i the Steiner tree of I obtained by augmenting Let k = 2 2+ 1/ξ and r = 2 1/ξ . Observe that S ξ is a k-restricted Steiner forest of I n (see Corollary 2), while S ξ is an r-restricted Steiner tree of I n (see Theorem 1). Using Lemma 4, H 0 contains at most (1 + 1/ξ ) full components and spans at most (1 + 1/ξ )r terminals. By repeatedly using Lemma 4, H i contains at most (1 + 1/ξ )k i−1 r i full components and spans at most (1 + 1/ξ )k i r i terminals, while H i contains at most (1 + 1/ξ )k i r i full components and spans at most (1 + 1/ξ )k i r i+1 terminals. This implies that the number of full components of H i , with i = 1, . . . , , is at most Therefore, by Lemma 3, the cost of the solution returned by the algorithm is at most the cost of S i , for every i = 1, . . . , . As a consequence Now we prove an upper bound to the cost of each S i . Let ∆ OPT = c(OPT )−(1+ξ)c(OPT ) and observe that ∆ OPT ≥ 0 by our assumption. Since the addition of H i and P * to S ξ −H i−1 yields a Steiner tree of I, the cost of this tree is lower bounded by the cost of OPT . As a consequence, using Theorem 1 in the second inequality that follows, Using Corollary 2 and Lemma 8 in the first and last inequality that follows, respectively, we have that Using both (12) and (13) in the second inequality that follows, we can upper bound the cost of S i , for every i ∈ {1, . . . , }, with Therefore, if for every i ∈ {1, . . . , } we substitute the term c(S i ) in (11) with the corresponding upper bound in (14), and use Theorem 1 to derive d( where last inequality holds by the choice of ξ and , and because ≤ 1. This completes the proof.

The cost of an edge decreases
In this section we consider the local modification in which the cost of an edge e = (u, v) ∈ E decreases by 0 < ∆ ≤ c(e). More precisely, the input instance satisfies the following: G = G, R = R, whereas for every e ∈ E, c(e ) otherwise.
For the sake of readability, in this section we drop the superscripts from G and R . to G − e and by d −e the corresponding shortest-path metric. We recall that, unless ρ = 1, the problem is as hard to approximate as the STP [30]. Therefore, in this section we assume that S = OPT is an optimal solution, i.e., ρ = 1.
Let ξ = /10 and h = 2(1 + 1/ξ )2 2(2+ 1/ξ ) 2/ . As c (OPT ) may be much smaller than c (OPT ), we first need to remove a path from OPT to ensure that the obtained Steiner forest of I has a constant number of trees and a cost upper bounded by (1 + ξ)c (OPT ). The algorithm, whose pseudocode is reported in Algorithm 5, precomputes a set H containing all the paths of OPT with up to 2(1 + 1/ξ ) Steiner vertices whose corresponding degrees in OPT are all greater than or equal to 3. As the following lemma shows, there exists P * ∈ H, which is exactly the path we are searching for when c (OPT ) is much smaller than c (OPT ). Proof. Let S u and S v denote the trees of OPT − e containing u and v, respectively. Let As e ∈ E(OPT ), there exists a path in OPT , saȳ P , that connects a terminal in R u , say u , with a terminal in R v , say v , and such that all the internal vertices ofP are Steiner vertices. Let σ be the number of Steiner vertices ofP whose corresponding degrees in OPT are all greater than or equal to 3. We divide the proof into two complementary cases depending on the value of σ. In both cases, we prove that P * is a subpath ofP .
We consider the case in which σ ≤ 2(1 + 1/ξ ). Let P * =P . Clearly P * ∈ H and OPT −e+P * is a Steiner tree of I. Therefore, c(OPT ) ≤ c (OPT −e)+c (P * ) ≤ c (OPT )+ c (P * ), from which we derive c Now, we consider the case in which σ > 2(1 + 1/ξ ). Let X be the set of the σ Steiner vertices ofP whose corresponding degrees in OPT are all greater than or equal to 3. Let x 1 , . . . , x σ be the vertices in X in order in which they are encountered while traversingP from u to v . Finally, let x 0 = u and x σ+1 = v . We associate a label λ(i) ∈ {u, v} with each x i to indicate the existence of a path in OPT between x i and a terminal in R λ(i) that is edge-disjoint fromP (if λ(i) can assume both values, we arbitrarily choose one of them). We set λ(0) = u and λ(σ + 1) = v to indicate that u (resp., v ) has the trivial paths towards itself. For i = 0, . . . , σ − 2 1/ξ , let L i = λ(i), . . . , λ(i + 1 + 2 1/ξ )) be the sequence of 2(1 + 1/x ) consecutive labels starting from i. One of the following holds: (a) L 0 contains at least 1 + 1/ξ occurrences of v; (b) L σ−2 1/ξ contains at least 1 + 1/ξ occurrences of v; (c) there is an index i such that the sequence L i contains exactly 1 + 1/ξ occurrences of u and 1 + 1/ξ occurrences of v.
The algorithm always returns a solution whose cost is upper bounded by c (OPT ). This allows us to guarantee that the output of the algorithm is a (1 + )-approximate solution when e ∈ E(OPT ) or e ∈ E(OPT ). In the complementary case in which e ∈ E(OPT ) and e ∈ E(OPT ) the algorithm computes a (1 + )-approximate solution using the path P * that satisfies the conditions stated in Lemma 10. More precisely, the algorithm computes a k-restricted Steiner forest S ξ of OPT − P * w.r.t. the STP instance G − e, c −e , R , with k = 2 2+ 1/ξ , such that S ξ + P * yields a Steiner tree of I. Finally, the algorithm calls BuildST(I , S ξ , h) to compute a feasible solution S and returns a solution whose cost is upper bounded by c (S ). Theorem 11. Let I, OPT , I be an instance of Steiner tree reoptimization, where OPT is an optimal solution of I and I is obtained from I by decreasing the cost of a single edge. Then Algorithm 5 computes a (1 + )-approximate Steiner tree of I in polynomial time.
Proof. Corollary 2 implies that the computation of each S v,ξ , with v ∈ V (P ), requires polynomial time. Observe that OPT − P is a Steiner forest of I of at most 2(1 + 1/ξ ) trees. As a consequence S ξ is a Steiner forest of I n with at most 2(1 + 1/ξ ) trees. Therefore, using Lemma 5 and the fact that h is a constant value, the call of BuildST(I , S ξ , h) outputs a solution in polynomial time. Finally, since H contains at most O(n 2 ) paths (one path for each pair of vertices), the overall time complexity of Algorithm 5 is polynomial.
In the following we show that Algorithm 5 returns a (1+ )-approximate solution. W.l.o.g., we can assume that c(OPT ) > (1 + )c(OPT ), as otherwise, the solution returned by the algorithm, whose cost is always less then or equal to c (OPT ) ≤ c(OPT ), would already be a (1 + )-approximate solution. As a consequence, we have that e ∈ E(OPT ) as well as e ∈ E(OPT ): indeed, if even one of these two conditions were not satisfied, then OPT would be an optimal solution of I .
Let S u and S v be the two trees of OPT − e that contain u and v, respectively. Let S u,ξ and S v,ξ be the two k-restricted trees of I n , with k = 2 2+1/ξ , that are returned by the call RestrictedST( G − e, c −e , R , S u , ξ, u) and RestrictedST( G − e, c −e , R , S v , ξ, v), respectively. Finally, let S ξ = S u,ξ + S v,ξ , P * ∈ H the path satisfying the conditions stated in Lemma 10, and S ξ the k-restricted Steiner forest of I that is computed by the algorithm when P = P * . Let H 0 be the forest consisting of a minimal set of full components of S ξ such that the addition of H 0 and e to S ξ + e yields a Steiner tree of I n . For every i = 1, . . . , , with = 2/ , we define: H i as the forest consisting of a minimal set of full components of S ξ such that the addition of H i and P * to S ξ − H i−1 yields a Steiner tree of I n ; 7 H i as the forest consisting of a minimal set of full components of S ξ such that the addition of H i and e to S ξ − H i yields a Steiner tree of I n . 8 For the rest of the proof, we denote by S i the Steiner tree of I obtained by augmenting S ξ − H i with H i and e.