average_degree_connectivity(G, source='in+out', target='in+out', nodes=None, weight=None)
The average degree connectivity is the average nearest neighbor degree of nodes with degree k. For weighted graphs, an analogous measure can be computed using the weighted average neighbors degree defined in , for a node i
, as
where :None:None:`s_i`
is the weighted degree of node i
, :None:None:`w_{ij}`
is the weight of the edge that links i
and :None:None:`j`
, and :None:None:`N(i)`
are the neighbors of node i
.
Directed graphs only. Use "in"- or "out"-degree for source node.
Directed graphs only. Use "in"- or "out"-degree for target node.
Compute neighbor connectivity for these nodes. The default is all nodes.
The edge attribute that holds the numerical value used as a weight. If None, then each edge has weight 1.
If either :None:None:`source`
or :None:None:`target`
are not one of 'in', 'out', or 'in+out'. If either :None:None:`source`
or :None:None:`target`
is passed for an undirected graph.
A dictionary keyed by degree k with the value of average connectivity.
Compute the average degree connectivity of graph.
>>> G = nx.path_graph(4)
... G.edges[1, 2]["weight"] = 3
... nx.average_degree_connectivity(G) {1: 2.0, 2: 1.5}
>>> nx.average_degree_connectivity(G, weight="weight") {1: 2.0, 2: 1.75}See :
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.assortativity.connectivity.average_degree_connectivity
networkx.algorithms.assortativity.neighbor_degree.average_neighbor_degree
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them