class MCSPlus {

    protected List<List<Integer>> getOverlaps(IAtomContainer ac1, IAtomContainer ac2, boolean shouldMatchBonds)
            throws CDKException {
        Stack<List<Integer>> maxCliqueSet = null;
        List<List<Integer>> mappings = new ArrayList<List<Integer>>();
        try {
            GenerateCompatibilityGraph gcg = new GenerateCompatibilityGraph(ac1, ac2, shouldMatchBonds);
            List<Integer> compGraphNodes = gcg.getCompGraphNodes();

            List<Integer> cEdges = gcg.getCEgdes();
            List<Integer> dEdges = gcg.getDEgdes();

            //            System.err.println("**************************************************");
            //            System.err.println("CEdges: " + CEdges.size());
            //            System.out.println("DEdges: " + DEdges.size());

            BKKCKCF init = new BKKCKCF(compGraphNodes, cEdges, dEdges);
            maxCliqueSet = init.getMaxCliqueSet();

            //            System.err.println("**************************************************");
            //            System.err.println("Max_Cliques_Set: " + maxCliqueSet.size());
            //            System.out.println("Best Clique Size: " + init.getBestCliqueSize());

            //clear all the compatibility graph content
            gcg.clear();
            while (!maxCliqueSet.empty()) {
                List<Integer> cliqueList = maxCliqueSet.peek();
                int cliqueSize = cliqueList.size();
                if (cliqueSize < ac1.getAtomCount() && cliqueSize < ac2.getAtomCount()) {
                    McGregor mgit = new McGregor(ac1, ac2, mappings, shouldMatchBonds);
                    mgit.startMcGregorIteration(mgit.getMCSSize(), cliqueList, compGraphNodes);
                    mappings = mgit.getMappings();
                    mgit = null;
                } else {
                    mappings = ExactMapping.extractMapping(mappings, compGraphNodes, cliqueList);
                }
                maxCliqueSet.pop();
                if (isTimeOut()) {
                    break;
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(MCSPlus.class.getName()).log(Level.SEVERE, null, ex);
        }
        return mappings;
    }

    public  MCSPlus();

}