How do I create a new node in a nxGraph with either a custom ID, or relabel the ID? The property I'm trying to change is that id label that's set to '0':
graph [
node [
id 0
label "Category:Class-based_Programming_Languages"
]
I've tried to do this but it didn't work:
G = nx.Graph()
pageid = 12345
G.add_node('test', id = pageid)
But this does not change the 'id' value, rather, it is just straight-up ignored. The changed id can be seen right there on the Python program, but the problem lies with using write_gml function. It does not change that id value. Does anyone know how I can go about this? Thank you!