Skip to content

Minimize overtime and undertime

The goal is to minimize both overtime and undertime to ensure a fair and equitable distribution of work among employees. Hard limits are established, as outlined in the section on Target Working Time per Month.

Implemented using Google's OR Tools

src/cp/objectives/minimize_overtime.py
    model.add_abs_equality(
        possible_overtime_variable,
        sum(possible_working_time) - target_working_time,
    )
    ...
return sum(possible_overtime_absolute_variables) * self._weight

Each minute of overtime or undertime is punished with a negative score in the objective function.