networkx 2.8.2 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
collaboration_weighted_projected_graph(B, nodes)

The collaboration weighted projection is the projection of the bipartite network B onto the specified nodes with weights assigned using Newman's collaboration model :

$$w_{u, v} = \sum_k \frac{\delta_{u}^{k} \delta_{v}^{k}}{d_k - 1}$$

where :None:None:`u` and :None:None:`v` are nodes from the bottom bipartite node set, and :None:None:`k` is a node of the top node set. The value :None:None:`d_k` is the degree of node :None:None:`k` in the bipartite network and :None:None:`\delta_{u}^{k}` is 1 if node :None:None:`u` is linked to node :None:None:`k` in the original bipartite graph or 0 otherwise.

The nodes retain their attributes and are connected in the resulting graph if have an edge to a common node in the original bipartite graph.

Notes

No attempt is made to verify that the input graph B is bipartite. The graph and node properties are (shallow) copied to the projected graph.

See bipartite documentation <networkx.algorithms.bipartite> for further details on how bipartite graphs are handled in NetworkX.

Parameters

B : NetworkX graph

The input graph should be bipartite.

nodes : list or iterable

Nodes to project onto (the "bottom" nodes).

Returns

Graph : NetworkX graph

A graph that is the projection onto the given nodes.

Newman's weighted projection of B onto one of its node sets.

See Also

generic_weighted_projected_graph
is_bipartite
is_bipartite_node_set
overlap_weighted_projected_graph
projected_graph
sets
weighted_projected_graph

Examples

>>> from networkx.algorithms import bipartite
... B = nx.path_graph(5)
... B.add_edge(1, 5)
... G = bipartite.collaboration_weighted_projected_graph(B, [0, 2, 4, 5])
... list(G) [0, 2, 4, 5]
>>> for edge in sorted(G.edges(data=True)):
...  print(edge) ... (0, 2, {'weight': 0.5}) (0, 5, {'weight': 0.5}) (2, 4, {'weight': 1.0}) (2, 5, {'weight': 0.5})
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

networkx.algorithms.bipartite.projection.weighted_projected_graph networkx.algorithms.bipartite.projection.projected_graph networkx.algorithms.bipartite.projection.overlap_weighted_projected_graph networkx.algorithms.bipartite.projection.generic_weighted_projected_graph

Local connectivity graph

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


GitHub : /networkx/algorithms/bipartite/projection.py#219
type: <class 'function'>
Commit: