How can I specify an atrribute to uniquely identify a node to networkx?

Viewed 20

I understand that we can specify any object to networkx as as node as long its hashable: https://networkx.org/documentation/stable/tutorial.html#nodes

But is it possible to specify an object's attribute as the "key" or hash to identify the node ?

I have an object as a node which has an attribute called "id" that can uniquely identify the node. Other attributes should not be considered. The node object does not support eq Dunder method.

0 Answers
Related