Finished detect cycle in directed graph.