An empirical analysis of algorithms for constructing a minimum spanning tree
 Bernard M. E. Moret,
 Henry D. Shapiro
 … show all 2 hide
Abstract
We compare algorithms for the construction of a minimum spanning tree through largescale experimentation on randomly generated graphs of different structures and different densities. In order to extrapolate with confidence, we use graphs with up to 130,000 nodes (sparse) or 750,000 edges (dense). Algorithms included in our experiments are Prim's algorithm (implemented with a variety of priority queues), Kruskal's algorithm (using presorting or demand sorting), Cheriton and Tarjan's algorithm, and Fredman and Tarjan's algorithm. We also ran a large variety of tests to investigate lowlevel implementation decisions for the data structures, as well as to enable us to eliminate the effect of compilers and architectures.
Within the range of sizes used, Prim's algorithm, using pairing heaps or sometimes binary heaps, is clearly preferable. While versions of Prim's algorithm using efficient implementations of Fibonacci heaps or rankrelaxed heaps often approach and (on the densest graphs) sometimes exceed the speed of the simpler implementations, the code for binary or pairing heaps is much simpler, so that these two heaps appear to be the implementation of choice.
Some conclusions regarding implementation of priority queues also emerge from our study: in the context of a greedy algorithm, pairing heaps appear faster than other implementations, closely followed by binary, rankrelaxed and Fibonacci heaps, the latter two implemented with sacks, while splay trees finish a decided last.
 Cheriton, D., Tarjan, R.E. (1976) Finding minimum spanning trees. SIAM J. Comput. 5: pp. 724742
 Driscoll, J.R., Gabow, H.N., Shrairman, R., Tarjan, R.E. (1988) Relaxed heaps: an alternative to Fibonacci heaps with applications to parallel computation. Comm. ACM 11: pp. 13431354
 Fredman, M.L., Sedgewick, R., Sleator, D.D., Tarjan, R.E. (1986) The pairing heap: a new form of selfadjusting heap. Algorithmica 1: pp. 111129
 Fredman, M.L., Tarjan, R.E. (1987) Fibonacci heaps and their use in improved network optimization algorithms. J. ACM 34: pp. 596615
 Fredman, M.L., and D.E. Willard, “Transdichotomous algorithms for minimum spanning trees and shortest paths,” Proc. 31st Ann. IEEE Symp. Foundations Comput. Sci. FOCS90, pp. 719–725.
 Gabow, H.N., Galil, Z., Spencer, T.H., Tarjan, R.E. (1986) Efficient algorithms for minimum spanning trees on directed and undirected graphs. Combinatorica 6: pp. 109122
 R.L, G., Hell, O. (1985) On the history of the minimum spanning tree problem. Ann. Hist. Comput. 7: pp. 4357
 Jones, D.W. (1986) An empirical comparison of priorityqueue and eventset implementations. Commun. ACM 29: pp. 300311
 Johnson, D.B. (1975) Priority queues with update and finding minimum spanning trees. Inf. Process. Lett. 4: pp. 5357
 Moret, B.M.E., Shapiro, H.D. (1991) Algorithms from P to NP. Volume I: Design and Efficiency. BenjaminCummings, Menlo Park, CA
 Sleator, D.D., and R.E. Tarjan, “Selfadjusting binary trees,” Proc. 15th Ann. ACM Symp. Theory Comput. STOC83, pp. 235–245; also in final form in J. ACM 32 (1985), pp. 652–686.
 Stasko, J.T., Vitter, J.S. (1987) Pairing heaps: experiments and analysis. Commun. ACM 30: pp. 234249
 Tarjan, R.E. (1983) Data Structures and Network Algorithms. SIAM, Philadelphia
 Title
 An empirical analysis of algorithms for constructing a minimum spanning tree
 Book Title
 Algorithms and Data Structures
 Book Subtitle
 2nd Workshop, WADS '91 Ottawa, Canada, August 14–16, 1991 Proceedings
 Pages
 pp 400411
 Copyright
 1991
 DOI
 10.1007/BFb0028279
 Print ISBN
 9783540543435
 Online ISBN
 9783540475668
 Series Title
 Lecture Notes in Computer Science
 Series Volume
 519
 Series ISSN
 03029743
 Publisher
 Springer Berlin Heidelberg
 Copyright Holder
 SpringerVerlag
 Additional Links
 Topics
 Industry Sectors
 eBook Packages
 Editors
 Authors

 Bernard M. E. Moret ^{(1)}
 Henry D. Shapiro ^{(1)}
 Author Affiliations

 1. Department of Computer Science, University of New Mexico, 87131, Albuquerque, NM
Continue reading...
To view the rest of this content please follow the download PDF link above.