code: public static Map<Integer, Integer> mapAtomsOfAlignedStructures(IAtomContainer firstAtomContainer,
              IAtomContainer secondAtomContainer, double searchRadius, Map<Integer, Integer> mappedAtoms)
              throws CDKException {
          getLargestAtomContainer(firstAtomContainer, secondAtomContainer);
          double[][] distanceMatrix = new double[firstAtomContainer.getAtomCount()][secondAtomContainer.getAtomCount()];
          for (int i = 0; i < firstAtomContainer.getAtomCount(); i++) {
              Point3d firstAtomPoint = firstAtomContainer.getAtom(i).getPoint3d();
              for (int j = 0; j < secondAtomContainer.getAtomCount(); j++) {
                  distanceMatrix[i][j] = firstAtomPoint.distance(secondAtomContainer.getAtom(j).getPoint3d());
              }
          }
  
          double minimumDistance;
          for (int i = 0; i < firstAtomContainer.getAtomCount(); i++) {
              minimumDistance = searchRadius;
              for (int j = 0; j < secondAtomContainer.getAtomCount(); j++) {
                  if (distanceMatrix[i][j] < searchRadius && distanceMatrix[i][j] < minimumDistance) {
                      //check atom properties
                      if (checkAtomMapping(firstAtomContainer, secondAtomContainer, i, j)) {
                          minimumDistance = distanceMatrix[i][j];
                          mappedAtoms.put(firstAtomContainer.indexOf(firstAtomContainer.getAtom(i)),
                                  secondAtomContainer.indexOf(secondAtomContainer.getAtom(j)));
                      }
                  }
              }
          }
          return mappedAtoms;
      }
docs: Returns a Map with the AtomNumbers, the first number corresponds to the first (or the largest
  AtomContainer) atomcontainer. It is recommend to sort the atomContainer due to their number
  of atoms before calling this function.
  
  The molecules needs to be aligned before! (coordinates are needed)
  
  @param firstAtomContainer  the (largest) first aligned AtomContainer which is the reference
  @param secondAtomContainer the second aligned AtomContainer
  @param searchRadius        the radius of space search from each atom
  @return a Map of the mapped atoms
  @throws org.openscience.cdk.exception.CDKException Description of the Exception