def get_shortest_distance(pair_id):
global graph
id_1 = int(pair_id.split('_')[0])
id_2 = int(pair_id.split('_')[1])
try:
return len(nx.shortest_path(graph, source=id_1, target=id_2)) - 1
except:
return -1
compute_topological_features.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录