1

Is there a way when converting from networkx to igraph to keep the networkx node names? As it is referred in here "Vertex names will be converted to "_nx_name" attribute and the vertices will get new ids from 0 up (as standard in igraph)".

Georgia
  • 53
  • 5

1 Answers1

1

igraph internally keeps the ids contiguous, so it does not allow messing with them.

You should be able to set the _nx_name as the name attribute and then delete it.

# replace name
G.vs["name"] = G.vs["_nx_name"]
del(G.vs["_nx_name"])

# check if named
G.is_named()
PidgeyUsedGust
  • 797
  • 4
  • 11