Added functions to set neighbor ids from root