LLMpediaThe first transparent, open encyclopedia generated by LLMs

Priority queue

Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Ford–Fulkerson method Hop 5 terminal

This article was accepted into the corpus but its outbound wikilinks were never NER-processed — typical at the deepest BFS hop or when the run's entity cap was reached. No expansion funnel to show.

Priority queue
NamePriority queue
TypeAbstract data type
OperationsInsert, extract-min, decrease-key
Typical implementationsBinary heap, Fibonacci heap, pairing heap
Time complexitiesO(log n) for insert/extract, amortized O(1) decrease-key (Fibonacci)

Priority queue

A priority queue is an abstract data type that manages a set of elements each with an associated priority, enabling retrieval of the highest- or lowest-priority element. It underpins algorithms in fields such as graph theory, operating systems, computational geometry, artificial intelligence, and networking, and is implemented in libraries for languages and platforms like C++, Java (programming language), Python (programming language), Linux, and Microsoft Windows. Core research on the structure intersects work by researchers affiliated with institutions such as Massachusetts Institute of Technology, Stanford University, Princeton University, University of California, Berkeley, and companies like Google and Amazon (company).

Overview

A priority queue stores elements where retrieval and removal depend on element priority rather than insertion order, distinguishing it from queue structures used in systems like United States Postal Service logistics or Federal Aviation Administration air-traffic scheduling. It is central to algorithms such as Dijkstra's algorithm and Prim's algorithm developed within the context of conferences like ACM SIGPLAN and IEEE Symposium on Foundations of Computer Science. The abstract model supports operations that are optimized by concrete implementations such as the binary heap attributed to work by researchers at Bell Labs and data-structure advances inspired by seminars at Carnegie Mellon University and École Polytechnique Fédérale de Lausanne.

Implementations

Common implementations include the binary heap, binary search tree variants developed in labs like AT&T Laboratories, the pairing heap introduced by work connected to Bell Laboratories, the Fibonacci heap devised by researchers affiliated with Brown University and University of Waterloo, binomial heap used in early Unix-era toolchains, and monotone priority queues employed in computational geometry toolkits from groups at California Institute of Technology and University of Illinois Urbana–Champaign. Language and platform standard libraries provide implementations: the C++ Standard Template Library offers std::priority_queue, Java (programming language) supplies java.util.PriorityQueue, and Python (programming language) exposes heapq. Research prototypes appear in projects at MIT Computer Science and Artificial Intelligence Laboratory, Microsoft Research, and IBM Research.

Operations and Complexity

Typical operations are insert, peek, extract-min (or extract-max), decrease-key, increase-key, merge, and delete; complexities depend on the implementation. Binary heaps give O(log n) inserts and extracts and O(1) peek, while Fibonacci heaps offer amortized O(1) insert and decrease-key with O(log n) extract, results discussed in papers from venues like ACM Symposium on Theory of Computing and SIAM Journal on Computing. Pairing heaps present practical performance analyzed in work presented at European Symposium on Algorithms and implemented in systems by teams at Oracle Corporation and Red Hat. Complexity analyses reference classical textbooks from publishers such as Addison-Wesley and Prentice Hall.

Applications

Priority queues are used in shortest-path algorithms (Dijkstra, A*), minimum spanning tree algorithms (Prim, Borůvka), event simulation systems in Los Alamos National Laboratory projects, job schedulers in Google datacenters, task queues in Apache Hadoop, routing in Cisco Systems network devices, and real-time systems developed by teams at NASA and European Space Agency. They appear in machine learning frameworks from OpenAI and DeepMind for beam search and in game engines by studios like Electronic Arts and Ubisoft for AI pathfinding. Other uses include financial trading systems at firms such as Goldman Sachs and Citigroup where order books require priority ordering.

Variants and Extensions

Variants include implicit heaps, explicitly keyed structures, double-ended priority queues used in computational finance projects at Morgan Stanley, interval heaps appearing in algorithmic libraries at Bloomberg L.P., and k-ary heaps researched at University of Cambridge. Extensions support meldable priority queues (useful in union-find optimizations), forecast priority queues in streaming systems from Netflix, and concurrent priority queues implemented in multicore research at Intel Corporation and NVIDIA. Specialized adaptations include external-memory priority queues for datasets managed by Hadoop Distributed File System and cache-oblivious variants studied at École Normale Supérieure.

Performance and Practical Considerations

Choice of implementation balances theoretical bounds and real-world factors: cache behavior influenced by CPU architectures from ARM Holdings and Intel Corporation, memory allocation strategies used in glibc or Microsoft Visual C++, and concurrency models in POSIX threads versus Windows API. Profiling by engineering teams at Facebook and Twitter often reveals that simpler structures like binary heaps outperform theoretically superior structures such as Fibonacci heaps for typical input sizes. Library implementations tune for allocator behavior in environments like Android and iOS and for garbage-collected runtimes such as Oracle (company)'s JVM and Google's V8.

History and Development

Foundational ideas trace to early sorting and selection work in the 1950s and 1960s, with key developments appearing in literature from institutions like University of Manchester, University of Cambridge, and Harvard University. The binomial heap and Fibonacci heap emerged from research during the 1970s and 1980s connected to ACM publications and workshops at Bell Labs and Stanford University. Subsequent decades saw engineering-focused advances driven by industrial research labs at IBM Research, Microsoft Research, and Sun Microsystems, with modern concurrent and external-memory variants developed in the 2000s and 2010s by groups at ETH Zurich and University of Toronto.

Category:Data structures