How to implement Break Time

798 views
Skip to first unread message

OR-Learner

unread,
Sep 16, 2021, 3:44:02 AM9/16/21
to or-tools-discuss
Hi,

I'm currently struggling with modelling CVRP with break time in python.

I've yet known that using SetBreakIntervalsOfVehicle and FixedDurationIntervalVar may enable us to implement break time.
But, I have some questions about details, so please let me ask those.

Qusetions:
  1. What is the third argument of SetBreakIntervalsOfVehicle, "node_visit_transit" ?
    I think this is the vector of time that vehicle must stay in the place at least for, and after that vehicles can start to rest. 
  2. I found some says that SetBreakIntervalsOfVehicle has a bug, especially in Google Groups and Github.
    I want to ask whether this is true or not, and if true, concretely what kind of bug is there and what version's OR-Tools has a bug?
  3.  Are there other ways to implement break time?
    I tried to implement by using node duplicatation, but it doesn't works.
    If you have any ideas to realize, please let me know.  
Thank you in advance.

OR-Learner

unread,
Sep 22, 2021, 3:36:20 AM9/22/21
to or-tools-discuss
Dear All,
especially Laurent, Mizux

I would be grateful if you could let us have your answer concerning this matter.
I’m afraid that my message may not have reached you.

2021年9月16日木曜日 16:44:02 UTC+9 OR-Learner:

Mizux Seiha

unread,
Sep 22, 2021, 6:24:24 AM9/22/21
to or-tools-discuss
Hi, sorry for the delay.

1. Basically break is implemented to not be placed during service time but during the travel part.
Small explanation: suppose you have the route "A -> B", so the routing solver will use your transit callback i.e. transit(/*from_index=*/A, /*to_index=*/B).
this transit can be split in two parts: the service time at node A and the travel time from A to B.
Since break can't overlap the service time the BreakInterval need to know which part of the transit value correspond to the service time thus you pass an solver index based array  "node_visit_transit".
note: some time this "service time" is also call "pre-travel time".

2. May I have some links concerning the "issue" are you referring too ?
note: we start to have few samples: vrp_break.py and vrp_break_from_start.py to play with...

3. I'm afraid there is no easy way to implement break without using this method. e.g. if you try to model break as a dummy node with a service time equal the the break time you still have issue to compute the travel from and to this break since it has not a real location (i.e. A -?> Break -?> B) (ed also solver often use this to "teleport" vehicle from location to another far away from each other)

side note: In order for the solver to place a break along the route, this break will be integrated to the SlackVar i.e. each node should have a slackVar with a upper bound large enough so the solver can "place" the break in it.

OR-Learner

unread,
Sep 27, 2021, 11:41:11 PM9/27/21
to or-tools-discuss
Thank you for teaching me so nicely.

The links of Issues are as follows.

I tried to implement break time using ortools==8.2 and then Segmentation Fault happend.

The question is below.
  1. Is there still any bug related break time or not ?
  2. If not, what version's of OR-Tools should I use without break time bugs ? (9.0?)
  3. I'd like to ask you to be my reference. What kind of bug were there related to break time ?
If you could answer these questions, that would be great.
2021年9月22日水曜日 19:24:24 UTC+9 mizu...@gmail.com:

Mizux Seiha

unread,
Sep 28, 2021, 2:57:55 AM9/28/21
to or-tools-discuss
I've tried to label all break related bugs on github -> https://github.com/google/or-tools/labels/routing_break

OR-Learner

unread,
Sep 28, 2021, 11:19:44 AM9/28/21
to or-tools-discuss
Thank you for your prompt response.

I understood that all bugs you've grasp are on above links and that you're trying to resolve those.

2021年9月28日火曜日 15:57:55 UTC+9 mizu...@gmail.com:
Reply all
Reply to author
Forward
0 new messages