Fixes and refactoring in the graph tests

I was using the wrong input format in the `MultiSourceShortestPathTest`, which was causing the test to fail. All tests pass now.