SetHypergraph.getNeighbours(V v) returns v as a neighbour:
public void testNeighbors()
{
Hypergraph<String,String> g = (Hypergraph<String,String>) hypergraphFactory.create();
g.addEdge("1", Arrays.asList("a", "b", "c"));
g.addEdge("2", Arrays.asList("a", "c", "d"));
assertThat(g.getNeighbors("a"), is((Collection<String>)Arrays.asList("b", "c", "d")));
}
Also SetHypergraph API doc should state that self-loops are not supported.
Sry, the assert should probably read:
assertThat(new HashSet(g.getNeighbors("a"),) is(new HashSet(Arrays.asList("b", "c", "d"))));