grinpy.functions.average_degree

grinpy.functions.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.

G : graph
A NetworkX graph.
avgDegree : float
The average degree of the graph.
>>> G = nx.star_graph(3) # Star on 4 nodes
>>> nx.average_degree(G)
1.5