added Havel-Hakimi algorithm