CVRPTW with fuel constraints

176 views
Skip to first unread message

Mario Andonaire

unread,
Oct 13, 2021, 7:21:03 PM10/13/21
to or-tools-discuss
Hi all

I am currently modeling a capacitated vehicle routing problem in Java(only deliveries) with time windows and fuel constraints, so far, I have managed to satisfy the capacity and time windows constraints.

First, I am having trouble with the fuel, I've seen this example: https://github.com/google/or-tools/blob/stable/examples/cpp/cvrptw_with_refueling.cc, here fuel consumption only depends on the distance traveled. How could I make fuel consumption depend on the load of the vehicle at that time and the distance between the nodes?

Second, is it possible to "block" some nodes within some specific time windows, this means not allowing any vehicle to go trough  those nodes during a specific period of time and then returning back to normal. I was thinking about setting a very high arc cost when traveling to those nodes, but not sure if I can change this cost according to specific time intervals. 

Thanks a lot.

Kind regards,
Mario

Mizux Seiha

unread,
Oct 18, 2021, 2:49:31 AM10/18/21
to or-tools-discuss
1. Having a transit callback depending if the actual load is basically not supported.
e.d. in C++ you could use AddDimensionDependentDimension() e.g. https://github.com/google/or-tools/issues/574#issuecomment-430203076

2. When setting a TimeWindows on a node you usually use `time_dim.CumulVar(index).SetRange(time_windows_start, time_windows_end)` then you can also use RemoveInterval()
e.g. https://github.com/Mizux/tsp_multiple_days/blob/7201cf2017bd89bd99becd83375bc40e177d2b72/40_Locations_3_days.py#L105-L118
Reply all
Reply to author
Forward
0 new messages