networkl是一个python包,它将networkx包的范围扩展到超大的时变图。它支持复杂网络的操作和有效的纵向分析
networkl的Python项目详细描述
networkl是一个python包,它扩展了networkx包的范围 到超大型时变图。它支持操作和高效 复杂网络的纵向分析
更新中所有对最短路径长度的快速示例 使用sparsegeodesicmatrix数据结构的无向图:
>>> import networkx as nx >>> import networkl as nl >>> from random import randrange >>> >>> N=1000 >>> G = nx.erdos_renyi_graph(N,0.1) #create a graph >>> SparseD = nl.sparse_distance_matrix(G) #compute the Sparse Distance Matrix >>> >>> new_edges = [(randrange(N),randrange(N)) for c in range(100)] #add edges and update Distance Matrix >>> for i,j in new_edges: >>> if G.has_edge(i,j) or i==j: >>> continue >>> nl.update_distance_matrix(G,SparseD,i,j,mode='add') >>> >>> print SparseD[1][1] #accessing distance values
在GNU v2许可下分发;请参阅license.txt:
Copyright (C) 2015 NetworkL Developers Moreno Bonaventura <m.bonaventura@qmul.ac.uk>