Since every part is deleted at most once, and gets updated (its arcs are added to the tree) at most k times, the total DS update time is O(k × |parts|) = O(n k+1 in ).
algorithm 1 runs in O(|parts| × k + n 2 × n in × (n in + min{n k−1 in , n 2 in })) time.