code: protected int compatibilityGraph() throws IOException {
          int compGraphNodesListSize = compGraphNodes.size();
  
          cEdges = new ArrayList<Integer>(); //Initialize the cEdges List
          dEdges = new ArrayList<Integer>(); //Initialize the dEdges List
  
          for (int a = 0; a < compGraphNodesListSize; a += 3) {
              int indexA = compGraphNodes.get(a);
              int indexAPlus1 = compGraphNodes.get(a + 1);
  
              for (int b = a + 3; b < compGraphNodesListSize; b += 3) {
                  int indexB = compGraphNodes.get(b);
                  int indexBPlus1 = compGraphNodes.get(b + 1);
  
                  // if element atomCont !=jIndex and atoms on the adjacent sides of the bonds are not equal
                  if (a != b && indexA != indexB && indexAPlus1 != indexBPlus1) {
  
                      IBond reactantBond = null;
                      IBond productBond = null;
  
                      reactantBond = source.getBond(source.getAtom(indexA), source.getAtom(indexB));
                      productBond = target.getBond(target.getAtom(indexAPlus1), target.getAtom(indexBPlus1));
                      if (reactantBond != null && productBond != null) {
                          addEdges(reactantBond, productBond, a, b);
                      }
                  }
              }
          }
          cEdgesSize = cEdges.size();
          dEdgesSize = dEdges.size();
          return 0;
      }
docs: Generate Compatibility Graph Nodes Bond Insensitive
  
  @return
  @throws IOException