The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Priority Queues This arises, for example, in shortest path computations whenever we discover a shorter route to a vertex v than we had previously established. Thus v has a higher priority of being accessed next. Properly implemented and used, they lead to better performance on very large computations. Still, they are sufficiently complicated that you shouldn't mess with them unless you really know what you are doing. Implementations: LEDA (see Section ) provides a complete collection of priority queues in C++, including Fibonacci heaps, pairing heaps, Emde-Boas trees, and bounded height priority queues. Fibonacci heaps are their default implementation. SimPack/Sim++ is a library of routines for implementing discrete event simulations, built by Robert Cubert and Paul Fishwick, of the University of Florida. Priority queues are integral to such simulations, and Sim++ contains implementations of linked, binary, leftist, and calendar heaps [Bro88]. If you need a priority queue to control a simulation, check out http://www.cis.ufl.edu/ fishwick/simpack/simpack.html. An associated book [Fis95] describes model design using SimPack. Bare bones implementations in C and Pascal of the basic priority queue data structures appear in [GBY91]. Most notable is the inclusion of implementations of exotic priority queues such as P-trees and pagodas. See Section for further details. XTango (see Section ) is an algorithm animation system for UNIX and X-windows, that includes animations of such advanced priority queue data structures as binomial and Fibonacci heaps, as well as a spiffy animation of heapsort. Many textbooks provide implementations of simple priority queues, including [MS91] (see Section ). Algorithm 561 [Kah80] of the Collected Algorithms of the ACM is a Fortran implementation of a heap (see Section ). Notes: Good expositions on efficient heap construction algorithms include [Baa88, Ben86, CLR90, Man89, MT90b]. See [GBY91] for a description of several exotic priority queues. Empirical comparisons between priority queue data structures include [Jon86]. Bounded height priority queues are useful data structures in practice, but they do not have good worstcase performance bounds when arbitrary insertions and deletions are permitted. However, von Emde Boas priority queues [vEBKZ77] support insertion, deletion, search, max, and min operations where each key is an element from 1 to n. file:///E|/BOOK/BOOK3/NODE130.HTM (3 of 4) [19/1/2003 1:30:05]
Priority Queues Fibonacci heaps [FT87] support insert and decrease-key operations in O(1) amortized time, with amortized time extract-min and delete operations. The constant-time decrease-key operation leads to faster implementations of classical algorithms for shortest-paths, weighted bipartite-matching, and minimum-spanning-tree. In practice, Fibonacci heaps are nontrivial to implement and have large constant factors associated with them. However, pairing heaps have been proposed to realize the same bounds with less overhead. Experiments with pairing heaps are reported in [SV87]. Heaps define a partial order that can be built using a linear number of comparisons. The familiar lineartime merging algorithm for heap construction is due to Floyd [Flo64]. In the worst case, 1.625n comparisons suffice [GM86] and comparisons are necessary [CC92]. Related Problems: Dictionaries (see page ), sorting (see page ), shortest path (see page ). Next: Suffix Trees and Arrays Up: Data Structures Previous: Dictionaries Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK3/NODE130.HTM (4 of 4) [19/1/2003 1:30:05]
- Page 303 and 304: Exercises Next: Implementation Chal
- Page 305 and 306: Problems and Reductions Next: Simpl
- Page 307 and 308: Simple Reductions Next: Hamiltonian
- Page 309 and 310: Hamiltonian Cycles Next: Independen
- Page 311 and 312: Independent Set and Vertex Cover pr
- Page 313 and 314: Clique and Independent Set These la
- Page 315 and 316: Satisfiability Mon Jun 2 23:33:50 E
- Page 317 and 318: The Theory of NP-Completeness Next:
- Page 319 and 320: 3-Satisfiability where for , , , an
- Page 321 and 322: Integer Programming Next: Vertex Co
- Page 323 and 324: Integer Programming possible IP ins
- Page 325 and 326: Vertex Cover reduction for the 3-SA
- Page 327 and 328: Other NP-Complete Problems hard. Th
- Page 329 and 330: The Art of Proving Hardness easiest
- Page 331 and 332: War Story: Hard Against the Clock N
- Page 333 and 334: War Story: Hard Against the Clock I
- Page 335 and 336: Approximation Algorithms Next: Appr
- Page 337 and 338: Approximating Vertex Cover Next: Th
- Page 339 and 340: The Euclidean Traveling Salesman Ne
- Page 341 and 342: The Euclidean Traveling Salesman Ne
- Page 343 and 344: Exercises 1. Prove that the low deg
- Page 345 and 346: Data Structures Next: Dictionaries
- Page 347 and 348: Dictionaries Next: Priority Queues
- Page 349 and 350: Dictionaries use a function that ma
- Page 351 and 352: Dictionaries Implementation-oriente
- Page 353: Priority Queues ● Besides access
- Page 357 and 358: Suffix Trees and Arrays Figure: A t
- Page 359 and 360: Suffix Trees and Arrays [GBY91]. Se
- Page 361 and 362: Graph Data Structures algorithms).
- Page 363 and 364: Graph Data Structures including the
- Page 365 and 366: Set Data Structures Next: Kd-Trees
- Page 367 and 368: Set Data Structures parent pointers
- Page 369 and 370: Kd-Trees Next: Numerical Problems U
- Page 371 and 372: Kd-Trees about p. Say we are lookin
- Page 373 and 374: Numerical Problems Next: Solving Li
- Page 375 and 376: Numerical Problems Mon Jun 2 23:33:
- Page 377 and 378: Solving Linear Equations algorithm
- Page 379 and 380: Solving Linear Equations Matrix inv
- Page 381 and 382: Bandwidth Reduction images near eac
- Page 383 and 384: Matrix Multiplication Next: Determi
- Page 385 and 386: Matrix Multiplication The linear al
- Page 387 and 388: Determinants and Permanents Next: C
- Page 389 and 390: Determinants and Permanents exposit
- Page 391 and 392: Constrained and Unconstrained Optim
- Page 393 and 394: Constrained and Unconstrained Optim
- Page 395 and 396: Linear Programming variable assignm
- Page 397 and 398: Linear Programming The book [MW93]
- Page 399 and 400: Random Number Generation Next: Fact
- Page 401 and 402: Random Number Generation is largely
- Page 403 and 404: Random Number Generation Related Pr
Priority Queues<br />
This arises, for example, in shortest path computations whenever we discover a shorter route to a<br />
vertex v than we had previously established. Thus v has a higher priority of being accessed next.<br />
Properly implemented and used, they lead to better performance on very large computations. Still,<br />
they are sufficiently complicated that you shouldn't mess with them unless you really know what<br />
you are doing.<br />
Implementations: LEDA (see Section ) provides a complete collection of priority queues in C++,<br />
including Fibonacci heaps, pairing heaps, Emde-Boas trees, and bounded height priority queues.<br />
Fibonacci heaps are their default implementation.<br />
SimPack/Sim++ is a library of routines for implementing discrete event simulations, built by Robert<br />
Cubert and Paul Fishwick, of the University of Florida. Priority queues are integral to such<br />
simulations, and Sim++ contains implementations of linked, binary, leftist, and calendar heaps [Bro88].<br />
If you need a priority queue to control a simulation, check out http://www.cis.ufl.edu/<br />
fishwick/simpack/simpack.html. An associated book [Fis95] describes model design using SimPack.<br />
Bare bones implementations in C and Pascal of the basic priority queue data structures appear in<br />
[GBY91]. Most notable is the inclusion of implementations of exotic priority queues such as P-trees and<br />
pagodas. See Section for further details.<br />
XTango (see Section ) is an algorithm animation system for UNIX and X-windows, that includes<br />
animations of such advanced priority queue data structures as binomial and Fibonacci heaps, as well as a<br />
spiffy animation of heapsort.<br />
Many textbooks provide implementations of simple priority queues, including [MS91] (see Section ).<br />
<strong>Algorithm</strong> 561 [Kah80] of the Collected <strong>Algorithm</strong>s of the ACM is a Fortran implementation of a heap<br />
(see Section ).<br />
Notes: Good expositions on efficient heap construction algorithms include [Baa88, Ben86, CLR90,<br />
Man89, MT90b]. See [GBY91] for a description of several exotic priority queues. Empirical<br />
comparisons between priority queue data structures include [Jon86].<br />
Bounded height priority queues are useful data structures in practice, but they do not have good worstcase<br />
performance bounds when arbitrary insertions and deletions are permitted. However, von Emde<br />
Boas priority queues [vEBKZ77] support insertion, deletion, search, max, and min operations<br />
where each key is an element from 1 to n.<br />
file:///E|/BOOK/BOOK3/NODE130.HTM (3 of 4) [19/1/2003 1:30:05]