private static List < IAtomContainer > getMaximum ( ArrayList < IAtomContainer > graphList , boolean shouldMatchBonds ) throws CDKException { List < IAtomContainer > reducedGraphList = ( List < IAtomContainer > ) graphList . clone ( ) ; for ( int i = 0 ; i < graphList . size ( ) ; i ++ ) { IAtomContainer graphI = graphList . get ( i ) ; for ( int j = i + 1 ; j < graphList . size ( ) ; j ++ ) { IAtomContainer graphJ = graphList . get ( j ) ; // Gi included in Gj or Gj included in Gi then // reduce the irrelevant solution if ( isSubgraph ( graphJ , graphI , shouldMatchBonds ) ) { reducedGraphList . remove ( graphI ) ; } else if ( isSubgraph ( graphI , graphJ , shouldMatchBonds ) ) { reducedGraphList . remove ( graphJ ) ; } } } return reducedGraphList ; }
Removes all redundant solution .