sameNeighbors method

Set<Vertex<I>> sameNeighbors(
  1. Vertex<I> vertex
)

get the neighbor vertexes of this vertex.

获取当前节点与另一个节点的共同邻居节点。

Implementation

Set<Vertex<I>> sameNeighbors(Vertex<I> vertex) {
  return neighbors.toSet().intersection(vertex.neighbors.toSet());
}