# betweennessCentrality¶

betweennessCentrality(filename)
Writes the betweenness centrality of each individual node to a text file. The file contains the centralities written in order of the node number.

## Parameters¶

filename: String
Name of the file to which the betweenness centralities will be written

## Notes¶

If is the number of nodes in the network and is the set of all shortest path between node and node , the betweenness centrality of node is:

The normalisation is such that the betweenness centrality is always in the interval . The distance between two nodes is defined as described in meanPathLength.

## Example (python-conedy)¶

import conedy as co

N = co.network()

i = N.cycle(20, 1, co.node(), co.weightedEdge())

N.addEdge(i + 1, i + 7, co.weightedEdge(1.0))
N.addEdge(i + 7, i + 1, co.weightedEdge(2.0))
N.addEdge(i + 1, i +11, co.weightedEdge(3.0))
N.addEdge(i +11, i + 1, co.weightedEdge(4.0))

N.betweennessCentrality("output/betweennessCentrality.py.out")


## Example (conedy)¶

network N;

int i = N.cycle(20, 1, kuramoto());

N.betweennessCentrality( "output/betweennessCentrality.co.out" );

Network Measures

#### Next topic

closenessCentrality