// combine the current edge with all vertices in the non-matching vertex list
for (int i = 0; i < numEdges; i++) {
// get the other non-matching vertex
final StringValue otherVertex = this.otherVertices.get(i);
// add my and other vertex to the output record depending on their ordering
if (otherVertex.compareTo(myVertex) < 0) {
this.result.setField(1, otherVertex);
this.result.setField(2, myVertex);
out.collect(this.result);
} else {
next.setField(2, otherVertex);