private static void arcConstructor(CDKRGraph graph, IAtomContainer ac1, IAtomContainer ac2) throws CDKException {
        // each node is incompatible with itself
        for (int i = 0; i < graph.getGraph().size(); i++) {
            CDKRNode rNodeX = graph.getGraph().get(i);
            rNodeX.getForbidden().set(i);
        }

        IBond bondA1;
        IBond bondA2;
        IBond bondB1;
        IBond bondB2;

        graph.setFirstGraphSize(ac1.getBondCount());
        graph.setSecondGraphSize(ac2.getBondCount());

        for (int i = 0; i < graph.getGraph().size(); i++) {
            CDKRNode rNodeX = graph.getGraph().get(i);

            // two nodes are neighbours if their adjacency
            // relationship in are equivalent in G1 and G2
            // else they are incompatible.
            for (int j = i + 1; j < graph.getGraph().size(); j++) {
                CDKRNode rNodeY = graph.getGraph().get(j);

                bondA1 = ac1.getBond(graph.getGraph().get(i).getRMap().getId1());
                bondA2 = ac2.getBond(graph.getGraph().get(i).getRMap().getId2());
                bondB1 = ac1.getBond(graph.getGraph().get(j).getRMap().getId1());
                bondB2 = ac2.getBond(graph.getGraph().get(j).getRMap().getId2());

                if (bondA2 instanceof IQueryBond) {
                    if (bondA1.equals(bondB1) || bondA2.equals(bondB2)
                            || !queryAdjacencyAndOrder(bondA1, bondB1, bondA2, bondB2)) {
                        rNodeX.getForbidden().set(j);
                        rNodeY.getForbidden().set(i);
                    } else if (hasCommonAtom(bondA1, bondB1)) {
                        rNodeX.getExtension().set(j);
                        rNodeY.getExtension().set(i);
                    }
                } else {
                    if (bondA1.equals(bondB1) || bondA2.equals(bondB2)
                            || (!getCommonSymbol(bondA1, bondB1).equals(getCommonSymbol(bondA2, bondB2)))) {
                        rNodeX.getForbidden().set(j);
                        rNodeY.getForbidden().set(i);
                    } else if (hasCommonAtom(bondA1, bondB1)) {
                        rNodeX.getExtension().set(j);
                        rNodeY.getExtension().set(i);
                    }
                }
            }
        }
    }
private static void arcConstructor ( CDKRGraph graph , IAtomContainer ac1 , IAtomContainer ac2 ) throws CDKException { for ( int i = 0 ; i < graph . getGraph ( ) . size ( ) ; i ++ ) { CDKRNode rNodeX = graph . getGraph ( ) . get ( i ) ; rNodeX . getForbidden ( ) . set ( i ) ; } IBond bondA1 ; IBond bondA2 ; IBond bondB1 ; IBond bondB2 ; graph . setFirstGraphSize ( ac1 . getBondCount ( ) ) ; graph . setSecondGraphSize ( ac2 . getBondCount ( ) ) ; for ( int i = 0 ; i < graph . getGraph ( ) . size ( ) ; i ++ ) { CDKRNode rNodeX = graph . getGraph ( ) . get ( i ) ; for ( int j = i + 1 ; j < graph . getGraph ( ) . size ( ) ; j ++ ) { CDKRNode rNodeY = graph . getGraph ( ) . get ( j ) ; bondA1 = ac1 . getBond ( graph . getGraph ( ) . get ( i ) . getRMap ( ) . getId1 ( ) ) ; bondA2 = ac2 . getBond ( graph . getGraph ( ) . get ( i ) . getRMap ( ) . getId2 ( ) ) ; bondB1 = ac1 . getBond ( graph . getGraph ( ) . get ( j ) . getRMap ( ) . getId1 ( ) ) ; bondB2 = ac2 . getBond ( graph . getGraph ( ) . get ( j ) . getRMap ( ) . getId2 ( ) ) ; if ( bondA2 instanceof IQueryBond ) { if ( bondA1 . equals ( bondB1 ) || bondA2 . equals ( bondB2 ) || ! queryAdjacencyAndOrder ( bondA1 , bondB1 , bondA2 , bondB2 ) ) { rNodeX . getForbidden ( ) . set ( j ) ; rNodeY . getForbidden ( ) . set ( i ) ; } else if ( hasCommonAtom ( bondA1 , bondB1 ) ) { rNodeX . getExtension ( ) . set ( j ) ; rNodeY . getExtension ( ) . set ( i ) ; } } else { if ( bondA1 . equals ( bondB1 ) || bondA2 . equals ( bondB2 ) || ( ! getCommonSymbol ( bondA1 , bondB1 ) . equals ( getCommonSymbol ( bondA2 , bondB2 ) ) ) ) { rNodeX . getForbidden ( ) . set ( j ) ; rNodeY . getForbidden ( ) . set ( i ) ; } else if ( hasCommonAtom ( bondA1 , bondB1 ) ) { rNodeX . getExtension ( ) . set ( j ) ; rNodeY . getExtension ( ) . set ( i ) ; } } } } }
Build edges of the RGraphs
This method create the edge of the CDKRGraph and
calculates the incompatibility and neighbourhood
relationships between CDKRGraph nodes.

@param  graph   the rGraph
@param  ac1   first molecule. Must not be an IQueryAtomContainer.
@param  ac2   second molecule. May be an IQueryAtomContainer.
@throws org.openscience.cdk.exception.CDKException if it takes too long to get the overlaps