0% found this document useful (0 votes)
58 views16 pages

Fibonacci Heaps

Fibonacci heaps are collections of min-heap-ordered trees where trees are unordered and linked together in a root list. Each node has pointers to its parent, children, and siblings. Operations like insert, delete minimum, decrease key, and union run in O(log n) amortized time due to the potential function accounting for number of trees and marked nodes.

Uploaded by

Vaibhav Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views16 pages

Fibonacci Heaps

Fibonacci heaps are collections of min-heap-ordered trees where trees are unordered and linked together in a root list. Each node has pointers to its parent, children, and siblings. Operations like insert, delete minimum, decrease key, and union run in O(log n) amortized time due to the potential function accounting for number of trees and marked nodes.

Uploaded by

Vaibhav Gautam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Fibonacci Heaps

Fibonacci Heap
Like a binomial heap, a Fibonacci heap is a collection of min-heap-ordered trees.
However, the trees in a Fibonacci heap are not constrained to be binomial trees.
Properties of Fibonacci Heap
 Trees within Fibonacci heaps are rooted but unordered.
 Each node x contains a pointer p[x] to its parent and a pointer child[x] to any
one of its children. The children of x are linked together in a circular, doubly linked
list, which we call the child list of x.
 Each child y in a child list has pointers left[y] and right[y] that point to y’s left
and right siblings, respectively. If node y is an only child, then left[y] = right[y] = y. The
order in which siblings appear in a child list is arbitrary.
 The number of children in the child list of node x is stored in degree[x].
 The boolean-valued field mark[x] indicates whether node x has lost a child since
the last time x was made the child of another node. Newly created nodes are
unmarked, and a node x becomes unmarked whenever it is made the child of
another node.
 A given Fibonacci heap H is accessed by a pointer min[H] to the root of a tree
containing a minimum key; this node is called the minimum node of the Fibonacci
heap. If a Fibonacci heap H is empty, then min[H] = NIL.
 The roots of all the trees in a Fibonacci heap are linked together using their
left and right pointers into a circular, doubly linked list called the root list of the
Fibonacci heap. The pointer min[H] thus points to the node in the root list whose
key is minimum. The order of the trees within a root list is arbitrary.
 We rely on one other attribute for a Fibonacci heap H: the number of nodes
currently in H is kept in n[H].
Potential of Fibonacci Heap
Potential method is used to analyze the performance of Fibonacci heap
operations. For a given Fibonacci heap H, we indicate by t(H) the
number of trees in the root list of H and by m(H) the number of marked
nodes in H. The potential of Fibonacci heap H is then defined by
Ф(H) = t(H) + 2*m(H)

For example, the potential of the Fibonacci heap shown in above


Figure is Ф(H)= 5 + 2*3 = 11
Operations on Fibonacci Heap
• Creating a new Fibonacci heap
• Inserting a node
• Finding the minimum node
• Uniting two Fibonacci heaps
• Extracting the minimum node
• Decreasing a key
• Deleting a node
Creating a Fibonacci Heap
Inserting a node
Extracting the node with minimum key
Decreasing a key
Decreasing a key
Deleting a key

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy