Generated on Wed Apr 29 2015 11:51:41 for GGL-4.1.2 by doxygen 1.8.3.1
Data Structures | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
sgm::RP_Hanser96 Class Reference

Ring enumeration ala Hanser et al. More...

#include <RP_Hanser96.hh>

Inheritance diagram for sgm::RP_Hanser96:
Inheritance graph
[legend]

Data Structures

struct  degree_sort
 
class  LoopBondReporter
 
struct  RingInfo
 information on the current ring part More...
 

Public Types

typedef std::set< std::pair
< size_t, size_t > > 
BondSet
 

Public Member Functions

size_t findRingBonds (const Graph_Interface &graph, BondSet &ringBonds, const size_t maxRingSize=std::numeric_limits< size_t >::max())
 
size_t findRings (const Graph_Interface &graph, RingReporter &reporter, const size_t maxRingSize=std::numeric_limits< size_t >::max())
 
 RP_Hanser96 ()
 construction More...
 
virtual ~RP_Hanser96 ()
 destruction More...
 

Protected Types

typedef boost::property
< boost::edge_name_t, RingInfo
Graph_EdgeProperties
 The properties available for the edges of the P-graph. More...
 
typedef boost::property
< boost::vertex_index_t,
size_t > 
Graph_NodeProperties
 The properties available for the nodes of the P-graph. More...
 
typedef boost::adjacency_list
< boost::multisetS,
boost::vecS,
boost::undirectedS,
Graph_NodeProperties,
Graph_EdgeProperties
P_Graph
 the P-graph type that is used to detect all rings More...
 

Protected Member Functions

size_t initializeP_Graph (const Graph_Interface &graph, RingReporter &reporter)
 
size_t remove_vertex (const size_t nextToRemove, const Graph_Interface &graph, RingReporter &reporter, const size_t maxRingSize)
 

Protected Attributes

P_Graph pGraph
 the P-graph to be compressed during the ring perception More...
 
std::vector< size_t > pGraphDegree
 the degree of each node in pGraph More...
 
boost::property_map< P_Graph,
boost::vertex_index_t >::type 
pGraphIndex
 the index access for pGraph More...
 
boost::property_map< P_Graph,
boost::edge_name_t >::type 
pGraphPath
 the edge label access for pGraph, i.e. the according RingList More...
 
std::vector< size_t > toRemove
 the nodes to be removed during the ring perception from pGraph More...
 

Detailed Description

   Implementation of the exhaustive ring perception algorithm by
   Hanser et al. (1996)

     A New Algorithm for Exhaustive Ring Perception in a Molecular Graph
     T. Hanser, P. Jauffret, and G. Kaufmann
     J. Chem. Inf. Comput. Sci., 1996, 36, 1146-1152
Author
Martin Mann - 2010 - http://www.bioinf.uni-freiburg.de/~mmann/

Definition at line 28 of file RP_Hanser96.hh.

Member Typedef Documentation

typedef std::set< std::pair<size_t,size_t> > sgm::RP_Hanser96::BondSet

Definition at line 31 of file RP_Hanser96.hh.

typedef boost::property< boost::edge_name_t, RingInfo > sgm::RP_Hanser96::Graph_EdgeProperties
protected

Definition at line 88 of file RP_Hanser96.hh.

typedef boost::property< boost::vertex_index_t, size_t > sgm::RP_Hanser96::Graph_NodeProperties
protected

Definition at line 84 of file RP_Hanser96.hh.

typedef boost::adjacency_list< boost::multisetS, boost::vecS, boost::undirectedS, Graph_NodeProperties, Graph_EdgeProperties > sgm::RP_Hanser96::P_Graph
protected

Definition at line 98 of file RP_Hanser96.hh.

Constructor & Destructor Documentation

sgm::RP_Hanser96::RP_Hanser96 ( )
virtual sgm::RP_Hanser96::~RP_Hanser96 ( )
virtual

Member Function Documentation

size_t sgm::RP_Hanser96::findRingBonds ( const Graph_Interface graph,
BondSet ringBonds,
const size_t  maxRingSize = std::numeric_limits< size_t >::max() 
)

Identifies all bonds participating in rings and stores the according vertex index pairs in the provided container.

Parameters
graphthe graph to search for ring bonds
ringBondsOUT : the container to fill with the ring bonds. NOTE: the container is cleared at the beginning of the call.
maxRingSizethe maximal size of rings to consider
Returns
the number of ring bonds within the graph
size_t sgm::RP_Hanser96::findRings ( const Graph_Interface graph,
RingReporter reporter,
const size_t  maxRingSize = std::numeric_limits< size_t >::max() 
)
virtual

Finds ALL rings within the given graph and reports each found ring to the assigned reporter. The enumeration can be restricted to rings up to a given ring size, ie. number of nodes per ring.

Parameters
graphthe graph to be analyzed
reporterthe RingReporter to report all found rings to
maxRingSizethe maximal size of rings to report
Returns
the number of all rings within the gaph

Implements sgm::RingPerception.

size_t sgm::RP_Hanser96::initializeP_Graph ( const Graph_Interface graph,
RingReporter reporter 
)
protected

Initializes the pGraph member with the given graph. If direct loops are found, these are directly reported and counted.

Parameters
graphthe graph to be encoded in the pGraph member
reporterthe RingReporter to report all rings to
Returns
the number of rings found
size_t sgm::RP_Hanser96::remove_vertex ( const size_t  nextToRemove,
const Graph_Interface graph,
RingReporter reporter,
const size_t  maxRingSize 
)
protected

Virtually removes the vertex nextToRemove from the pGraph and reports all found rings to the given reporter. The removal is only virtual, since the node remains within the pGraph but all adjacent edges are removed, i.e. it is not accessible anymore in later iterations. This is to ease the maintenance of the temporary data structures.

Parameters
nextToRemovethe index of the vertex to be removed
graphthe graph searched (needed for ring report)
reporterthe RingReporter to report all rings to
maxRingSizethe maximal ring size to consider
Returns
the number of rings found

Field Documentation

P_Graph sgm::RP_Hanser96::pGraph
protected

Definition at line 103 of file RP_Hanser96.hh.

std::vector<size_t> sgm::RP_Hanser96::pGraphDegree
protected

Definition at line 111 of file RP_Hanser96.hh.

boost::property_map<P_Graph, boost::vertex_index_t>::type sgm::RP_Hanser96::pGraphIndex
protected

Definition at line 106 of file RP_Hanser96.hh.

boost::property_map<P_Graph, boost::edge_name_t>::type sgm::RP_Hanser96::pGraphPath
protected

Definition at line 108 of file RP_Hanser96.hh.

std::vector<size_t> sgm::RP_Hanser96::toRemove
protected

Definition at line 113 of file RP_Hanser96.hh.


The documentation for this class was generated from the following file: