private static void nodeConstructor(CDKRGraph graph, IAtomContainer ac1, IAtomContainer ac2,
            boolean shouldMatchBonds) throws CDKException {
        if (ac1 instanceof IQueryAtomContainer) {
            throw new CDKException("The first IAtomContainer must not be an IQueryAtomContainer");
        }

        // resets the target graph.
        graph.clear();

        // compares each bondA1 of G1 to each bondA1 of G2
        for (int i = 0; i < ac1.getBondCount(); i++) {
            IBond bondA1 = ac1.getBond(i);
            for (int j = 0; j < ac2.getBondCount(); j++) {
                IBond bondA2 = ac2.getBond(j);
                if (bondA2 instanceof IQueryBond) {
                    IQueryBond queryBond = (IQueryBond) bondA2;
                    IQueryAtom atom1 = (IQueryAtom) (bondA2.getBegin());
                    IQueryAtom atom2 = (IQueryAtom) (bondA2.getEnd());
                    if (queryBond.matches(bondA1)) {
                        // ok, bonds match
                        if (atom1.matches(bondA1.getBegin()) && atom2.matches(bondA1.getEnd())
                                || atom1.matches(bondA1.getEnd()) && atom2.matches(bondA1.getBegin())) {
                            // ok, atoms match in either order
                            graph.addNode(new CDKRNode(i, j));
                        }
                    }
                } else {
                    // if both bonds are compatible then create an association node
                    // in the resolution graph
                    if (isMatchFeasible(ac1, bondA1, ac2, bondA2, shouldMatchBonds)) {
                        graph.addNode(new CDKRNode(i, j));
                    }

                }
            }
        }
    }
private static void nodeConstructor ( CDKRGraph graph , IAtomContainer ac1 , IAtomContainer ac2 , boolean shouldMatchBonds ) throws CDKException { if ( ac1 instanceof IQueryAtomContainer ) { throw new CDKException ( "The first IAtomContainer must not be an IQueryAtomContainer" ) ; } graph . clear ( ) ; for ( int i = 0 ; i < ac1 . getBondCount ( ) ; i ++ ) { IBond bondA1 = ac1 . getBond ( i ) ; for ( int j = 0 ; j < ac2 . getBondCount ( ) ; j ++ ) { IBond bondA2 = ac2 . getBond ( j ) ; if ( bondA2 instanceof IQueryBond ) { IQueryBond queryBond = ( IQueryBond ) bondA2 ; IQueryAtom atom1 = ( IQueryAtom ) ( bondA2 . getBegin ( ) ) ; IQueryAtom atom2 = ( IQueryAtom ) ( bondA2 . getEnd ( ) ) ; if ( queryBond . matches ( bondA1 ) ) { if ( atom1 . matches ( bondA1 . getBegin ( ) ) && atom2 . matches ( bondA1 . getEnd ( ) ) || atom1 . matches ( bondA1 . getEnd ( ) ) && atom2 . matches ( bondA1 . getBegin ( ) ) ) { graph . addNode ( new CDKRNode ( i , j ) ) ; } } } else { if ( isMatchFeasible ( ac1 , bondA1 , ac2 , bondA2 , shouldMatchBonds ) ) { graph . addNode ( new CDKRNode ( i , j ) ) ; } } } } }
Builds  the nodes of the CDKRGraph ( resolution graph ), from
two atom containers (description of the two molecules to compare)

@param  graph   the target CDKRGraph
@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 identify overlaps