, Volume 68, Issue 2, pp 337–357 | Cite as

Finding Best Swap Edges Minimizing the Routing Cost of a Spanning Tree

  • Davide Bilò
  • Luciano Gualà
  • Guido ProiettiEmail author


Given an n-node, undirected and 2-edge-connected graph G=(V,E) with positive real weights on its m edges, given a set of k source nodes SV, and given a spanning tree T of G, the routing cost from S of T is the sum of the distances in T from every source sS to all the other nodes of G. If an edge e of T undergoes a transient failure, and one needs to promptly reestablish the connectivity, then to reduce set-up and rerouting costs it makes sense to temporarily replace e by means of a swap edge, i.e., an edge in G reconnecting the two subtrees of T induced by the removal of e. Then, a best swap edge for e is a swap edge which minimizes the routing cost from S of the tree obtained after the swapping. As a natural extension, the all-best swap edges problem is that of finding a best swap edge for every edge of T, and this has been recently solved in O(mn) time and linear space. In this paper, we focus our attention on the relevant cases in which k=O(1) and k=n, which model realistic communication paradigms. For these cases, we improve the above result by presenting an \(\widetilde{O}(m)\) time and linear space algorithm. Moreover, for the case k=n, we also provide an accurate analysis showing that the obtained swap tree is effective in terms of routing cost. Indeed, if the input tree T has a routing cost from V which is a constant-factor away from that of a minimum routing-cost spanning tree (whose computation is a problem known to be in APX), and if in addition nodes in T enjoys a suitable distance stretching property from a tree centroid (which can be constructively induced, as we show), then the tree obtained after the swapping has a routing cost from V which is still a constant-ratio approximation of that of a new (i.e., in the graph deprived of the failed edge) minimum routing-cost spanning tree.


Graph algorithms Minimum routing-cost spanning tree Transient edge failures All-best swap edges problems 



We wish to thank the anonymous reviewers for their helpful suggestions.

