private void traverseRing ( int [ ] ringSystem , int v , int rnum ) { ringSystem [ v ] = rnum ; for ( int w : adjList [ v ] ) { if ( ringSystem [ w ] == 0 && bondMap . get ( v , w ) . isInRing ( ) ) traverseRing ( ringSystem , w , rnum ) ; } }
Simple method for marking ring systems with a flood - fill .