Fibonacci - Fibonacci Heaps CLRS: Chapter 20 Last Revision:...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Fibonacci Heaps CLRS: Chapter 20 Last Revision: 21/09/04 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Binary heap Binomial heap Fibonacci heap Procedure (worst-case) (worst-case) (amortized) Make-Heap Θ(1) Θ(1) Θ(1) Insert Θ(lg n ) O (lg n ) Θ(1) Minimum Θ(1) O (lg n ) Θ(1) Extract-Min Θ(lg n ) Θ(lg n ) O (lg n ) Union Θ( n ) O (lg n ) Θ(1) Decrease-Key Θ(lg n ) Θ(lg n ) Θ(1) Delete Θ(lg n ) Θ(lg n ) O (lg n ) So far we have seen Binomial heaps and learnt some techniques for performing amortized analysis . In this section we will design Fibonacci heaps , whose running times will be amortized and not worst case. Even with only amortized running times, Fibonacci heaps provide enough of an improvement to reduce the run- time of Dijkstra’s and Prim’s algorithms from ( | V | + | E | )log | V | down to | V | log | V | + | E | . Our amortized analysis will use the Potential method. 2
Background image of page 2
Fibonacci heaps , like Binomial heaps , are a collection of heap-ordered trees. Some properties nodes in a F.H are not ordered (by degree) in the root list or as siblings. (root and sibling) lists kept as circularly-linked lists. Allows constant time deletion/insertion/concatenation. Each node stores its degree (number of children). min [ H ] is a pointer to minimum root in root list. N ( H ) keeps number of nodes currently in H . 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
23 7 18 3 39 52 38 41 17 30 26 24 35 46 min[H] Marked Nodes: Some nodes will be marked (indicated by the marked bit set to 1 ). (i) A node x will be marked if x has lost a child since the last time that x was made a child of another node. (ii) Newly created nodes are unmarked (iii) When node x becomes child of another node it becomes unmarked. Potential Function: The potential of H will be t ( H ) , the number of nodes in root list of H plus two times m ( H ) , the number of marked nodes . Φ( H ) = t ( H ) + 2 m ( H ) . In example above Φ( H ) = 5 + 2 · 3 = 11 . 4
Background image of page 4
23 7 18 3 39 52 38 41 17 30 26 24 35 46 min[H] Assumption: There is a maximum degree D ( n ) on the degree of any node in an n -node Fibonacci heap. We will prove later that D ( n ) = O (log n ) . 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7 18 3 39 52 38 41 17 30 26 24 35 46 min[H] Make-Heap(): This is a very easy O (1) (both amortized and actual) operation. Minimum( H ): Return the node pointed to by min [ H ] . This takes O (1) actual time. The heap does not change before and after this oper- ation so difference in potential is 0 . Amortized cost is then also O (1) . 6
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/09/2010 for the course CS 12345 taught by Professor Thomas during the Spring '10 term at École Normale Supérieure.

Page1 / 26

Fibonacci - Fibonacci Heaps CLRS: Chapter 20 Last Revision:...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online