'Betweenness centrality: P5'

def test_P5(self):

    G = nx.Graph()
    nx.add_path(G, range(5))
    b_answer = {0: 0, 1: 0.5, 2: 0.5, 3: 0, 4: 0, 5: 0}
    b = nx.betweenness_centrality_subset(G, sources=[0], targets=[3], weight=None)
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n])
