def CreateGraph():
G = nx.Graph()
f = open('input.txt')
n = int(f.readline())
for i in range(n):
G.add_node(i+1)
no_of_edges = int(f.readline())
for i in range(no_of_edges):
graph_edge_list = f.readline().split()
G.add_edge(int(graph_edge_list[0]), int(graph_edge_list[1]))
vert = int(f.readline())
return G, vert
#draws the graph and displays the weights on the edges
egocentric_network_1_5.py 文件源码
python
阅读 33
收藏 0
点赞 0
评论 0
评论列表
文章目录