WORK_QUEUE.add(key, new Runnable() {
public void run() {
veryVerbose(LOGGER, "Computing similarities for " +
"vertex %d", v1);
//Set<E> adjList = graph.getAdjacencyList(v1);
IntSet neighbors = graph.getNeighbors(v1);
// Create a thread-local PriorityQueue that will hold
// the edge similarities for this vertex. Once all the
// simialrites have been computed, we can update the
// thread-shared queue with minimal locking
PriorityQueue<EdgePair> localQ =
new PriorityQueue<EdgePair>(neighbors.size());
IntIterator it1 = neighbors.iterator();
// for (E e1 : adjList) {
while (it1.hasNext()) {
// int v2 = (e1.to() == v1) ? e1.from() : e1.to();
int v2 = it1.nextInt();
IntIterator it2 = neighbors.iterator();
// for (Edge e2 : graph.getAdjacencyList(v1)) {
while (it2.hasNext()) {
int v3 = it2.nextInt();
if (v2 == v3)
break;