'Betweenness centrality: K4'

def test_K4_normalized(self):

    G = nx.complete_graph(4)
    b = nx.current_flow_betweenness_centrality(G, normalized=True)
    b_answer = {0: 0.25, 1: 0.25, 2: 0.25, 3: 0.25}
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n])
    G.add_edge(0, 1, weight=0.5, other=0.3)
    b = nx.current_flow_betweenness_centrality(G, normalized=True, weight=None)
    for n in sorted(G):
        assert_almost_equal(b[n], b_answer[n])
    wb_answer = {0: 0.2222222, 1: 0.2222222, 2: 0.30555555, 3: 0.30555555}
    b = nx.current_flow_betweenness_centrality(G, normalized=True, weight='weight')
    for n in sorted(G):
        assert_almost_equal(b[n], wb_answer[n])
    wb_answer = {0: 0.2051282, 1: 0.2051282, 2: 0.33974358, 3: 0.33974358}
    b = nx.current_flow_betweenness_centrality(G, normalized=True, weight='other')
    for n in sorted(G):
        assert_almost_equal(b[n], wb_answer[n])
