Journal of Graph Algorithms and Applications Incremental Network Design with Minimum Spanning Trees

Given an edge-weighted graph G = (V, E) and a set E0 ⊂ E, the incremental network design problem with minimum spanning trees asks for a sequence of edges e T ∈ E \ E0 minimizing T t=1 w(Xt) where w(Xt) is the weight of a minimum spanning tree Xt for the subgraph (V, E0 ∪ {e t }) and T = |E \ E0|. We prove that this problem can be solved by a greedy algorithm.


Introduction
Network planning involves two stages. First, the structure of the network needs to be decided. Second, the construction of the network needs to be scheduled. The first stage, the network design stage, has received considerable attention in the operations research literature (see the survey papers [8,9] and the references therein). The second stage, the network construction stage, has received far less attention. However, because the construction of a network often stretches over a long period of time, the sequence in which the network is constructed is important as it defines when specific parts of the network become operational. It may even be beneficial to construct temporary links, i.e., links that are not part of the ultimate network, in order for parts of the network to become operational.
The class of incremental network design problems introduced by Baxter et al.
[1] integrates the two stages of network planning and captures the trade-offs between construction cost and operational benefit. More specifically, an incremental network design problem can be associated with any network optimization problem P , e.g., finding a shortest path, finding a maximum flow, etc. In the most basic version, in addition to the network optimization problem P , an instance is given by a network G = (V, E) with vertex set V and edge set E and an existing edge set E 0 . The edge set E \ E 0 is referred to as the potential edge set and its cardinality T = |E \ E 0 | as the planning horizon. Let ϕ P (G) denote the value of an optimal solution to network optimization problem P on network G. We are seeking a sequence E 0 ⊂ E 1 ⊂ · · · ⊂ E T = E with |E i \ E i−1 | = 1 giving rise to networks G 0 , G 1 , . . . , G T = G, such that T t=1 ϕ P (G t ) is minimum (assuming that P is a minimization problem). That is, in the basic version, a single edge can be built in each period of the planning horizon and we are seeking to minimize the operational costs over the planning horizon.
In more elaborate versions, a construction cost may be associated with building a potential edge and a budget may be available in each period, and the objective is to minimize the operational costs over the planning horizon subject to the constraint that the construction cost of the set of potential edges built in a period does not exceed the budget in that period.
Two natural heuristics for incremental network design problems, quickest-improvement and quickestto-ultimate, are also of interest. Quickest-improvement always seeks to improve the value of the solution to the network optimization as quickly as possible, i.e., by adding as few potential edges to the network as possible. A description of quickest-improvement can be found in Algorithm 1.
Quickest-to-ultimate first finds an optimal solution to the network optimization on the complete network, referred to as an ultimate solution, and then always seeks to improve the value of the solution to the network optimization as quickly as possible, but choosing only potential edges that are part of the ultimate solution. A description of quickest-to-ultimate can be found in Algorithm 2.
Algorithm 2 quickest-to-ultimate Incremental network design problems have been studied for the shortest path problem [1] and for the maximum flow problem [7]. In both cases, it was found that even the basic version of the incremental network design problem is NP-complete. For the natural heuristics described above it has been shown that for the shortest path problem, neither yields a constant factor approximation algorithm, but that for the maximum flow problem with the additional restriction that all arcs have unit capacity, quickest-to-ultimate yields a 2-approximation algorithm and quickest-improvement yields a 3/2-approximation algorithm.
These results have raised two questions: (1) Does there exist a network optimization problem for which the incremental design problem is polynomially solvable? (2) Does there exist a network optimization problem for which either quickest-to-ultimate or quickest-improvement solves the incremental design problem optimally?
In this paper, we answer both questions in the affirmative. We show that the basic version of the incremental network design problem with minimum spanning trees is solved by both quickest-improvement and quickest-to-ultimate.
The incremental network design problem with minimum spanning trees (IND-MST) is defined as follows. For a given graph G = (V, E), a weight function w : E → R, and a set of existing edges E 0 , such that the subgraph G = (V, E 0 ) is connected, find a sequence X 0 , X 1 , . . . , X T of spanning trees which minimizes the sum of the weights w(X 0 ) + · · · + w(X T ) subject to the condition that X 0 ⊆ E 0 and |X i ∩ (E \ (E 0 ∪ X 1 ∪ · · · ∪ X i−1 ))| 1 for 1 i T , i.e., at most one edge from E \ E 0 might be added in each step. This has some similarity with the problem of maintaining a dynamic minimum spanning tree while the network data changes [3,4,5,6,11]. In contrast to these dynamic minimum spanning tree problems, in our setting the network changes are not given as input, but are part of the decisions to be made. We will show that IND-MST can be solved by a greedy algorithm. This is a consequence of the corresponding result for the incremental matroid design problem with minimum weight matroid bases, which is stated in Section 2 and proved in Section 3.

