ancestorQueue.add(v);
while (!ancestorQueue.isEmpty()) {
GraphNode ancestor = ancestorQueue.poll();
Iterator<GraphEdge> edges = ancestor.getEdges(Direction.OUT);
while (edges.hasNext()) {
GraphEdge parent = edges.next();
GraphNode parentNode = parent.getToNode();
if (parentNode.getIdentifier() != ancestor.getIdentifier()) {
if (leftSet.contains(parentNode) || rightSet.contains(parentNode)) {
if (!processed.contains(parentNode)) {
ancestorQueue.add(parentNode);
processed.add(parentNode);