question: public Graph next ( ) { ++ index ; if ( index < graphs . size ( ) ) { return graphs . get ( index ) ; } else { return null ; } }
target:  Successive calls to this method return successive DAGs in the pattern, in a more or less natural enumeration of them in which an arbitrary undirected edge is picked, oriented one way, Meek rules applied, then a remaining unoriented edge is picked, oriented one way, and so on, until a DAG is obtained, and then by backtracking the other orientation of each chosen edge is tried. Nonrecursive, obviously. <p>