NetworkX

Previous topic

networkx.algorithms.bipartite.basic.density

Next topic

networkx.algorithms.bipartite.projection.projected_graph

networkx.algorithms.bipartite.basic.degrees

networkx.algorithms.bipartite.basic.degrees(B, nodes, weighted=False)

Return the degrees of the two node sets in the bipartite graph B.

Parameters :

G : NetworkX graph

nodes: list or container :

Nodes in one set of the bipartite graph.

Returns :

(degX,degY) : tuple of dictionaries

The degrees of the two bipartite sets as dictionaries keyed by node.

See also

color, density

Examples

>>> from networkx.algorithms import bipartite
>>> G = nx.complete_bipartite_graph(3,2)
>>> Y=set([3,4])
>>> degX,degY=bipartite.degrees(G,Y)
>>> degX
{0: 2, 1: 2, 2: 2}