Routing AGVs by Sorting