node_redundancy(G, nodes=None)
The redundancy coefficient of a node :None:None:`v`
is the fraction of pairs of neighbors of :None:None:`v`
that are both linked to other nodes. In a one-mode projection these nodes would be linked together even if :None:None:`v`
were not there.
More formally, for any vertex :None:None:`v`
, the redundancy coefficient of `v` is defined by
where :None:None:`N(v)`
is the set of neighbors of :None:None:`v`
in G
.
A bipartite graph
Compute redundancy for these nodes. The default is all nodes in G.
If any of the nodes in the graph (or in nodes
, if specified) has (out-)degree less than two (which would result in division by zero, according to the definition of the redundancy coefficient).
A dictionary keyed by node with the node redundancy value.
Computes the node redundancy coefficients for the nodes in the bipartite graph G
.
>>> from networkx.algorithms import bipartite >>> G = nx.cycle_graph(4) >>> rc = bipartite.node_redundancy(G) >>> rc[0] 1.0
>>> from networkx.algorithms import bipartite >>> G = nx.cycle_graph(4) >>> rc = bipartite.node_redundancy(G) >>> sum(rc.values()) / len(G) 1.0
See :>>> from networkx.algorithms import bipartite >>> G = nx.cycle_graph(4) >>> rc = bipartite.node_redundancy(G) >>> nodes = [0, 2] >>> sum(rc[n] for n in nodes) / len(nodes) 1.0
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