The Havel-Hakimi Algorithm

1.If any di>=n then fail

2.If there is an odd number of odd degrees then fail

3.If there is a di<0 then fail

4.If all di=0 then report success

5.Reorder S into non-increasing order

6.Let k=d1

7.Remove d1 from S

8.Subtract 1 from the first k terms remaining of the new sequence

9.Go to step 3 above

原文地址:https://www.cnblogs.com/HaibaraAi/p/3477747.html