public static <V extends SampledVertex>Set<V> createDetectedPartition(Collection<V> vertices,int iteration){
  Set<V> partition=new HashSet<V>();
  for (  V vertex : vertices) {
    if (vertex.isDetected()) {
      if (vertex.getIterationDetected() == iteration)       vertices.add(vertex);
    }
  }
  return partition;
}

public static < V extends SampledVertex > Set < V > createDetectedPartition ( Collection < V > vertices , int iteration ) { Set < V > partition = new HashSet < V > ( ) ; for ( V vertex : vertices ) { if ( vertex . isDetected ( ) ) { if ( vertex . getIterationDetected ( ) == iteration ) vertices . add ( vertex ) ; } } return partition ; }
creates a subset of vertices detected in a specific iteration .
