Testing the graph and algorithm.