VRP waiting time penalty: How to set different penalty coefficient by waiting time?

36 views
Skip to first unread message

S l

unread,
Jul 23, 2024, 9:17:55 PM (2 days ago) Jul 23
to or-tools-discuss
Hi,

for VRP, I am trying to design the waiting time penalty this way:

Every node has a service_start_time. 

if vehicle arrive the node within 5 minutes after the service_start_time, no penalty apply. 

if vehicle arrive between 5 to 10 minutes, coefficient penalty is 4.

if vehicle arrive after 10 minutes, coefficient penalty is 2.

Here is the penalty I am expecting:

if vehicle arrive 7 minutes late: (7-5)*4 = 8

if vehicle arrive 14 minutes late: (14-10)*2 + 5*4 = 28

The problem cannot be solved by stacking two time dimensions with SetCumulVarSoftUpperBound becasue the coefficient penalty decreased. When sets coefficient_penalty to negative,  there is always no solution found.

Is there a way to shape the waiting penalty like this?

Best Regards
Reply all
Reply to author
Forward
0 new messages