Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created April 5, 2020 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/ae08ff16616fda0c0cd858203566d35a to your computer and use it in GitHub Desktop.
Save prateekjoshi565/ae08ff16616fda0c0cd858203566d35a to your computer and use it in GitHub Desktop.
def edge_to_remove(graph):
G_dict = nx.edge_betweenness_centrality(graph)
edge = ()
# extract the edge with highest edge betweenness centrality score
for key, value in sorted(G_dict.items(), key=lambda item: item[1], reverse = True):
edge = key
break
return edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment