public void ruleR0(Graph graph){
  graph.reorientAllWith(Endpoint.CIRCLE);
  fciOrientbk(knowledge,graph,graph.getNodes());
  List<Node> nodes=graph.getNodes();
  for (  Node b : nodes) {
    List<Node> adjacentNodes=graph.getAdjacentNodes(b);
    if (adjacentNodes.size() < 2) {
      continue;
    }
    ChoiceGenerator cg=new ChoiceGenerator(adjacentNodes.size(),2);
    int[] combination;
    while ((combination=cg.next()) != null) {
      Node a=adjacentNodes.get(combination[0]);
      Node c=adjacentNodes.get(combination[1]);
      if (graph.isAdjacentTo(a,c)) {
        continue;
      }
      if (graph.isDefCollider(a,b,c)) {
        continue;
      }
      if (sepsets.isCollider(a,b,c)) {
        if (!isArrowpointAllowed(a,b,graph)) {
          continue;
        }
        if (!isArrowpointAllowed(c,b,graph)) {
          continue;
        }
        graph.setEndpoint(a,b,Endpoint.ARROW);
        graph.setEndpoint(c,b,Endpoint.ARROW);
        if (verbose) {
          logger.log("colliderOrientations",SearchLogUtils.colliderOrientedMsg(a,b,c));
          out.println(SearchLogUtils.colliderOrientedMsg(a,b,c));
          String location="R0";
          printWrongColliderMessage(a,b,c,location,graph);
        }
      }
    }
  }
}

public void ruleR0 ( Graph graph ) { graph . reorientAllWith ( Endpoint . CIRCLE ) ; fciOrientbk ( knowledge , graph , graph . getNodes ( ) ) ; List < Node > nodes = graph . getNodes ( ) ; for ( Node b : nodes ) { List < Node > adjacentNodes = graph . getAdjacentNodes ( b ) ; if ( adjacentNodes . size ( ) < 2 ) { continue ; } ChoiceGenerator cg = new ChoiceGenerator ( adjacentNodes . size ( ) , 2 ) ; int [ ] combination ; while ( ( combination = cg . next ( ) ) != null ) { Node a = adjacentNodes . get ( combination [ 0 ] ) ; Node c = adjacentNodes . get ( combination [ 1 ] ) ; if ( graph . isAdjacentTo ( a , c ) ) { continue ; } if ( graph . isDefCollider ( a , b , c ) ) { continue ; } if ( sepsets . isCollider ( a , b , c ) ) { if ( ! isArrowpointAllowed ( a , b , graph ) ) { continue ; } if ( ! isArrowpointAllowed ( c , b , graph ) ) { continue ; } graph . setEndpoint ( a , b , Endpoint . ARROW ) ; graph . setEndpoint ( c , b , Endpoint . ARROW ) ; if ( verbose ) { logger . log ( "colliderOrientations" , SearchLogUtils . colliderOrientedMsg ( a , b , c ) ) ; out . println ( SearchLogUtils . colliderOrientedMsg ( a , b , c ) ) ; String location = "R0" ; printWrongColliderMessage ( a , b , c , location , graph ) ; } } } } }
orients colliders in the graph . ( fci step c ) < p > zhang ' s step f3 , rule r0 .