Incremental matroid design
Let M = (E, I) be a matroid of rank r, where E is the ground set, and I ⊆ 2 E is the collection of independent sets. We follow the notation of Schrijver [10]: the rank of a matroid M is denoted by rk(M ), minimal dependent sets are called circuits, for A ⊂ E and e ∈ E we write A+e = A∪{e} and A−e = A\{e}, and we denote the closure of a set A ⊆ E by span(A): An important tool in our arguments is the following strong exchange property which was first proved by Brualdi [2].
Strong exchange property. If X and Y are bases of a matroid M and e ∈ X, then there exists an element e ′ ∈ Y such that X − e + e ′ and Y − e ′ + e are bases of M .
As additional input, we are given a weight function w : E → R and a subset E 0 ⊂ E such that E 0 contains a basis of M . We define a function f : 2 E\E0 → R by The incremental matroid design problem with minimum weight bases (IMD-MWB) problem for the time horizon T = |E \ E 0 | is the following optimization problem: For a basis X, a pair (e, e ′ ) ∈ X × (E \ X) is called an exchange pair for X if X − e + e ′ is another basis. It is called an optimal exchange pair if w(e) − w(e ′ ) is maximum. Algorithm 3 is a natural greedy strategy for solving IMD-MWB, where the output defines the sets This corresponds to using quickest-improvement.
Algorithm 3 Greedy algorithm for the incremental minimum weight basis problem k ← 0 w * ← minimum weight of a basis of M X ← any minimum weight basis of the submatroid induced by E 0 (which is also a basis of M ) while w(X) > w * do k ← k + 1 (e, e ′ ) ← an optimal exchange pair for X Our main result is a consequence of the following theorem.
Theorem 1. Algorithm 3 finds an optimal solution for the problem IMD-MWB.
If the second component e ′ of an exchange pair (e, e ′ ) for X belongs to Y \ X, where Y ⊆ E, then we call such a pair an exchange pair for (X, Y ). Before proving Theorem 1 we observe that the search for an optimal exchange pair can be restricted to exchange pairs (e, e ′ ) for (X, Y ), where Y is a fixed minimum weight basis of M . This corresponds to using quickest-to-ultimate and leads to Algorithm 4.

Algorithm 4 Simplified greedy algorithm
X ← any minimum weight basis of the submatroid induced by E 0 Y ← any minimum weight basis of the matroid M for k = 1, . . . , |Y \ X| do (e, e ′ ) ← an optimal exchange pair for (X, Y ) Corollary 1. Algorithm 4 finds an optimal solution for the problem IMD-MWB.
Proof. This follows from the claim that for any basis X of M , and any minimum weight basis Y , there is an optimal exchange pair (e, e ′ ) for X with e ′ ∈ Y . Suppose the claim is false and let (e, e ′ ) be an optimal exchange pair for X. By the strong exchange property applied to the bases X ′ = X − e + e ′ and Y and the element e ′ ∈ X ′ , there exists an e ′′ ∈ Y such that X ′ − e ′ + e ′′ = X − e + e ′′ and Y − e ′′ + e ′ are bases. Our assumption implies w(e ′′ ) > w(e ′ ), while from the minimality of Y it follows that w(e ′′ ) w(e ′ ).

