Generate random node indices instead of calling random.choice.