Map original node labels of the Graph
to new ones between 0 and graph.number_of_nodes - 1.
Creates two dictionaries that keep track of the mapping between original labels and new labels numbered between 0
and graph.number_of_nodes - 1.
- Parameters:
graph (Graph) – The graph whose nodes should be relabeled.
- Returns:
A tuple containing the input graph with relabeled nodes and two dictionaries containing the mapping from old
labels to new and vice versa.
- Return type:
tuple[Graph, dict[Any, int], dict[int, Any]]