``` <pre>def degree_centrality(email, nodes): top = set(nodes) bottom = set(email) - top s = 1.0/len(bottom) centrality = dict((n,d*s) for n,d in G.degree_iter(top)) s = 1.0/len(top) centrality.update(dict((n,d*s) for n,d in G.degree_iter(bottom))) return centrality
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)