import networkx as nx
import matplotlib.pyplot as plt
import pylab
import numpy as np
def getClosenessCentrality(graph):
closeness=[]
for i in graph.nodes():
sumdij = 0;
for j in graph.nodes():
if(i != j):
try:
sumdij += nx.dijkstra_path_length(graph, source=i, target=j
接近中心性python实现
最新推荐文章于 2023-06-11 16:40:06 发布