# grinpy.functions.degree.average_degree¶

grinpy.functions.degree.average_degree(G)

Return the average degree of G.

The average degree of a graph is the average of the degrees of all nodes in the graph.

Parameters: G (NetworkX graph) – An undirected graph. The average degree of the graph. float

Examples

>>> G = nx.star_graph(3) # Star on 4 nodes
>>> nx.average_degree(G)
1.5