Inconsistent number of nodes when saving a graph

17 visualizzazioni
Passa al primo messaggio da leggere

raymon X

da leggere,
12 ott 2021, 01:18:3412/10/21
a networkx-discuss
Hey All, I struggle to find a solution to this issue.
I created a graph with
> G = nx.from_numpy_array(A)
that has the following nr of nodes:

> nx.number_of_nodes(G)
5084

After I save it:
> nx.write_edgelist(G,'edge_list.nx')

and read again
graph = nx.read_edgelist('edge_list.nx')

I get a different number of nodes:
> nx.number_of_nodes(graph)
5079

Why?

Input numpy array attached.
adjmat.npz.zip
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi