I'm afraid I do not know a lot about this algorithm, but I believe that G={f_1,f_2,f_3,f_4} before the second while loop is entered. The first while loop does not stop until F is empty. It is also pretty clear that the labelling of f_1 to f_4 are backwards in the paper on page 14 -- that is, f_4...