I've been asked for some recommendation for a nice little usecase - as I created another testclient for this let me share my results with you.
Here's the story:
- Imagine you are returning from a long distance trip with an empty vehicle. At that stage you already know the distance and traveltime of the blue relation based on a distance matrix or 1:1 route. Let's call these KPIs the "reference" for the next steps.
- Now within your horizon there's a bunch of potential pickup-delivery orders you could go for.
- First I created a dummy input tour with the blue relation and enforced the pickup location to be FIRST_CUSTOMER_STOP and the delivery as LAST_CUSTOMER_STOP. Then I performed a FindChangeToursProposalsRequest for each pickup delivery candidate:
The output of these calls gives me the decision criteria to compare the impact of the potential "changeToursActions" compared to the "reference" KPIs.
Code: Select all
FindChangeToursProposalsRequest findChangeToursProposalsRequest = new FindChangeToursProposalsRequest { proposalsOptions = new ChangeToursProposalsOptions { }, proposalsQuery = new InsertionPositionsForOrdersQuery { targetVehicleIds = new string[] { "vehicle" }, orderIds = new string[] { orderId }, storedRequestId = toursResponse.storedRequestId } };
- I then used the confirmed changeToursActions to compute the complete insertion moves.
- This approach gives a very good result in terms of quality but it also "wastes" number of transactions with a square complexity. This is why I evaluated an alternative approach below.
- For the alternative approach I didn't use the xTour module but a linear growing process based on three contributing factors per candidate:
- The leg from the global starting location to a candidates pickup
- the leg from the candidates pickup to the candidates delivery
- the leg from the candidates delivery to the global delivery.
- [1:N] : from the global pickup to all candidates pickups
- N-times [1:1] : from each candidates pickup to its own delivery (this info is supposed to be available once such a candidate is inserted into the global pool!)
- finally a [N:1] matric from each candidates delivery to the global delivery
- NO matter what approach you want to go for: it probably makes sense to define some simple filter criteria to not consider changeTours which exceed some threshold value, e.g. based on a relative "increase" of traveltime or distance caused by the detour.
- Last but not least you could evaluate to define some other criteria in advance which reduces the input candidates for that little process, e.g. based on corridor searches / reachable areas.