* @throws IOException
*/
public static Collection<IdCount> computeLabels(String baseFilename, int numVertices,
VertexIdTranslate translate) throws IOException {
final HashMap<Integer, IdCount> counts = new HashMap<Integer, IdCount>(1000000);
VertexAggregator.foreach(numVertices, baseFilename, new IntConverter(), new ForeachCallback<Integer>() {
public void callback(int vertexId, Integer vertexValue) {
if (vertexId != vertexValue) {
IdCount cnt = counts.get(vertexValue);
if (cnt == null) {
cnt = new IdCount(vertexValue, 1);