article

An empirical comparison of priority-queue and event-set implementations

Abstract

Execution times for a variety of priority-queue implementations are compared under the hold model, showing many to be faster than implicit heaps.

References

  1. 1 Aho, A.V., Hopcroft, J., and Ullman, J. The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading, Mass., 1974. Sections 4.94.11. A discussion of applications of 2-3 trees to priority queues. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 2 Bentley, J. Programming pearls: Thanks, heaps. Commun. ACM 28,3 (Mar. 1965), 245-250. Clear introduction to implicit heaps for sorting and priority queues. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. 3 Blackstone, J.H. Hogg. G.L., and Phillips, D.T. A two-list synchronization procedure for discrete event simulation. Commun. ACM 24, 12 (Dec. 1981), 625-829. A priority-queue implementation is described and recommended as the best choice for general use. The recommendation is disputed in Ill}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 4 Brown, M.R. The analysis of a practical and nearly optimal priority queue. Comput. Sci. Rep. STAN-CS-77-600, Dept. of Computer Science, Stanford Univ., Calif., Mar. 1977. This is the same as {5}, but with an appendix containing working SAIL code.Google ScholarGoogle Scholar
  5. 5 Brown, M.R. Implementation and analysis of binomial queue algorithms. SIAM 1. Comput. 7.3 (Aug. 1976). 298-319. An assortment of implementations of binomial queues is presented along with a detailed performance analysis and empirical comparisons with leftist trees and heaps.Google ScholarGoogle Scholar
  6. 6 Francon. J., Viennot, G., and Vuillemin, J. Description and analysis of an efficient priority queue representation. In Proceedings of the 19th Annual Symposium on Foundations of Computer Science (Ann Arbor, Mich. Oct. 16-18). IEEE, Piscataway, N.J. 1978, pp. Z-7. (Also published as IRIA Rapport de Recherche No 287.) The original presentation of pagodas.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 7 Franta, W.R. and Maly, K. A comparison of heaps and the TL structure for the simulation event set. Commun. ACM 21, 10 (Oct. 19781, 873-875. Claim, based on empirical data, that the TL implementation runs in O(1) time, later disputed by {ll} and {19}; convincing data presented comparing three heap implementations under the hold model. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 8 Fredman, M.L., Sedgewick, R., Sleator. D. and Tarjan, R. The pairing heap: A new form of self-adjusting heap. Submitted for publication. Pairing heaps and their variants are described and analyzed.Google ScholarGoogle Scholar
  9. 9 Gordon, G. The development of the general-purpose simulation system (GPSS). ACM Hist. Program. Lang. Conj., SZGPLAN Not. 13. 8 (Aug. 1978), 163-196. (Edited by R.L. Wexelblat and republished in the ACM Monograph Series by Academic Press, New York, 1981, pp. 403-426.) Sections 3.5 and 4.6. The history of the requirement for a stable event set in discrete event simulation is presented (all in terms of linear lists). Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 10 Henriksen. J.O. An improved events list algorithm. In Proceedings of the 2977 Winter Simulation Conference (Gaithersburg, Md., Dec. 5-7). IEEE, Piscataway, N.J., 1977, pp. 547-557. A new implementation is described, and empirical measurements are presented. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 11 Henriksen, J.O. Event list management-A tutorial. In Proceedings of the 7983 Winter Simulation Conference {Arlington, Va. Dec. 12-14). IEEE, Piscataway, N.J., 1983, pp. 543-551. A tutorial introduction to the event set, the hold model, and Henriksen's implementation; attacks claims made in {3} and {7}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 12 Jonassen, A. Priority queue processes with biased insertion of exponentially distributed input keys. Rep. 14, Univ. of Oslo Institute of Informatics, Norway, May 1977, ISBN 82-90230-02-8. Clear description of the hold model. Proof that the exponential distribution results in a uniform insertion distribution in the steady state.Google ScholarGoogle Scholar
  13. 13 Jonassen, A., and Dahl, O.J. Analysis of an algorithm for priority queue administration. BIT 15, 4 (1975). 409422. Presents the p-tree algorithm, an analysis (later disputed in {15}), and comparisons under the hold model with implicit heaps, leftist trees, AVL-trees, and linear lists.Google ScholarGoogle ScholarCross RefCross Ref
  14. 14 Jones, D.W. Concurrent operations on priority queues. Submitted for publication. Skew heaps allow priority-queue operations in O(1) time given O(log n) processors in a shared-memory environment.Google ScholarGoogle Scholar
  15. 15 Kingston, J.H. Analysis of algorithms for the simulation event list. Ph.D. thesis, Basser Dept. of Computer Science, Univ. of Sydney, Australia, July 1984. Average case analysis of binary trees, p-trees, and Henriksen's under the hold model.Google ScholarGoogle Scholar
  16. 16 Kingston, J.H. Analysis of tree algorithms for the simulation event list. Acfa Inj 22, 1 (Apr. 1985), 15-33. Partial presentation of material from {15}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 17 Kingston, J.H. The amortized complexity of Henriksen's algorithm. Comput. Sci. Tech. Rep. 85-06, Dept. of Corn P uter Science, Univ. of Iowa, Iowa City, July 1985. Proof of an O(n' ') amortized bound.Google ScholarGoogle Scholar
  18. 18 Knuth. D.E. The Art of Computer Programming. Vol. 3, Sorting and Searching. Addison-Wesley, Reading, Mass., 1973. Section 5.2.3 discusses heapsort and leftist trees: section 6.2.3 discusses AVL trees. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. 19 McCormack, W.M. and Sargent, R.G. Analysis of future event-set algorithms for discrete event simulation. Commun. ACM 24, 12 (Dec. 1981), 801-812. Empirical comparisons, under the hold model and in discrete event simulation models, of implicit heaps, Henriksen's, and older implementations. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. 20 Nix, R. An evaluation of pagodas. Res. Rep. 164, Dept. of Computer Science, Yale Univ., New Haven, Conn., no date. Analysis and empirical comparisons with binomial queues, heaps, and leftist trees. Well-commented PDP-10 assembly language code is given.Google ScholarGoogle Scholar
  21. 21 Sleator, D.D. and Tarjan, R.E. Self-adjusting binary trees. In Proceedings of the ACM SIGACT Symposium on Theory of Computing (Boston, Mass., Apr. 25-27). ACM, New York, 1983, pp. 235-245. Original presentation and amortized complexity analysis of skew heaps and splay trees. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 22 Sleator, D.D., and Tarjan. R.E. Self adjusting heaps. SIAM}. Comput. To be published. Expansion of the material on skew heaps from {21} Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. 23 Tarjan, R.E., and Sleator, D.D. Self-adjusting binary search trees. 1. ACM 32, 3 (July 1985). 652-886. Expansion of the material on splay trees from {21}. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. 24 Vuillemin, J. A data structure for manipulating priority queues. Commun. ACM 21,4 (Apr. 1978), 309-315. Original presentation of binomial queues: code presented is very hard to follow. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. 25 Williams, J.W.J. Algorithm 232: Heapsort. Commun. ACM 7, 6 (June 1964), 347-348. Original presentation of implicit heaps.Google ScholarGoogle Scholar

