The MIO service does have a priority
input value for itinerary items that you can set. https://learn.microsoft.com/en-us/bingmaps/rest-services/routes/optimized-itinerary-data
From the docs:
Each itinerary item is given an item priority (from
1
to100
) and the Multi-Itinerary Optimization API will always first attempt to maximize the sum of scheduled items priorities. Note that Priority1
is the lowest priority and100
is the highest priority. Multiple itinerary items can have the same priority value. If all items have a priority of1
(the default value), then the API maximizes the number, or count, of scheduled items. In addition, thecostvalue
parameter can be set to eitherTravelTime
orDistance
: this parameter will then minimize the travel time or distance traveled, respectively, for the scheduled items.
I believe this does try and order the by priority but doesn't do a strict ordering based on it.
As you are aware the MIO service will be retired in the future. Here are some useful resources on alternatives:
- https://learn.microsoft.com/en-us/azure/azure-maps/itinerary-optimization-service
- https://github.com/microsoft/dstoolkit-route-optimization
- https://github.com/kiegroup/optaplanner
- https://github.com/VROOM-Project/vroom
- https://github.com/reinterpretcat/vrp
- https://developers.google.com/optimization/routing/