An algorithm for finding the intersection of molecular structures

A computer can be used to find the largest common fragment of two molecular structures, by a method which initially constructs a list of those atoms in one molecule which have a matching atom in the other molecule and whose neighbours match the corresponding neighbours in the other molecule. Forming the set of all atoms which are on this list and whose neighbours are on the list produces a new list. Next we form the set of all atoms which are on the new list and whose neighbours are also on the new list. After a very few interations of this process we are left with a short list, usually a single atom, which is the centre of the intersection. The atom central to an intersection having been determined, finding the intersection specifically is then a brief process.