Fibonacci Heaps: The Potential Function
The Potential Method (Review)
For any data structure, define a potential function that maps each state of the structure to a non-negative real number, with for the initial (empty) state. The amortised cost of an operation is:
where is the actual cost and is the change in potential. Over operations,
so amortised costs upper-bound actual costs.
Fibonacci Heap Potential
The potential function for a Fibonacci heap is:
where:
- = number of trees in the root list (number of roots)
- = number of marked nodes (nodes with
marked = true)
Check: For an empty heap, Create returns (NIL, 0), so , , and (valid initial state, non-negative).
Amortised Analysis of Each Operation
Insert
Actual cost: . The new node is added to the root list as a singleton. It is never marked. increases by 1; unchanged.
Destructive Union
Actual cost: . Root lists are spliced together; no marks change. Combined potential:
Decrease-Key
Three cases depending on whether cutting occurs:
Case 1 — No cut (new key parent’s key): No structural change. , .
Case 2 — Single cut, parent was unmarked: Node x goes to root list ( +1). x becomes unmarked (if it was marked, -1; if not, unchanged). Parent p becomes marked ( +1).
- If
xwas unmarked: - If
xwas marked:
In both cases, , so .
Case 3 — Cascading cut: nodes are cut and moved to root list. Each cut node was marked (so decreases by ). Each enters the root list ( increases by ). The node whose key was decreased also enters the root list ( +1). The final stop may mark one parent ( +1, or 0 if parent is a root).
Actual cost is . Setting (each cut takes constant time):
The cascading work is “paid for” by the decrease in : each cut node was marked, contributing 2 to the potential; when it is unmarked on entering the root list, those 2 units are released to pay for the cut.
Extract-Min
Actual cost: where is the maximum degree and is pre-operation root list size.
- Promote children of min (at most children): each child joins root list, increases by up to .
- One root removed.
- Consolidation scans roots, merging trees of equal degree.
- After consolidation: at most trees remain.
Potential before: . Potential after (worst case): . Change: .
Since (proved by the degree bound), . The large term in actual cost is cancelled by the corresponding decrease in potential (the “credit” that insert and decrease-key built up).
Intuition Behind the Potential
The term pays for scanning the root list during extract-min. Each insert adds 1 to and 1 to potential. The term pays for cascading cuts: when a node is marked, 2 units are deposited; one unit pays for the cut itself, the other for the node now occupying space in the root list (adding to the cost of future extract-min).
Summary
| Operation | Amortised Cost | |
|---|---|---|
| Insert | ||
| Destructive-union | ||
| Decrease-key (no cut) | ||
| Decrease-key (single cut) | or | |
| Decrease-key (cascading) | ||
| Extract-min |
Key insight: The potential captures the “repair work” deferred by lazy insert and decrease-key operations, releasing credit exactly when extract-min needs to perform consolidation.