Proof of Theorem 1
The following lemma is stated in [4] for graphical matroids. The argument works in general, and in order to make our presentation self-contained we include the short proof.
Lemma 1 is proved by iterating the next lemma which states that a single element exchange is sufficient in order to update the minimum weight basis after one potential element is added.
Lemma 2. Let A ⊆ E \ E 0 , and let X A be a minimum weight basis for the matroid M A induced by E 0 ∪ A. For every e ∈ E \ (E 0 ∪ A), the set X A + e − e ′ is a minimum weight basis for the matroid M A+e induced by E 0 ∪ A + e, where e ′ is an element of maximum weight in the circuit of X + e.
Proof. Suppose the statement is false and let Y be a basis of M A+e with w(Y ) < w(X) + w(e) − w(e ′ ). Then e ∈ Y , and by the strong exchange property, there exists e ′′ ∈ X such that Y + e ′′ − e and X + e − e ′′ are bases. The choice of e ′ implies w(e ′′ ) w(e ′ ), while minimality of X and our assumption on Y imply that hence w(e ′′ ) > w(e ′ ), and this contradiction concludes the proof.
Note that F 0 > F 1 > · · · > F t = F t+1 = · · · = F T for some t min{r, T } and Algorithm 3 terminates with k t. Clearly, F 0 + F 1 + · · · + F T is a lower bound for (1). The correctness of Algorithm 3 follows from the fact that it achieves this lower bound, which in turn is a consequence of the following extension property. By the optimality of A and B and since F k+1 < F k , the sets A and B are contained in every minimum weight basis of M A and M B , respectively, and by Lemma 1, there are minimum weight bases X, X A and X B for these submatroids with X A \ X = A and X B \ X = B. We define a bipartite digraph (U ∪ V, A) with parts Let e ′ ∈ V. Then e ′ ∈ E \ (E 0 ∪ A), hence e ′ ∈ X A and X A + e ′ contains a circuit C. We claim that C − e ′ ⊆ span((X B ∩ X) ∪ A), and this implies that there exist e ∈ C ∩ U, and consequently (e, e ′ ) ∈ A. For the sake of contradiction, suppose the claim is false and C − e ′ ⊆ span((X B ∩ X) ∪ A). From the fact that C is a circuit, it follows that which is a contradiction to e ′ ∈ V. Similarly, if e ′ ∈ U, then e ′ ∈ X A \ A ⊆ E 0 and e ′ ∈ X B ∩ X, which implies e ′ ∈ X B , hence there exists a circuit C in X B + e ′ . As before, the assumption that C − e ′ is contained in span((X B ∩ X) ∪ A) leads to the contradiction e ′ ∈ span((X B ∩ X) ∪ A). By this argument, for every e ′ ∈ U there exists an e ∈ V with (e, e ′ ) ∈ A. We conclude that every node in the digraph (U ∪ V, A) has positive indegree, thus the digraph contains a directed cycle, and this implies that there are e ′ , e ′′ ∈ U and e ∈ V such that (e ′ , e) ∈ A, (e, e ′′ ) ∈ A, and w(e ′ ) w(e ′′ ). From this we derive The converse inequality f (A + e) F k+1 is obvious and this concludes the proof.

Run-time analysis
In order to bound the time complexities of the problems IMD-MWB and IND-MST, we argue that the initial basis X, the ultimate basis Y and the list of exchange pairs E can be determined simultaneously. The idea is to consider the elements of E in order of nondecreasing weights and to construct and maintain three independent sets X, Y and Z using the following update rules: 1. An element e ∈ E is added to X if and only if e ∈ E 0 and the addition of e does not create a circuit in X. Hence X is an initial minimum weight basis when the algorithm terminates.
2. An element e ∈ E is added to Y if and only if the addition of e does not create a circuit in Y . Hence Y is an ultimate minimum weight basis when the algorithm terminates.
3. An element e ∈ E is added to Z if and only if it is added to X or Y . We will show that because an edge added to Y does not create a cycle in Y , it does not create a cycle in Z. Therefore, if an edge e added to Z creates a cycle C, then e ∈ E 0 and C must contain an element of E \ E 0 and a maximum weight element e ′ of C \ E 0 is removed from Z. The pair (e, e ′ ) is added to the set E of exchange pairs.
To finish up, the set E of exchange pairs (e, e ′ ) is ordered such that w(e) − w(e ′ ) is nonincreasing, and ties are broken in favor of the pair that was added to E last. More precisely, we index E = {(e 1 , e ′ 1 ), . . . , (e k , e ′ k )}, such that for every i ∈ {1, . . . , k − 1}, we have either w(e i ) − w(e ′ i ) > w(e i+1 ) − w(e ′ i+1 ), or w(e i+1 ) − w(e ′ i+1 ) = w(e i ) − w(e ′ i ) and the pair (e i , e ′ i ) is added to E after (e i+1 , e ′ i+1 ). A formal description can be found in Algorithm 5. For the remainder of the section, let k be the size of the set E returned by the algorithm.

