Directed graphs, breadth first search, and directed cycle algorithms