Hi Scott,
when modelling pickups and deliveries (the ones that extend
Service), it is assumed that pickups (once picked up) stay in the
vehicle until it arrives at its end location, and it is assumed that
deliveries are (implicitly) picked up at the start location of the
vehicle and unloaded at delivery location.
What I can suggest you is to model it as open multiple depot problem
with services (for example deliveries that extend Service). This
assumes that you also have several vehicles, at least one vehicle at
A and B. Optimize it which results for example in two open routes,
tour1 = A -> C and tour2 = B -> D, and pull together the
resulting routes into a single route for your one vehicle, i.e.
vehicle_start_location - tour1 - tour2 - vehicle_end_location. If
your case becomes more complex than the example you sent (which I
assume it is) than this probably yields sub-optimal results.
The other way might be to fork jsprit and extends it such that it
can deal with shipments having multiple pickup and delivery
locations. I assume it is not the most difficult extension since
instead of having one pickup loop you have several (but it is
probably little more difficult than just adding another loop).
Another way is what was once suggested from Phil that you can define
four shipments A->C, A->D,B->C,B->D and define A->C
and A->D as related, i.e. that you need to make sure (by defining
an appropriate constraint) that only one shipment, either A->C or
A->D, can be in the solution. The other will end up in the
unassigned job list. But as Phil also wrote, it is more a random
walk rather than a guided search. But still, you might get
reasonable solutions, especially if you use the regret insertion
(since regret insertion scores the jobs first according to
opportunity costs, second_best - best).
Best
Stefan
Am 02/03/15 um 21:17 schrieb yowl
yowlxx: