NeighborhoodsΒΆ

Functions for computing neighborhoods of vertices and sets of vertices.

are_neighbors(G, v, nbunch) Returns true if v is adjacent to any of the nodes in nbunch.
closed_neighborhood(G, nbunch) Return a list of all neighbors of the nodes in nbunch, including the nodes in nbunch.
common_neighbors(G, nbunch) Returns a list of all nodes in G that are adjacent to every node in nbunch.
neighborhood(G, nbunch) Return a list of all neighbors of the nodes in nbunch.