19.4 Bounding the maximum degree
19.4-1
Professor Pinocchio claims that the height of an n-node Fibonacci heap is O(lgn). Show that the professor is mistaken by exhibiting, for any positive integer n, a sequence of Fibonacci-heap operations that creates a Fibonacci heap consisting of just one tree that is a linear chain of n nodes.
- Initialize: insert 3 numbers then extract-min.
- Iteration: insert 3 numbers, in which at least two numbers are less than the root of chain, then extract-min. The smallest newly inserted number will be extracted and the remaining two numbers will form a heap whose degree of root is 1, and since the root of the heap is less than the old chain, the chain will be merged into the newly created heap. Finally we should delete the node which contains the largest number of the 3 inserted numbers.
19.4-2
Suppose we generalize the cascading-cut rule to cut a node x from its parent as soon as it loses its kth child, for some integer constant k. (The rule in Section 19.3 uses k=2.) For what values of k is D(n)=O(lgn)?
Following the proof of lemma 19.1, if x is any node if a Fibonacci heap, x.degree=m, and x has children y1,y2,…,ym, then y1.degree≥0 and yi.degree≥i−k. Thus, if sm denotes the fewest nodes possible in a node of degree m, then we have s0=1,s1=2,…,sk−1=k and in general, sm=k+∑i=0m−ksi. Thus, the difference between sm and sm−1 is sm−k.
Let {fm} be the sequence such that fm=m+1 for 0≤m<k and fm=fm−1+fm−k for m≥k.
If F(x) is the generating function for fm then we have F(x)=(1−x)(1−x−xk)1−xk. Let α be a root of xk=xk−1+1. We'll show by induction that fm+k≥αm. For the base cases:
fkfk+1fk+k=k+1≥1=α0=k+3≥α1⋮=k+2(k+1)(k+2)=k+k+1+2k(k+1)≥2k+1+αk−1≥αk.
In general, we have
fm+k=fm+k−1+fm≥αm−1+αm−k=αm−k(αk−1+1)=αm.
Next we show that fm+k=k+∑i=0mfi. The base case is clear, since fk=f0+k=k+1. For the induction step, we have
fm+k=fm−1−k+fm=ki=0∑m−1fi+fm=k+i=0∑mfi.
Observe that si≥fi+k for 0≤i<k. Again, by induction, for m≥k we have
sm=k+i=0∑m−ksi≥k+i=0∑m−kfi+k≥k+i=0∑mfi=fm+k.
So in general, sm≥fm+k. Putting it all together, we have
size(x)≥sm≥k+i=k∑msi−k≥k+i=k∑mfi≥fm+k≥αm.
Taking logs on both sides, we have
logαn≥m.
In other words, provided that α is a constant, we have a logarithmic bound on the maximum degree.