grinpy.functions.degree.neighborhood_degree_list

grinpy.functions.degree.neighborhood_degree_list(G, nbunch)

Return a list of the unique degrees of all neighbors of nodes in nbunch

Parameters:
  • G (NetworkX graph) – An undirected graph.
  • nbunch (a single node or iterable container of nodes) –
Returns:

A list of the degrees of all nodes in the neighborhood of the nodes in nbunch.

Return type:

list

See also

closed_neighborhood_degree_list(), neighborhood()

Examples

>>> import grinpy as gp
>>> G = gp.path_graph(3) # Path on 3 nodes
>>> gp.neighborhood_degree_list(G, 1)
[1, 2]