implement graph sort from wikipedia
add friendly references