'Closeness centrality: P4'

def test_P4(self):

    G = nx.path_graph(4)
    b = nx.current_flow_closeness_centrality(G)
    b_answer = {0: (1.0 / 6), 1: (1.0 / 4), 2: (1.0 / 4), 3: (1.0 / 6)}
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n])
