@Override
public IntegerDistance similarity(DBID id1, DBID id2) {
SetDBIDs neighbors1 = index.getNearestNeighborSet(id1);
SetDBIDs neighbors2 = index.getNearestNeighborSet(id2);
return new IntegerDistance(countSharedNeighbors(neighbors1, neighbors2));
}