(a survey on) priority queues
DESCRIPTION
(A Survey on) Priority Queues. Gerth Stølting Brodal Aarhus Universty. IanFest , University of Waterloo, Waterloo, Ontario , Canada, August 14-15, 2013. Program. Ian Munro : A Constant Time Priority Queue Gerth Brodal : A Constant Time Priority Queue. Priority Queue. - PowerPoint PPT PresentationTRANSCRIPT
(A Survey on) Priority Queues
IanFest, University of Waterloo, Waterloo, Ontario, Canada, August 14-15, 2013
Gerth Stølting BrodalAarhus Universty
2
ProgramIan Munro : A Constant Time Priority QueueGerth Brodal : A Constant Time Priority Queue
3
Priority Queue
InsertExtractMi
n
FindMinDeleteDecreaseKeyMeldExtractMax (double-ended priority queue)
4Communications of the ACM (1962)
42 7 66 13
7 13
71
2 3
4 5 6 7,4 ,5 ,6 ,7
,5
,5
,7
7,5 7,5 13,742,4 7,5 66,613,71 2 3 4 5 6 7
13
42
5
Com
mun
icati
ons
of th
e AC
M (1
964)
6
1 2 3 4 5 6
Heap
3 66 42
5 7
2
2 5 7 3 66 42
• Simple• Implicit – single array of size n• Insert and ExtractMin O(log n) Willliams (1964)• Construction O(n) Floyd(1964)• Insert (loglog n) comparisons Gonnet, Munro (1986)• Select k smallest in O(k) time Frederickson (1993)
7
Comparison Lower Bound
n x Insert + n x ExtractMin Sorting
Insert or ExtractMin (log n) comparisons
ComparisonsInsert ExtractMin
Heap O(log n) O(log n)Binary search O(log n) 0
Carlsson, Munro, Poblette (1988) O(1) O(log n)
8
Priority Queues Directions of Research
Comparisonsvs
Bit-tricks
Single processorvs
Parallel
RAMvs
Hierarchical memory
Implicitvs
Space wasting
Insert-ExtractMin
vsDecreaseKey,
Meld,…
Weakvs
Strong
Ovs
Constants
Simplicityvs
Let’s-do-something-complicated
Worst-casevs
Amortized
Theoryvs
Implementation
Awarevs
Oblivious
9
Open Problem
Strongly implicit priority queue
worst-caseO(1) Insert and O(log n) ExtractMin
supporting identical elementsO(1) swaps per operation
and cache oblivious optimal ?
Can only store n + array
between operations
Insert ExtractMin
Implicit Swaps
Identical elements
Cache oblivious
Heaps log n log n Strong log n Yes
Carlsson, Munro, Poblette (1988) 1 log n Weak log n YesArge, Bender, Demaine, Holland-Minkley, Munro (2002) log n log n log n Yes Yes
Munro, Franceschini (2006) log n log n Strong 1Harvey, Zatloukal (2004) 1 log n Strong log n YesBrodal, Nielsen, Truelsen (2013) 1 log n Strong log n
Open 1xx
log nxx
Strong 1
x
Yes Yesx
(Some Random) Results
10
amortized bounds
Implicit dictionary O(n) Munro, Suwanda (1980)
O(log2 n) Munro (1986)O(log2 n/loglog n) Franceschini, Grossi, Munro, Pagli (2004)
11
Some Observations
42 66 66 42
Bit = 1 Bit = 0
66 66
???
Pair encoding: Munro (1986)
2log n elements can encode a pointer
O(log n) time allows pointer manipulations
Strict implicit + O(1) insertions
Insertions ”close to oblivious”
12
Strict Implicit Priority QueueO(1) Insert and O(log n) ExtractMin
• Forest, trees powers-of-2• Looser trees• Pair-encode bits at nodes• Insertions balance using LSB(n)
…work in progress Brodal, Nielsen, Truelsen (2013)
Insert ExtractMin
Implicit Swaps
Identical elements
Cache oblivious
Heaps log n log n Strong log n Yes
Carlsson, Munro, Poblette (1988) 1 log n Weak log n YesArge, Bender, Demaine, Holland-Minkley, Munro (2002) log n log n log n Yes Yes
Munro, Franceschini (2006) log n log n Strong 1Harvey, Zatloukal (2004) 1 log n Strong log n YesBrodal, Nielsen, Truelsen (2013) 1 log n Strong log n
Open 1xx
log nxx
Strong 1
x
Yes Yesx
(Some Random) Results
13
amortized bounds
Implicit dictionary O(n) Munro, Suwanda (1980)
O(log2 n) Munro (1986)O(log2 n/loglog n) Franceschini, Grossi, Munro, Pagli(2004)
Thank You !