I am new to or-tools and I am trying to implement something similar to the employee scheduling example from here.
I have a matrix that represents which employee is assigned to which shift:
IntVar[,] assign = new IntVar[numEmployees, numShifts];
An employee has a number of hours he is supposed to work per week and a shift has an individual duration. These numbers are stored in two separate arrays.
How would I create an objective function to minimize the deviation between the sum of the assigned shifts' durations and the employee's hours per week, so that each employee comes as close to his goal as possible?
Thanks in advance :)