'Calculates betweenness centrality and returns a node => weight dictionary.
Node.centrality is updated in the process.
Node.centrality is higher for nodes with a lot of passing traffic.'

def betweenness_centrality(self, normalized=True, directed=False):

    bc = brandes_betweenness_centrality(self, normalized, directed)
    bc = nodedict(self, ((self[id], w) for (id, w) in bc.items()))
    for (n, w) in bc.items():
        n._centrality = w
    return bc