This work was partially supported by the PRIN 2008 research project COGENT (COmputational and GamE-theoretic aspects of uncoordinated NeTworks), funded by the Italian Ministry of Education, University, and Research.


  1. 1.
    Ackermann, W.: Zum hilbertschen Aufbau der reellen Zahlen. Math. Ann. 99, 118–133 (1928) CrossRefzbMATHMathSciNetGoogle Scholar
  2. 2.
    Bender, M.A., Farach-Colton, M.: The level ancestor problem simplified. In: Rajsbaum, S. (ed.) Theoretical Informatics, 5th Latin American Symposium (LATIN). Lecture Notes in Computer Science, vol. 2286, pp. 508–515. Springer, Berlin (2002) Google Scholar
  3. 3.
    Booth, H., Westbrook, J.: A linear algorithm for analysis of minimum spanning and shortest-path trees of planar graphs. Algorithmica 11(4), 341–352 (1994) CrossRefzbMATHMathSciNetGoogle Scholar
  4. 4.
    Das, S., Gfeller, B., Widmayer, P.: Computing best swaps in optimal tree spanners. In: Hong, S.-H., Nagamochi, H., Fukunaga, T. (eds.) 19th Int. Symposium on Algorithms and Computation (ISAAC). Lecture Notes in Computer Science, vol. 5369, pp. 716–727. Springer, Berlin (2008) Google Scholar
  5. 5.
    Di Salvo, A., Proietti, G.: Swapping a failing edge of a shortest paths tree by minimizing the average stretch factor. Theor. Comput. Sci. 383(1), 23–33 (2007) CrossRefzbMATHMathSciNetGoogle Scholar
  6. 6.
    Flocchini, P., Enriques, A.M., Pagli, L., Prencipe, G., Santoro, N.: Point-of-failure shortest-path rerouting: computing the optimal swap edges distributively. IEICE Trans. 89-D(2), 700–708 (2006) Google Scholar
  7. 7.
    Gfeller, B., Santoro, N., Widmayer, P.: A distributed algorithm for finding all best swap edges of a minimum diameter spanning tree. In: Pelc, A. (ed.) 21st Int. Symposium on Distributed Computing (DISC). Lecture Notes in Computer Science, vol. 4731, pp. 268–282. Springer, Berlin (2007) Google Scholar
  8. 8.
    Gfeller, B.: Faster swap edge computation in minimum diameter spanning trees. In: Halperin, D., Mehlhorn, K. (eds.) 16th Annual European Symposium on Algorithms (ESA). Lecture Notes in Computer Science, vol. 5193, pp. 454–465. Springer, Berlin (2008) Google Scholar
  9. 9.
    Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput. 13(2), 338–355 (1984) CrossRefzbMATHMathSciNetGoogle Scholar
  10. 10.
    Hershberger, J.: Finding the upper envelope of n line segments in O(nlogn) time. Inf. Process. Lett. 33(4), 169–174 (1989) CrossRefzbMATHMathSciNetGoogle Scholar
  11. 11.
    Johnson, D., Lenstra, J., Kan, A.R.: The complexity of the network design problem. Networks 8(4), 279–285 (1978) CrossRefzbMATHMathSciNetGoogle Scholar
  12. 12.
    Nardelli, E., Proietti, G., Widmayer, P.: Finding all the best swaps of a minimum diameter spanning tree under transient edge failures. J. Graph Algorithms Appl. 5(5), 39–57 (2001) CrossRefzbMATHMathSciNetGoogle Scholar
  13. 13.
    Nardelli, E., Proietti, G., Widmayer, P.: Swapping a failing edge of a single source shortest paths tree is good and fast. Algorithmica 35(1), 56–74 (2003) CrossRefzbMATHMathSciNetGoogle Scholar
  14. 14.
    Nivasch, G.: Improved bounds and new techniques for Davenport–Schinzel sequences and their generalizations. J. ACM 57(3), 1–44 (2010) MathSciNetGoogle Scholar
  15. 15.
    Pagli, L., Prencipe, G.: Brief announcement: distributed swap edges computation for minimum routing cost spanning trees. In: Abdelzaher, T.F., Raynal, M., Santoro, N. (eds.) Principles of Distributed Systems, 13th International Conference (OPODIS). Lecture Notes in Computer Science, vol. 5923, pp. 365–371. Springer, Berlin (2009) Google Scholar
  16. 16.
    Pettie, S.: Sensitivity analysis of minimum spanning trees in sub-inverse-Ackermann time. In: Deng, X., Du, D.-Z. (eds.) 16th Int. Symposium on Algorithms and Computation (ISAAC). Lecture Notes in Computer Science, vol. 3827, pp. 964–973. Springer, Berlin (2005) Google Scholar
  17. 17.
    Tarjan, R.E.: Sensitivity analysis of minimum spanning trees and shortest path trees. Inf. Process. Lett. 14(1), 30–33 (1982) CrossRefMathSciNetGoogle Scholar
  18. 18.
    Wong, R.: Worst-case analysis of network design problem heuristics. SIAM J. Algebr. Discrete Methods 1, 51–63 (1980) CrossRefzbMATHGoogle Scholar
  19. 19.
    Wu, B.Y., Lancia, G., Bafna, V., Chao, K.-M., Ravi, R., Tang, C.Y.: A polynomial-time approximation scheme for minimum routing cost spanning trees. SIAM J. Comput. 29(3), 761–778 (1999) CrossRefMathSciNetGoogle Scholar
  20. 20.
    Wu, B.Y., Chao, K.-M., Tang, C.Y.: Approximation algorithms for some optimum communication spanning tree problems. Discrete Appl. Math. 102(3), 245–266 (2000) CrossRefzbMATHMathSciNetGoogle Scholar
  21. 21.
    Wu, B.Y., Hsiao, C.-Y., Chao, K.-M.: The swap edges of a multiple-sources routing tree. Algorithmica 50(3), 299–311 (2008) CrossRefzbMATHMathSciNetGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC 2012

Authors and Affiliations

  1. 1.Dipartimento di InformaticaUniversità di L’AquilaL’AquilaItaly
  2. 2.Dipartimento di MatematicaUniversità di Tor VergataRomaItaly
  3. 3.Istituto di Analisi dei Sistemi ed InformaticaCNRRomaItaly

Personalised recommendations