it's not a big deal just select the start node and then traverse and sort it according to any sorting algorithm better you use bubble sort.