graph-walker
graph-walker copied to clipboard
Support non-integer node labels
In networkx
, nodes can be any hashable object (e.g., a text string, an image, an XML object, another Graph, a customized node object, etc.). But my understanding is that graph-walker
requires nodes to be integers.
Current behavior
if we run random_walks
on a simple graph with strings as node labels, an error is thrown:
invalid literal for int() with base 10:
Desired behavior
Ideally, the graph-walker
package could check for non-integer nodes during the preprocessing step and either return a more readable error message (e.g. "Nodes are required to be integers") or relabel the graph to use integer nodes and then convert these integers back to the original objects in output.
Possible solution
A current workaround is for the user to run convert_node_labels_to_integers(label_attribute = 'name')
prior to running the random walk.
I am also getting this issue. I second this