本文整理汇总了Python中Graph.readedgelist方法的典型用法代码示例。如果您正苦于以下问题:Python Graph.readedgelist方法的具体用法?Python Graph.readedgelist怎么用?Python Graph.readedgelist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graph
的用法示例。
在下文中一共展示了Graph.readedgelist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: WCC_insert
# 需要导入模块: import Graph [as 别名]
# 或者: from Graph import readedgelist [as 别名]
# WCC_insert(1,[1,2,3,4,66])
# # #WCC(P)
# # #wcc(1,[1,2,3,4,66])
# # # test = [1,2,3,4,5,6,7,8,9,8,9,10]
# # # for i in range (10000000):
# # # #te = deepcopy(test) 17
# # # s = []
# # # for j in test:
# # # s.append(j)
if __name__ == '__main__':
path1 = 'e:/data/kaho.csv'
path2 = 'e:/data/nodes_kaho.csv'
GRAPH = Graph.readedgelist(path1)
print('===read graph completed!===')
label = {}
file=open(path2,'rb')
reader = csv.reader(file)
for row in reader:
label[int(row[0])] = row[1]
GRAPH.Remove_node(0)
removeEdge(GRAPH)
mat = adjMatrix(GRAPH)
print('===remove edges completed!===')
connectivity,CCC= count_connectivity(GRAPH)
for i in range(len(CCC)):
if len(CCC[i])==1:
GRAPH.Remove_node(CCC[i][0])
del CCC[i]