optimization: As checking for the existence of an edge is O(outdegree) on the
transitive closure, we can just do a search