public final class RelevantCycles extends Object
size()
) before construction
(Vismara, Philippe. 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.
|
Modifier and Type | Method and Description |
---|---|
int[][] |
paths()
Reconstruct the paths of all relevant cycles.
|
int |
size()
The number of the relevant cycles.
|
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 © 2021. All rights reserved.