NetComp
NetComp copied to clipboard
networkx 2 compatibility
This version allows using both networkx 1 and networkx 2. Most changes are connected to formating.
Main changes to allow networkx 2 usage are:
-
(G.subgraph(c).copy() for c in nx.connected_components(G))
instead ofnx.connected_component_subgraphs(G)
(cause the function was deprecated) here and here - converting returned object to dict
list(dict(G.degree()).values())
instead oflist(G.degree().values())
here - converting returned object to list
[list(G.neighbors(i)) for i in range(n)]
instead of[G.neighbors(i) for i in range(n)]
here
#2