'Edge betweenness centrality: P5 directed'

def test_P5_directed(self):

    G = nx.DiGraph()
    nx.add_path(G, range(5))
    b_answer = dict.fromkeys(G.edges(), 0)
    b_answer[(0, 1)] = b_answer[(1, 2)] = b_answer[(2, 3)] = 1
    b = nx.edge_betweenness_centrality_subset(G, sources=[0], targets=[3], weight=None)
    for n in sorted(G.edges()):
        assert_almost_equal(b[n], b_answer[n])
