private List < Set < Integer > > createInitialAggregates ( List < Set < Integer > > N , boolean [ ] R ) { C = new ArrayList < Set < Integer > > ( ) ; for ( int i = 0 ; i < R . length ; ++ i ) { // Skip non-free nodes if ( ! R [ i ] ) continue ; // See if all nodes in the current N-set are free boolean free = true ; for ( int j : N . get ( i ) ) free &= R [ j ] ; // Create an aggregate out of N[i] if ( free ) { C . add ( new HashSet < Integer > ( N . get ( i ) ) ) ; for ( int j : N . get ( i ) ) R [ j ] = false ; } } return C ; }
Creates the initial aggregates