I often have this case of vehicle routing problem:
A bunch of services with a time window for the morning (e.g. 8:00 - 12:30)
And a bunsch of services with a time window for the afternoon (eg. 12:30 - 17:00)
The vehicle has a time window from 8:00 till 17:00 then.
Now when the services for the afternoon do not fill the complete afternoon time window, they get placed in the middle of the time window (e.g from 13:30 - 16:00).
Is there any parameter, that causes all services to be connected to each other, when possible.
The first idea I had, was to set the vehicles departure and arrival time after the first algorithm run according to the number of services it gets assigned to. But then I need a second run, which consumes unneccessary time.
Does someone have a simple idea, how to get rid of this behaviour?
The issue is not easy to understand properly. What exactly do you mean by “the middle of the time window (e.g from 13:30 - 16:00)”? Is this some kind of constraint in your solution that you haven’t specified? Can you give a simple but specific example of what’s not working?
As you can see, there is a big gap between jop 1 and 3. For me it would be better if job 2 would start at time 30,job 1 at time 40, job 3 at 50 and job 4 at 60. So the jobs are in a proper order, but they should be pulled together, so there is no waiting time between them.