19-1 Alternative implementation of deletion

Professor Pisano has proposed the following variant of the FIB-HEAP-DELETE\text{FIB-HEAP-DELETE} procedure, claiming that it runs faster when the node being deleted is not the node pointed to by H.minH.min.

cpp PISANO-DELETE(H, x) if x == H.min FIB-HEAP-EXTRACT-MIN(H) else y = x.p if y != NIL CUT(H, x, y) CASCADING-CUT(H, y) add x's child list to the root list of H remove x from the root list of H

a. The professor's claim that this procedure runs faster is based partly on the assumption that line 7 can be performed in O(1)O(1) actual time. What is wrong with this assumption?

b. Give a good upper bound on the actual time of PISANO-DELETE\text{PISANO-DELETE} when xx is not H.minH.min. Your bound should be in terms of x.degreex.degree and the number cc of calls to the CASCADING-CUT\text{CASCADING-CUT} procedure.

c. Suppose that we call PISANO-DELETE(H,x)\text{PISANO-DELETE}(H, x), and let HH' be the Fibonacci heap that results. Assuming that node xx is not a root, bound the potential of HH' in terms of x.degreex.degree, cc, t(H)t(H), and m(H)m(H).

d. Conclude that the amortized time for PISANO-DELETE\text{PISANO-DELETE} is asymptotically no better than for FIB-HEAP-DELETE\text{FIB-HEAP-DELETE}, evenwhen xH.minx \ne H.min.

a. It can take actual time proportional to the number of children that xx had because for each child, when placing it in the root list, their parent pointer needs to be updated to be NIL\text{NIL} instead of xx.

b. Line 7 takes actual time bounded by x.degreex.degree since updating each of the children of xx only takes constant time. So, if cc is the number of cascading cuts that are done, the actual cost is O(c+x.degree)O(c + x.degree).

c. We examine the number of trees in the root list t(H)t(H) and the number of marked nodes m(H)m(H) of the resulting Fibonacci heap HH' to upper-bound its potential. The number of trees t(H)t(H) increases by the number of children xx had (=x.degree=x.degree), due to line 7 of PISANO-DELETE(H,x)\text{PISANO-DELETE}(H, x). The number of marked nodes in HH' is calculated as follows. The first c1c - 1 recursive calls out of the cc calls to CASCADING-CUT\text{CASCADING-CUT} unmarks a marked node (line 4 of CUT\text{CUT} invoked by line 5 of CASCADING-CUT\text{CASCADING-CUT}). The final ccth call to CASCADING-CUT\text{CASCADING-CUT} marks an unmarked node (line 4 of CASCADING-CUT\text{CASCADING-CUT}), and therefore, the total change in marked nodes is (c1)+1=c+2-(c - 1) + 1 = -c + 2. Therefore, the potential of H' is

Φ(H)t(H)+x.degree+2(m(H)c+2).\Phi(H') \le t(H) + x.degree + 2(m(H) - c + 2).

d. The asymptotic time is

Θ(x.degree)=Θ(lg(n)),\Theta(x.degree) = \Theta(\lg(n)),

which is the same asyptotic time that was required for the original deletion method.