Can you add a couple tests for the two functions?
Generate an example graph  (binary and weighted) and validate the output dict has the expected values