The tests are incomplete: you should try graphs with 4 nodes and use different node names with different sort orders.