graph theory algorithms 243592