Prevent vehicle to visit depo during trip

79 views
Skip to first unread message

Burhan

unread,
Jan 9, 2022, 6:34:32 AM1/9/22
to or-tools-discuss

Requirement overview:

Trip route can have following type of task

  • Delivery only

  • Pickup only

  • Pickup from one location and deliver to another location


Condition: Once a trip starts from depo, it should come back only when the trip is completed. During the trip it shouldn’t come to depo. 


As we understand, OR tools need delivery and pickup location for each order else it's giving issues.

Ref: https://groups.google.com/g/or-tools-discuss/c/WyEOZAv8IJs/m/PxWb7Lq7AwAJ 

To overcome this, for all delivery orders we add depo as pick location and for all pick orders, we add depo as delivery location. This is working fine if all orders are for delivery. However if orders are having a mix of delivery and pick, in this scenario, during the trip if depo location is near to the last pick node, vehicle will go to depot if OR-tools is optimizing route based on location (considering last pick needs to be delivered at depo). 


This leads to wrong route optimisation. Looking for help here. Also pls. advice if we are missing something or having wrong understanding. 


Laurent Perron

unread,
Jan 9, 2022, 7:59:35 AM1/9/22
to or-tools-discuss
is this a duplicate of the previous question on the same topic ?

CONFIDENTIALITY NOTICE: The information transmitted by this email is confidential and intended only for the recipient specified in message only. This email may contain proprietary, business-confidential, and/or privileged material. Do not share any part of this message with any third party, without a written consent of the sender. If you received this in error, please contact the sender and delete the materials.

--
You received this message because you are subscribed to the Google Groups "or-tools-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to or-tools-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/or-tools-discuss/be4283a0-77df-4ea7-a924-fb0b2cd9d66dn%40googlegroups.com.


--
--Laurent

Burhan

unread,
Jan 9, 2022, 8:07:57 AM1/9/22
to or-tools-discuss
Yes

Since last one was having brief details, added more details. 

Burhan

unread,
Jan 9, 2022, 8:09:04 AM1/9/22
to or-tools-discuss
Wondering if you meant the question on stackexchange & this... If so, yes. 

blind.line

unread,
Jan 9, 2022, 2:43:38 PM1/9/22
to or-tools...@googlegroups.com
For this kind of thing, I usually use a conditional constraint. 

The condition is that the NextVar of the All(not-depot nodes) is the depot. 

The constraint then is that the dimension in question is empty. 

In words, if the vehicle is heading to the depot to pick up more stuff, then it cannot do so unless it is empty. 

You can play games with multiple dimensions to fine tune that. Say dimension A is for things loaded at depot, and B for things loaded in the field. Then even if B pickups are made, you can’t drop them at depot until all A items are delivered and vehicle is empty. 

These conditional constraints do slow the solver down a little bit. 

James

On Jan 9, 2022, at 03:34, Burhan <bur...@connectsys.in> wrote:



Anuj Gupta

unread,
Jan 10, 2022, 4:09:26 AM1/10/22
to or-tools-discuss
I didn't get in completely, can you please explain it a little bit more?
Reply all
Reply to author
Forward
0 new messages