// For each edge, find the most similar cluster updating the relative
// indices of the rowToMostSimilar arrays with the results.
Object taskKey = WORK_QUEUE.registerTaskGroup(g.order());
IntIterator iter1 = g.vertices().iterator();
while (iter1.hasNext()) {
final int v1 = iter1.nextInt();
WORK_QUEUE.add(taskKey, new Runnable() {
public void run() {
veryVerbose(LOGGER, "Computing similarities for " +
"vertex %d", v1);
IntSet neighbors = g.getNeighbors(v1);