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:
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 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.
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.
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.)
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.
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With