Algorithm 5 Efficient solution of the problem IMD-MWB
X ← ∅; Y ← ∅; Z ← ∅ // initialize three independent sets E ← ∅ // initialize set of exchange pairs for e ∈ E do // in nondecreasing order of weight if e ∈ E 0 then if X + e ∈ I then X ← X + e; Z ← Z + e if Z contains a circuit C then e ′ = arg max{w(e ′′ ) : In order to show the correctness of Algorithm 5, we introduce some additional notation. Let X 0 = X and X i = X i−1 − e i + e ′ i for (e i , e ′ i ) ∈ E, i = 1, 2, . . . , k. Let m = |E|. We say that e has position p, denoted by pos(e) = p, if e is the element that is handled in the p-th iteration of the for-loop, 1 p m. Note that pos(e) < pos(e ′ ) implies w(e) w(e ′ ).
Let X p , Y p , Z p denote the sets X, Y and Z after the p-th iteration of the for-loop has been completed, 0 p m. It is obvious, that if p l, then For i = 1, . . . , k, we denote the circuit that leads to the deletion of e ′ i from Z by C i . In other words, if pos(e i ) = p then C i is the unique circuit in Z p−1 + e i and we have Z p = Z p−1 + e i − e ′ i . If e is any element of C i , then pos(e) pos(e i ) and hence w(e) w(e i ). By the choice of e ′ i we have w(e) w(e ′ i ) for all e ∈ C i \ E 0 .
: e i ∈ H p and e ′ i ∈ H ′p }. Lemma 4. We have for 0 p m Case 1. X p = X p−1 + e and Y p = Y p−1 . Then e ∈ span(Y p−1 ). By the induction hypothesis, e ∈ span(Z p−1 ) and consequently Z p = (Z p−1 + e) − e ′ for some e ′ in the unique circuit of Z p−1 + e where e ′ ⊆ E \ E 0 and e ′ = e. Obviously, Z p ∈ I and span(Z p ) = span(Z p−1 + e) = span(Z p−1 ) = span(Y p−1 ) = span(Y p ). Obviously, Case 2. X p = X p−1 and Y p = Y p−1 + e. Then Z p = Z p−1 + e and hence span(Y p ) = span(Z p ). Obviously, X p , Y p ∈ I and e / ∈ span(Y p−1 ), i.e. e / ∈ span(Z p−1 ). Thus Z p ∈ I.
If e ∈ E 0 then e ∈ span(X p−1 ) ⊆ span(Z p−1 ) = span(Y p−1 ), which contradicts Y p−1 + e ∈ I. Hence Case 3. X p = X p−1 + e and Y p = Y p−1 + e. Then X p , Y p ∈ I and e / ∈ span(Y p−1 ), i.e. e / ∈ span(Z p−1 ). Thus Z p−1 + e ∈ I. This implies Z p = Z p−1 + e and consequently span(Y p ) = span(Z p ) as well as In the following, we denote the three independent sets that the algorithm terminates with by X, Y , and z, i.e., X = X m , Y = Y m and Z = Z m .
Corollary 2. We have . . , e ′ k }. Proof. By our general supposition that E 0 contains a basis, the set X is a basis for M . Since, by Lemma 4, Z is independent and X ⊆ Z, we have X = Z. Again, by Lemma  Then e * = e l for some l ∈ [k].
Assume that there is some j > i such that e ′ j ∈ C i . Then pos(e j ) > pos(e i ) and thus w(e j ) w(e i ). From (2) and e ′ j in C i \ E 0 , we obtain w(e ′ i ) w(e ′ j ). Consequently, w(e j ) − w(e ′ j ) w(e i ) − w(e ′ i ), a contradiction to the ordering of E. where the maximum extended over an empty set is defined to be −∞.
Assume that there is no circuit in (X \ {e 1 , . . . , e i−1 }) ∪ {e ′ 1 , . . . , e ′ i } containing e i . Then we choose a circuit C in X ∪ {e ′ 1 , . . . , e ′ i } containing e i such that µ i C is minimal. By our assumption, µ i C is finite and there exists an integer l ∈ [i − 1] such that e l ∈ C i and pos(e l ) = µ i C . The circuit C l also contains e l and is contained in X ∪ {e ′ 1 , . . . , e ′ i } in view of Lemma 6 and l < i. Note that pos(e) < pos(e l ) for all e ∈ C l − e l . But there is also a circuit C ⊆ C ∪ C l − e l . Obviously, C ⊆ X ∪ {e ′ 1 , . . . , e ′ i } and µ i C < µ i C , a contradiction to the choice of C.
is an optimal exchange pair for (X i−1 , Y ). Proof. Assume that (e i , e ′ i ) is not optimal. Then there is a better exchange pair (ê,ê ′ ) for ( Let C be the unique circuit in X i−1 + e ′ j (containingê) and let e * = arg max{pos(e) : e ∈ C}. Then w(e * ) w(ê). By Lemma 5, e * = e l for some l ∈ [k]. In particular, e * = e ′ j and thus (e * , e ′ j ) is also an exchange pair for (X i−1 , Y ). Since e 1 , . . . , e i−1 / ∈ X i−1 , We have (with e * = e l ) w(e l ) − w(e ′ j ) w(ê) − w(e ′ j ) and hence By the ordering of E and by (4), The inequalities (5) and (6) imply w(e ′ j ) < w(e ′ l ).
Let p = pos(e l ). Then pos(e j ) < p, because otherwise w(e j ) w(e l ) and hence, in view of (3) and the ordering of E, a contradiction to (5). Moreover, C ⊆ X p ∪ Y p since e l has maximal position in C. For a circuit C let where the maximum (resp. minimum) extended over an empty set is defined to be −∞ (resp. ∞). For C these values are finite since e ′ j ∈ C and pos(e j ) < p. Hence there is an integer g ∈ [k] such that e ′ g ∈ C, pos(e g ) p and w(e ′ g ) = α p C . Note that Note that C is p-majorized by α p C . Now choose a circuit C * in X p ∪ Y p that contains e l , is p-majorized by α p C and has maximal ν-value. Note that, in view of Lemma 4, We have ν C * p because otherwise C * ∩ H ′p = ∅ and C * would be a circuit in Z p .
Assume that ν C * < p. Then choose q ∈ [k] such that e ′ q ∈ C * and pos(e q ) = ν C * and consider the circuit C q . We have C q ⊆ X p ∪ Y p because of pos(e q ) < p. Moreover, w(e ′ h ) w(e ′ q ) and pos(e h ) pos(e q ) for all h ∈ [k] with e ′ h ∈ C q by the choice of e ′ q in C q and Corollary 3. Since C * is p-majorized by α p C , in particular w(e ′ q ) α p C and thus also C q is p-majorized by α p C . From e ′ q ∈ C * ∩ C q and e l ∈ C * \ C q it follows that there is a circuit C ⊆ C * ∪ C q − e ′ q containing e l . Clearly, C ⊆ X p ∪ Y p and C is p-majorized by α p C . Obviously, min{pos(e h ) : h ∈ [k] and e ′ h ∈ C q ∪ C * } = pos(e q ). Thus ν C > ν C * , a contradiction to the choice of C * . Consequently, ν C * = p. Since e l is the (unique) element of position p, necessarily e ′ l ∈ C * . Because C * is p-majorized by α p C , in particular w(e ′ l ) α p C = w(e ′ g ). From (7) we obtain g = j, hence by (8) and (4), On the other hand, the relation pos(e g ) pos(e l ) implies w(e g ) w(e l ). Consequently, w(e l ) − w(e ′ l ) w(e g ) − w(e ′ g ), and then the ordering of E implies l g, which contradicts (9). Thus our first assumption was false, and the proof is complete.
Let us assume that Algorithm 5 gets as input the elements of E in nondecreasing order of weights. Then in each iteration of the for-loop there are three independence tests, and at most one search for the element e ′ ∈ Z to be removed. This latter step is necessary at most r times and can be  Proof. Constructing minimum spanning trees X and Y takes m log m time. Maintaining the set Z takes m log m time, except for the time taken to search for exchange pairs. It can happen at most n − 1 times that an edge e added to Z creates a cycle, and when that happens, the cycle itself and the edge e ′ ∈ E \ E 0 on the cycle with the largest weight can be found in O(n) time by DFS. This gives a run-time bound of O(max{m log n + n 2 , m log m}) = O(max{n 2 , m log m}).