grinpy.functions.neighborhoods.closed_neighborhood¶
-
grinpy.functions.neighborhoods.
closed_neighborhood
(G, v)¶ Return a list with v and of all neighbors of v.
Parameters: - G (NetworkX graph) – An undirected graph.
- v – A node in G.
Returns: A list containing v and all nodes that are a neighbor of v.
Return type: list
See also
Examples
>>> G = nx.path_graph(3) # Path on 3 nodes >>> nx.closed_neighborhood(G, 1) [0, 1, 2]