Skip to content

Too loose max_task bound derived from TW #1243

@jcoupey

Description

@jcoupey

When vehicles have a time window, we rely on a lower bound of accumulated service time for compatible jobs to derive an upper bound of the number of tasks that can be served by the vehicle:

const auto vehicle_duration = vehicle.available_duration();
std::size_t doable_tasks = 0;
Duration time_sum = 0;
for (std::size_t j = 0; j < jobs.size(); ++j) {
if (time_sum > vehicle_duration) {
break;
}
if (vehicle_ok_with_job(v, job_times[j].rank)) {
++doable_tasks;
time_sum += job_times[j].action;
}
}
vehicle.max_tasks = std::min(vehicle.max_tasks, doable_tasks);

The way it's currently done is too loose. For example if a vehicle has a TW with length 1000 and all jobs have a service of 100, then the max_tasks value we get is 11 where it should really be only 10.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions