asherm's blog

InfiniteGraph: getNeighbors or getEdges?

When writing an application using IG you will likely run into a situation where you want to see who or what is connected to a particular vertex. For example, you could have a social network and want to see who a person's friends are.

When looking at the Vertex API you will see a few options:

 List<EdgeHandle>   findEdgesToNeighbor(long neighborId)
          Retrieves a list of all edges that connect this vertex to a vertex with the given id.

 Iterable<EdgeHandle>   getEdges()