Chemical Descriptors Library: Smallest Set of Smallest Rings
Figueras' Algorithm for the calculation of the Smallest Set of Smallest Rings (SSSR)

SSSR calculation is useful for aromaticy perception and hydridization assignment in ring systems.
In CDL, when constructing a molecule using a juice, and the flag for initialization is set to true, the SSSR algorithm is called for the initialization of the atomic/bond and molecule properties. The results of the algorithm are stored into the ring_sizeS and ring_bond_sizeS of the atom and bond default properties. In addition, the molecule properties cyclic_verticesS, cyclic_edgesS and back_edgesS are also initialized with the result of the algorith.
This means that if you are initializing the molecule upon construction, you will have the results of the SSSR algorithm stored in the atom/bond and molecule properties.
You will only need to use this algorithm if you have modified your molecule and want to recalculate its SSSR.

The algorithms uses a Breadth-First Search iteration through the atoms of the molecular graph, which results in an algorithm of polynomial complexity.


  template <class Molecule, class SSSRVertices, class SSSREdges, class BackEdges>
  void calculate_sssr (Molecule&  m, SSSRVertices& sssr, SSSREdges& sssr_edges,
  BackEdges& back_edges);


The molecule to calculate its SSSR CDL molecule<>. For this calculation, it is recommended to use the CDL projected_molecule
A sequence of sets where the SSSR vertices are stored. Each set comprises a ring. An STL sequence of sets. MolProperty<cyclic_verticesS,Molecule>::result_type models this. In standard cases, it is of type: std::vector<std::set<vertex_descriptor> >
A sequence of sequences of pairs. Each pair represents an edge, where the inner sequences represents each SSSR ring. STL sequence of sequences of pairs. MolProperty<cyclic_edgesS,Molecule>::result_type models this. In standar conditions, it is of type: std::vector<std::vector<std::pair<size_t,size_t> > >
A sequence of pairs where the back edges of the SSSRs are stored. STL sequence of pairs. MolProperty<back_edgesS,Molecule>::result_type models this. In standard conditions, it is of type std::vector<std::pair<size_t,size_t> >






#include <morpho/cdl/molecule/molecule.hpp>
#include <morpho/cdl/molecule/projected_molecule.hpp>
#include <morpho/cdl/parsers/parsers.cpp>

int main() {
  using namespace std;
  using namespace morpho::cdl;
  typedef molecule<> Molecule;
  nail_juice<>  j_from_sdf;
  get_juice_from_stream(std::cin, j_from_sdf, 0, sdf_formatT());
  Molecule  m(j_from_sdf);
  projected_molecule<Molecule>        proj_mol(m);
  std::vector<std::set<size_t> >  sssr_vertices;
  std::vector<std::vector<std::pair<size_t,size_t> > > sssr_edges;
  std::vector<std::pair<size_t,size_t> >   sssr_back_edges;
  // now call the algorithm:
   // and voile...

Copyright © Vladimir Sykora & Cyprotex Ltd 2006