NetworkX

Previous topic

networkx.algorithms.bipartite.projection.generic_weighted_projected_graph

Next topic

networkx.algorithms.bipartite.cluster.clustering

networkx.algorithms.bipartite.spectral.spectral_bipartivity

networkx.algorithms.bipartite.spectral.spectral_bipartivity(G, nodes=None, weight='weight')

Returns the spectral bipartivity.

Parameters :

G : NetworkX graph

nodes : list or container optional(default is all nodes)

Nodes to return value of spectral bipartivity contribution.

weight : string or None optional (default = ‘weight’)

Edge data key to use for edge weights. If None, weights set to 1.

Returns :

sb : float or dict

A single number if the keyword nodes is not specified, or a dictionary keyed by node with the spectral bipartivity contribution of that node as the value.

Notes

This implementation uses Numpy (dense) matrices which are not efficient for storing large sparse graphs.

References

[R84]E. Estrada and J. A. Rodríguez-Velázquez, “Spectral measures of bipartivity in complex networks”, PhysRev E 72, 046105 (2005)

Examples

>>> from networkx.algorithms import bipartite
>>> G = nx.path_graph(4)
>>> bipartite.spectral_bipartivity(G)
1.0