restricting vehicle from reaching the depot in the middle of the trip.

36 views
Skip to first unread message

Anuj Gupta

unread,
Jan 13, 2022, 9:38:26 AM1/13/22
to or-tools-discuss
Hello folks,

I would like to get some suggestions on the below problem.
Problem:
I have multiple vehicles which have constraints like maxWeight(maximum weight it can carry),  maxOrders(maximum orders it can take),  etc., and have some orders. The orders are of three types:-
1.)pickup only(in these orders the vehicle has to pickup some weight from a location to the depot).
2.)drop only(in these orders the vehicle has to drop some weight to a location from the depot).
3.) pickup and drop both(in these orders vehicle has to pickup the order from some location and then drop it at the other location.)
So, if the maxWeightCapacity of the vehicle is 30 kg and the orders are like:-
1)drop 20 location A
2)drop 20 location B
3)drop 20 location C
so the vehicle is carrying 20kgs to A then coming back to the depot then carrying 20kgs to B then coming back to the depot and they carrying 20kgs to C and finally to depot.
v1:
depot-->A-->depot-->B-->depot-->C-->depot
but I want that the vehicle shouldn't come back to the depot in between the routes, it should only come to depot either at the starting of route or in the ending only even if it can't take all the orders.
So expected route is:-
depot-->A-->depot
and orders 2 and 3 should be listed as dropped orders(orders which can't be optimized).

how can I achieve this.?

Thanks in advance.

Regards,
Anuj Gupta
Reply all
Reply to author
Forward
0 new messages