// On forward matches, include the link only
// if the tail has not yet been visited.
if (relations.matchForward(edge.getRelation())) {
if (false == visited.contains((edge.getTail()))) {
builder.addForwardEdge(edge);
visited.add((edge.getTail()));
}
}
// For spanning hierarchies, each edge gets added only once.