# grinpy.functions.neighborhoods.neighborhood¶

grinpy.functions.neighborhoods.neighborhood(G, v)

Return a list of all neighbors of v.

Parameters: G (NetworkX graph) – An undirected graph. v – A node in G. A list containing all nodes that are a neighbor of v. list

Examples

>>> G = nx.path_graph(3) # Path on 3 nodes
>>> nx.neighborhood(G, 1)
[0, 2]