#NEWLINE# def test_C4( self ) : #NEWLINE# #INDENT# 'Edge betweenness centrality: C4' #NEWLINE# G = nx . cycle_graph ( 4 ) #NEWLINE# b = nx . edge_betweenness_centrality ( G , weight = None , normalized = True ) #NEWLINE# b_answer = { #NEWLINE# #INDENT# ( 0 , 1 ) : 2 , #NEWLINE# ( 0 , 3 ) : 2 , #NEWLINE# ( 1 , 2 ) : 2 , #NEWLINE# ( 2 , 3 ) : 2 , #NEWLINE# #UNINDENT# } #NEWLINE# for n in sorted ( G . edges ( ) ) : #NEWLINE# #INDENT# assert_almost_equal ( b [ b_answer ] , ( b_answer [ n ] / 6.0 ) )