// together which have the same *combination* of indices; for example,
// (1, 3) will have the same key as (3, 1) but a different key from (1, 1)
// and (3, 3) (which, incidentally, will also not be grouped together)
String type = context.getWorkingDirectory().getName();
Vector vector = row.get();
for (Vector.Element e : vector.all()) {
String newkey = Math.max(key.get(), e.index()) + "_" + Math.min(key.get(), e.index());
context.write(new Text(newkey), new VertexWritable(key.get(), e.index(), e.get(), type));
}
}
}