'Eigenvector centrality: P3'

def test_P3(self):

    G = nx.path_graph(3)
    b_answer = {0: 0.5, 1: 0.7071, 2: 0.5}
    b = nx.eigenvector_centrality_numpy(G)
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n], places=4)
    b = nx.eigenvector_centrality(G)
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n], places=4)
