Testing the Directed Graph

The string produced by graph.toString():

1 -> 2 -> 4
2 -> 5
3 -> 6 -> 5
4 -> 2
5 -> 4
6 -> 6