code: public static long[] label(IAtomContainer    container,
                                 int[][]           g,
                                 Comparator<IAtom> cmp) {
          if (g.length == 0)
              return new long[0];
          IAtom[] atoms = AtomContainerManipulator.getAtomArray(container);
          Arrays.sort(atoms, cmp);
          long[] initial = new long[atoms.length];
          long   part    = 1;
          initial[container.indexOf(atoms[0])] = part;
          for (int i=1; i<atoms.length; i++) {
              if (cmp.compare(atoms[i], atoms[i-1]) != 0)
                  ++part;
              initial[container.indexOf(atoms[i])] = part;
          }
          return label(container, g, initial);
      }
docs: Compute the canonical labels for the provided structure. The initial
  labelling is seed-ed with the provided atom comparator <code>cmp</code>
  allowing arbitary properties to be distinguished or ignored.
  
  @param container  structure
  @param g          adjacency list graph representation
  @param cmp        comparator to compare atoms
  @return the canonical labelling