Chemical Descriptors Library: Molecule, Atoms and Bonds
Molecule, Atoms and Bonds

CDL represent molecules as undirected graphs with properties attached to its vertices and edges.
The graph data structure is represented as an adjacency list, which stores an out-edge sequence for each vertex of the graph. Since the graph is undirected, this adjacency list has similar structure as a "connectivity table", which lists the nodes that are connected.
When atomic properties are attached to the vertices of this graph, and bond properties are attached to its edges, the graph is called "molecular graph".
In this representation, vertex properties are refered as "atoms" and edge properties are refered as "bonds".

CDL employs the Boost Graph Library (BGL) to represent the graph data structure. Also, BGL graph algorithms are widely used within CDL.
Now, vertices maps to atomic properties and edges maps to bond properties.
You can map an atom from a vertex, but not a vertex from an atom : the map is unidirectional (except when you have the atom iterator, then you can map back to the vertex iterator). In the same way, you can map a bond from an edge, but not an edge from a bond (except when you have the bond iterator).
The vertex iterator points to a structure called "vertex descriptor", which is of std::size_t, and represents the index of the vertex in the graph. In the same way, the edge iterators points to a structure called "edge descriptor" which is of a type of no interest to us, however is important to know that it contains a pair of vertex descriptors that makes the edge.

Copyright © Vladimir Sykora & Cyprotex Ltd 2006 Logo