Index Terms

  1. An empirical comparison of priority-queue and event-set implementations

              Reviews

              John Bradley Evans

              A comparison is made of algorithms for operations on the priority queue, with special regard given to the implementation of primitive future-event set operations in a discrete-event simulation. The test vehicle is the familiar hold model which typifies simulation operations as consisting of one insertion and one removal of a future-event notice into the set. Five event-scheduling distributions are used in the tests. Three groups of algorithms are investigated. The linear list, implicit heap, and leftist tree are the so-called “classical implementations.” The two-list of Blackstone et al. [1] and Henriksen's indexed linear list [3] are “special-purpose implementations.” Thirdly, the “nearly optimal” implementations (binomial queues, pagodas, skew heaps, splay trees, and pairing heaps) are a group of fairly new algorithms associated with either Robert Tarjan or Jean Vuillemin. The experiments were carried out primarily on a VAX 11/780, with the effect of a different architecture and/or Pascal compiler being cross-checked by further measurements on an HP 9836 and a Prime 850. The conclusions are, as is normal with comparisons of this type, fairly equivocal. No single algorithm performed best over all distributions and the range of future-event set sizes. One may say there are two competitors for the best overall performance: the splay tree and Henriksen's indexed list, with binomial queue a good third. Although an application of new algorithms in an established field, this paper lacks a proper description of the algorithms being compared. All we get is a superficial dismissal in a rather tortuous, unnatural English style, or a reference to elsewhere. Whatever happened to algorithmic languages__?__ Such an important omission detracts considerably from the value of the paper. The experimental methodology is well described, but a close reading suggests that there is some uncertainty in the technique. While correctly noting that the steady-state distribution of the queue is dependent on the scheduling (“priority increment”) distribution in use, Jones is vague about whether the same initial queue was used for each distribution condition, as an unbiased method would demand. Vagueness obscures a fundamental dilemma here. Either the initial queue should be matched individually to the expected distribution of queue-elements, or each distribution condition should be treated equally with an identical initial queue. Perhaps the resolution may lie in a consideration of the effective scheduling distribution typical of simulation practice. It is rare that a single scheduling distribution applies to all the events generated in a simulation. More likely, it is that each component activity will have its own particular distribution, appropriately parameterized. The future-event set then contains event notices derived from a mixture of distributions. An appeal to information theory would suggest that the exponential distribution would best characterize the uncertainty of the situation. A simple experiment will verify the tendency of the distribution of event notices to the exponential under mixtures of scheduling distributions. Lack of space prevents mention of further omissions, doubtful interpretations, and obscurities, except perhaps to wonder whether simpler tree methods without balancing might be as effective as a splay tree (see Evans [2]). Despite these adverse criticisms, this is a stimulating, if incomplete, paper, especially in its attempt to introduce new methods and machine-architecture considerations. Hopefully, it will go some way towards bridging the divide between theoretical and practical studies of algorithms.

              Access critical reviews of Computing literature here

              Become a reviewer for Computing Reviews.

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!