data structures using extracting the node with minimum key the process of extracting the node with minimum value from fibonacci heap is the most complicated operation of all the operations that we have discussed so far till nowwe had been delaying the work of consolidating the treesbut in this operationwe will finally implement the consolidation process the algorithm to extract the node with minimum value is given in fig in the extract-min_fib-heap algorithmwe first make root out of each of the minimum node' children and then remove the minimum node from the root list of finallythe root list of the resultant fibonacci heap is consolidated by linking the roots of equal degree until at most one root remains of each degree note that in step we save pointer to the minimum nodethis pointer is returned at the end howeverif nullthen the heap is already empty otherwisethe node is deleted from by making all its children the roots of and then removing from the root list (as extract-min_fib-heap(hdone in step if right[ ]then is the step set min[honly node on the root listso now is empty step if !nullthen howeverif !right[ ]then we set the for each child ptr of add ptr to the root list of and pointer min[hto the node whose address is parent[ptrnull stored in the right field of remove from the root list of [end of ifstep if right[ ]then set min[hnull else set min[hright[xconsolidate( [end of ifstep set [hn[ step return figure algorithm to extract the node with minimum key consolidate(hstep repeat for = to ( [ ])set [inull step repeat steps to for each node in the root list of step set ptr step set deg degree[ptrstep repeat steps to while [deg!null step set temp [degstep if val[ptrval[temp]then step exchange ptr and temp step link_fib-heap(htempptrstep set [degnull step set deg deg step set [degptr step set min[hnull step repeat for to ( ( ]step if [ !nullthen step add [ito the root list of step if min[hnull or val[ [ ]val[min[ ]]then step set min[ha[istep end figure algorithm to consolidate fibonacci heap consolidating heap fibonacci heap is consolidated to reduce the number of trees in the heap while consolidating the root list of hthe following steps are repeatedly executed until every root in the root list has distinct degree value find two roots and in the root list that has the same degree and where val[xps val[ylink to that isremove from the root list of and make it child of this operation is actually done in the link_fib-heap procedure finallydegree[xis incremented and the mark on yif anyis cleared in the consolidate algorithm shown in fig we have used an auxiliary array [ ( [ ])]such that if [ixthen is currently node in the root list of and degree[ ] in step we set every entry in the array to null when step is overwe get tree that is rooted at some node initiallythe array entry [degree[ ]is set to point to in the for loopeach root node in is examined in each iteration of the while loopa[dpoints to some root temp because degree[ptrdegree[temp]so these two