Package networkx :: Module centrality

[frames | no frames]

## Module networkx.centrality

Centrality measures.

Function Summary
| ``betweenness_centrality`(G, v, cutoff, normalized)` Betweenness centrality for nodes.
| ``closeness_centrality`(G, v)` Closeness centrality for nodes (1/average distance to all nodes).
| ``degree_centrality`(G, v)` Degree centrality for nodes (fraction of nodes connected to).
| ``edge_betweenness`(G, nodes, cutoff)` Edge Betweenness

Variable Summary
`str` | `__author__` = `'Aric Hagberg (hagberg@lanl.gov)\nPieter Sw...`
`str` | `__credits__` = `''`
`str` | `__date__` = `'$Date: 2005-07-06 08:02:28 -0600 (Wed, 06 Ju...`
`str` | `__revision__` = `'$Revision: 1064 $'`

Function Details

### betweenness_centrality(G, v=False, cutoff=False, normalized=True)

Betweenness centrality for nodes. The fraction of number of shortests paths that go through each node.

    >>> b=betweeness_centrality(G)

Returns a dictionary of betweenness values keyed by node. The betweenness is normalized to be between [0,1]. The algorithm is described in [brandes-2003-faster].

If normalized=False the resulting betweenness is not normalized.

Reference:

[brandes-2003-faster] | Ulrik Brandes, Faster Evaluation of Shortest-Path Based Centrality Indices, 2003, available at http://citeseer.nj.nec.com/brandes00faster.html

### closeness_centrality(G, v=False)

Closeness centrality for nodes (1/average distance to all nodes).

Returns a dictionary of closeness centrality values keyed by node. The closeness centrality is normalized to be bewtween [0,1].

### degree_centrality(G, v=False)

Degree centrality for nodes (fraction of nodes connected to).

Returns a dictionary of degree centrality values keyed by node.

The degree centrality is normalized to be bewtween [0,1].

### edge_betweenness(G, nodes=False, cutoff=False)

Edge Betweenness

WARNING:

This module is for demonstration and testing purposes.

Variable Details

### __author__

  Type:
    `str`
  Value:

        '''Aric Hagberg (hagberg@lanl.gov)
        Pieter Swart (swart@lanl.gov)'''

### __credits__

  Type:
    `str`
  Value:

        ''

### __date__

  Type:
    `str`
  Value:

        '$Date: 2005-07-06 08:02:28 -0600 (Wed, 06 Jul 2005) $'

### __revision__

  Type:
    `str`
  Value:

        '$Revision: 1064 $'

Generated by Epydoc 2.1 on Sun Aug 21 08:06:59 2005 | http://epydoc.sf.net