@ Override public Collection < List < IAtom > > findRings ( IAtomContainer molecule ) { if ( molecule == null ) return null ; rings . clear ( ) ; PathGraph graph = new PathGraph ( molecule ) ; for ( int i = 0 ; i < molecule . getAtomCount ( ) ; i ++ ) { List < PathEdge > edges = graph . remove ( molecule . getAtom ( i ) ) ; for ( PathEdge edge : edges ) { List < IAtom > ring = edge . getAtoms ( ) ; rings . add ( ring ) ; } } return rings ; }
Returns a collection of rings .