if you coerce your graph into a weightedGraph (even if binary) you could reuse the code for weighted and unweighted graphs