Set global indexes of nodes