Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do Fibonacci heaps need cascading cuts?

I'm learning f-heap from 'introduction to algorithms', and the 'decrease-key' operation really confuses me -- why does this need a 'cascading-cut' ?

if this operation is removed:

  1. the cost of make-heap(), insert(), minimum() and union() remains obviously unchanged
  2. extract-min() is still O(D(n)), because in the O(n(H)) 'consolidate' operation, the cost of most rooted trees can be payed when they were added to the root list, and the remaining costs O(D(n))
  3. decrease-key(): obviously O(1)

As for D(n), though i can't explain it precisely, i think it is still O(lgn), cuz without 'cascading-cut', a node may just be moved to root list a bit later, and any node hides under its father does not affect the efficiency. At least, this will not make the situation worse.

apologize for my poor english :(

anyone can help? thanks

like image 979
exprosic Avatar asked Apr 11 '13 04:04

exprosic


People also ask

How do Fibonacci heaps work?

Like binomial heaps, Fibonacci heaps use doubly linked lists to allow for O ( 1 ) O(1) O(1) time for operations such as splicing off a part of a list, merging two lists, and finding the minimum (or maximum) value. Each node contains a pointer to its parent and any one of its children.

Why are nodes marked in Fibonacci heap?

The marking step in the Fibonacci heap allows the data structure to count how many children have been lost so far. An unmarked node has lost no children, and a marked node has lost one child.

What is potential of Fibonacci heap?

The potential function for Fibonacci heaps is almost as simple as that for binomial heaps: the number of trees in the forest, plus twice the number of marked nodes. (The potential for marked nodes is only important for proving that decrease-key takes constant amortized time.)

What is the maximum degree of any node in an node Fibonacci heap?

The maximum degree D(n) of any node in an n-node Fibonacci heap is O(lg n). Proof Let x be any node in an n-node Fibonacci heap, and let k = degree[x]. By Lemma 21.3, we have n size(x) k. Taking base- logarithms yields k log n.


1 Answers

The reason for the cascading cut is to keep D(n) low. It turns out that if you allow any number of nodes to be cut from a tree, then D(n) can grow to be linear, which makes delete and delete-min take linear time.

Intuitively, you want the number of nodes in a tree of order k to be exponential in k. That way, you can have only logarithmically many trees in a consolidated heap. If you can cut an arbitrary number of nodes from a tree, you lose this guarantee. Specifically, you could take a tree of order k, then cut all of its grandchildren. This leaves a tree with k children, each of which are leaves. Consequently, you can create trees of order k with just k + 1 total nodes in them. This means that in the worst case you would need a tree of order n - 1 to hold all the nodes, so D(n) becomes n - 1 rather than O(log n).

Hope this helps!

like image 136
templatetypedef Avatar answered Oct 07 '22 14:10

templatetypedef