Class CDKRGraph
Example:
G1 : CC=O and G2 : CCC=0 1 2 3 1 2 3 4
The resulting CDKRGraph(G1,G2) will contain 3 nodes:
 Node sourceBitSet : association between bond CC : 12 in G1 and 12 in G2
 Node targetBitSet : association between bond CC : 12 in G1 and 23 in G2
 Node C : association between bond C=0 : 23 in G1 and 34 in G2
Once the CDKRGraph has been built from the two compared graphs maxIterator becomes a very interesting tool to perform all kinds of structural search (isomorphism, substructure search, maximal common substructure,....).
The search may be constrained by mandatory elements (e.g. bonds that have to be present in the mapped common substructures).
Performing a query on an CDKRGraph requires simply to set the constrains (if any) and to invoke the parsing method (parse())
The CDKRGraph has been designed to be a generic tool. It may be constructed from any kind of source graphs, thus maxIterator is not restricted to a chemical context.
The CDKRGraph model is indendant from the CDK model and the link between both model is performed by the RTools class. In this way the CDKRGraph class may be reused in other graph context (conceptual graphs,....)
Important note: This implementation of the algorithm has not been optimized for speed at this stage. It has been written with the goal to clearly retrace the principle of the underlined search method. There is room for optimization in many ways including the the algorithm itself.
This algorithm derives from the algorithm described in [Tonnelier, C. et. al.. Tetrahedron Comput. Methodol.. 1990. 3] and modified in the thesis of T. Hanser [Hanser, Th., Apprentissage automatique de méthodes de synthèse à partir d'exemples, 1993, ?Institute?].
 Author:
 Stephane Werner from IXELIS mail@ixelis.net, Syed Asad Rahman >asad@ebi.ac.uk< (modified the orignal code)
 Source code:
 main
 Belongs to CDK module:
 smsd
 Created on:
 20020717
 Requires:
 java1.4+

Constructor Summary
ConstructorDescriptionDeprecated.Constructor for the CDKRGraph object and creates an empty CDKRGraph. 
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.Adds a new node to the CDKRGraph.bitSetToRMap
(BitSet set) Deprecated.Converts a CDKRGraph bitset (set of CDKRNode) to a list of CDKRMap that represents the mapping between to substructures in G1 and G2 (the projection of the CDKRGraph bitset on G1 and G2).void
clear()
Deprecated.Reinitialisation of the TGraph.int
Deprecated.Returns the size of the first of the two compared graphs.getGraph()
Deprecated.Returns the graph object of this CDKRGraph.int
Deprecated.Returns the size of the second of the two compared graphs.Deprecated.Returns the list of solutions.void
parse
(BitSet sourceBitSet, BitSet targetBitSet, boolean findAllStructure, boolean findAllMap, TimeManager timeManager) Deprecated.Parsing of the CDKRGraph.Deprecated.Projects a CDKRGraph bitset on the source graph G1.Deprecated.Projects a CDKRGraph bitset on the source graph G2.void
setAllMap
(boolean findAllMap) Deprecated.Sets the 'finAllMap' option.void
setAllStructure
(boolean findAllStructure) Deprecated.Sets the 'AllStructres' option.void
setFirstGraphSize
(int graphSize) Deprecated.Sets the size of the first of the two compared graphs.void
setMaxIteration
(int maxIterator) Deprecated.Sets the maxIteration for the CDKRGraph parsing.void
setSecondGraphSize
(int graphSize) Deprecated.Returns the size of the second of the two compared graphs.toString()
Deprecated.Returns a string representation of the CDKRGraph.

Constructor Details

CDKRGraph
public CDKRGraph()Deprecated.Constructor for the CDKRGraph object and creates an empty CDKRGraph.


Method Details

getFirstGraphSize
public int getFirstGraphSize()Deprecated.Returns the size of the first of the two compared graphs. Returns:
 The size of the first of the two compared graphs

getSecondGraphSize
public int getSecondGraphSize()Deprecated.Returns the size of the second of the two compared graphs. Returns:
 The size of the second of the two compared graphs

setFirstGraphSize
public void setFirstGraphSize(int graphSize) Deprecated.Sets the size of the first of the two compared graphs. Parameters:
graphSize
 The size of the second of the two compared graphs

setSecondGraphSize
public void setSecondGraphSize(int graphSize) Deprecated.Returns the size of the second of the two compared graphs. Parameters:
graphSize
 The size of the second of the two compared graphs

clear
public void clear()Deprecated.Reinitialisation of the TGraph. 
getGraph
Deprecated.Returns the graph object of this CDKRGraph. Returns:
 The graph object, a list

addNode
Deprecated.Adds a new node to the CDKRGraph. Parameters:
newNode
 The node to add to the graph

parse
public void parse(BitSet sourceBitSet, BitSet targetBitSet, boolean findAllStructure, boolean findAllMap, TimeManager timeManager) throws CDKException Deprecated.Parsing of the CDKRGraph. This is the main method to perform a query. Given the constrains sourceBitSet and targetBitSet defining mandatory elements in G1 and G2 and given the search options, this method builds an initial set of starting nodes (targetBitSet) and parses recursively the CDKRGraph to find a list of solution according to these parameters. Parameters:
sourceBitSet
 constrain on the graph G1targetBitSet
 constrain on the graph G2findAllStructure
 true if we want all results to be generatedfindAllMap
 true is we want all possible 'mappings'timeManager
 Throws:
CDKException

getSolutions
Deprecated.Returns the list of solutions. Returns:
 The solution list

bitSetToRMap
Deprecated.Converts a CDKRGraph bitset (set of CDKRNode) to a list of CDKRMap that represents the mapping between to substructures in G1 and G2 (the projection of the CDKRGraph bitset on G1 and G2). Parameters:
set
 the BitSet Returns:
 the CDKRMap list

setAllStructure
public void setAllStructure(boolean findAllStructure) Deprecated.Sets the 'AllStructres' option. If true all possible solutions will be generated. If false the search will stop as soon as a solution is found. (e.g. when we just want to know if a G2 is a substructure of G1 or not). Parameters:
findAllStructure


setAllMap
public void setAllMap(boolean findAllMap) Deprecated.Sets the 'finAllMap' option. If true all possible 'mappings' will be generated. If false the search will keep only one 'mapping' per structure association. Parameters:
findAllMap


setMaxIteration
public void setMaxIteration(int maxIterator) Deprecated.Sets the maxIteration for the CDKRGraph parsing. If set to 1, then no iteration maximum is taken into account. Parameters:
maxIterator
 The new maxIteration value

toString
Deprecated.Returns a string representation of the CDKRGraph. 
projectG1
Deprecated.Projects a CDKRGraph bitset on the source graph G1. Parameters:
set
 CDKRGraph BitSet to project Returns:
 The associate BitSet in G1

projectG2
Deprecated.Projects a CDKRGraph bitset on the source graph G2. Parameters:
set
 CDKRGraph BitSet to project Returns:
 The associate BitSet in G2
