Sort node ids in test_ways_for_node