'Betweenness centrality: box and path'

def test_box_and_path(self):

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