The simplest form of ring processing in OEChem is testing for
ring/cycle membership, i.e. whether an atom or bond is in a ring or
not. The OEChem function OEFindRingAtomsAndBonds is used to determine which
atoms and bonds are members of one or more cycles and which are acyclic.
This function uses an efficient O(n) algorithm. Once
OEFindRingAtomsAndBonds has been called, an atom or bond can be tested
for being in a ring by calling either the OEAtomBase::IsInRing
or the OEBondBase::IsInRing
methods respectively.
Because it is common to test IsInRing (or aromaticity) in user applications, the function OEFindRingAtomsAndBonds is called automatically by the high-level file I/O functions (including OEChem oemolistream iterators or OEReadMolecule). However, whenever you modify a molecule by adding or deleting bonds, you'll need to call OEFindRingAtomsAndBonds.