Return the degree sequence of G.
The degree sequence of a graph is the sequence of degrees of the nodes in the graph.
Parameters: G (NetworkX graph) – An undirected graph. Returns: The degree sequence of the graph. Return type: list
>>> G = nx.path_graph(3) # Path on 3 nodes >>> nx.degree_sequence(G) [1, 2, 1]