Uh sorry, I thought my solution is actually similar to how inode works. If not, can you please explain technically how the structure is structured? What each node keeps? And how to solve my current problem with it?
Also, how rename_vertex can help with the current structure? Of course I need to rename the vertices, but figuring the algorithm is the problem.