public final class RelevantCycles extends Object
size()
) before construction
[Vismara, Philippe, Union of all the minimum cycle bases of a graph, Combinatorics, 1997, 4:?-?].
// import static org.openscience.cdk.graph.GraphUtil.*; IAtomContainer m = ...; // compute on the whole graph RelevantCycles relevant = new RelevantCycles(toAdjList(m)); // it is much faster to compute on the separate ring systems of the molecule int[][] graph = toAdjList(m); RingSearch ringSearch = new RingSearch(m, graph); // all isolated cycles are relevant for (int[] isolated : ringSearch.isolated()){ int[] path = cycle(graph, isolated); } // compute the relevant cycles for each system for (int[] fused : ringSearch.fused()){ int[][] subgraph = subgraph(graph, fused); RelevantCycles relevant = new RelevantCycles(subgraph); for(int[] path : relevant.paths()){ // convert the sub graph vertices back to the super graph indices for(int i = 0; i < path.length; i++) { path[i] = fused[path[i]; } } }
RingSearch
,
SSSRFinder.findRelevantRings()
,
GreedyBasis
Constructor and Description |
---|
RelevantCycles(int[][] graph)
Generate the relevant cycle basis for a graph.
|
public RelevantCycles(int[][] graph)
graph
- undirected adjacency listRingSearch.fused()
,
GraphUtil.subgraph(int[][], int[])
public int[][] paths()
RelevantCycles relevant = ... // ensure the number is manageable if(relevant.size() < 100){ for(int[] path : relevant.paths()){ // process the path } }
public int size()
Copyright © 2017. All Rights Reserved.