def most_central_edge(G): centrality = betweenness(G, weight='weight') return max(centrality, key=centrality.get)
def most_central_weighted_edge(graph): centrality = betweenness(graph, weight='weight') return max(centrality, key=centrality.get)
def most_central_edge(G): centrality = betweenness(G, weight='weight') #return max(centrality, key=centrality.get) return sorted(centrality, key=centrality.get, reverse=True)[:5]
def most_central_edge(graph): """ 中心度加权 """ centrality = betweenness(graph, weight="weight") return max(centrality, key=centrality.get)