I am looking for an efficient way to relabel the node IDs of a DGLGraph based on a dictionary where the keys represent the old node IDs and the values are the new node IDs. In NetworkX, a similar task can be accomplished using the relabel_nodes(G, mapping, copy=True) function. However, I specifically need a solution tailored for DGLGraph, and I want to avoid using any NetworkX functions.
Although I have implemented a node relabeling (IDs) function by looping through all the nodes, this method is currently too slow for my requirements. I am seeking a faster alternative to relabel DGLGraph nodes based on the provided dictionary. Your assistance in providing an optimized solution is greatly appreciated. Thank you.