constraint(G, nodes=None, weight=None)
The constraint is a measure of the extent to which a node v is invested in those nodes that are themselves invested in the neighbors of v. Formally, the constraint on v, denoted :None:None:`c(v)`
, is defined by
where $N(v)$ is the subset of the neighbors of :None:None:`v`
that are either predecessors or successors of :None:None:`v`
and $\ell(v, w)$ is the local constraint on :None:None:`v`
with respect to w
. For the definition of local constraint, see local_constraint
.
The graph containing v
. This can be either directed or undirected.
Container of nodes in the graph G
to compute the constraint. If None, the constraint of every node is computed.
If None, all edge weights are considered equal. Otherwise holds the name of the edge attribute used as weight.
Dictionary with nodes as keys and the constraint on the node as values.
Returns the constraint on all nodes in the graph G
.
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.structuralholes.local_constraint
networkx.algorithms.structuralholes.effective_size
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