#NEWLINE# def _accumulate_edges( betweenness , S , P , sigma , s ) : #NEWLINE# #INDENT# delta = dict . fromkeys ( S , 0 ) #NEWLINE# while S : #NEWLINE# #INDENT# w = S . pop ( ) #NEWLINE# coeff = ( ( 1.0 + delta [ w ] ) / sigma [ w ] ) #NEWLINE# for v in P [ w ] : #NEWLINE# #INDENT# c = ( sigma [ v ] * coeff ) #NEWLINE# if ( ( v , w ) not in betweenness ) : #NEWLINE# #INDENT# betweenness [ ( w , v ) ] += c #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# betweenness [ ( v , w ) ] += c #NEWLINE# #UNINDENT# delta [ v ] += c #NEWLINE# #UNINDENT# if ( w != s ) : #NEWLINE# #INDENT# betweenness [ w ] += delta [ w ] #NEWLINE# #UNINDENT# #UNINDENT# return betweenness