local_constraint(G, u, v, weight=None)
Formally, the local constraint on u with respect to v, denoted $\ell(v)$, is defined by
$$\ell(u, v) = \left(p_{uv} + \sum_{w \in N(v)} p_{uw} p_{wv}\right)^2,$$where $N(v)$ is the set of neighbors of $v$ and $p_{uv}$ is the normalized mutual weight of the (directed or undirected) edges joining $u$ and $v$, for each vertex $u$ and $v$ . The mutual weight of $u$ and $v$ is the sum of the weights of edges joining them (edge weights are assumed to be one if the graph is unweighted).
The graph containing u
and v
. This can be either directed or undirected.
A node in the graph G
.
A node in the graph G
.
If None, all edge weights are considered equal. Otherwise holds the name of the edge attribute used as weight.
The constraint of the node v
in the graph G
.
Returns the local constraint on the node u
with respect to the node v
in the graph G
.
The following pages refer to to this document either explicitly or contain code examples using this.
networkx.algorithms.structuralholes.constraint
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