Description of the problem
Each week our hero, say John, can stack a minimum of $2.5$ hours and a maximum of $6.5$ hours if he works more than $8$ hours per day.
Each day John cannot stack less than $0.5$ hours and more than $2.5$ hours: actually, he is forced to stack at least $0.5$ hours per day.
Then he can use these stacked hours to skip working hours: he can spend either from $1$ to $5.5$ hours per day or $8$ hours per day; in the former case John is allowed to stack hours, in the latter one he's not allowed to do so.
Consider the first example to clarify: during the first week of the month John works from Monday to Friday stacking $6.5$ hours, thus during the second week of the month he can spend $5.5$ hours to skip the first $5.5$ working hours of, say, Tuesday but on Tuesday he can stack , say, $1$ hour.
Consider the second example to clarify: during the first and the second week of the month John works from Monday to Friday stacking $2(6.5)=13$ hours, thus during the third week of the month he can spend $8$ hours on Monday to skip the whole working day and $5$ hours on Tuesday to skip a part of the working day but stacking, say, $2$ hours on Tuesday and nothing on Monday (because he spent $8$ hours on that day).
Objective function
I should find the optimal stacking/spending scheme, i.e. how many hours to stack and to spend each day of the week, according to the constraints provided in order to minimise the number of stacked days at the end of each month or, if not possible, at the end of each quarter.
The number of stacked days cannot be negative, but a slightly positive value would be appreciated.
My request
- To find the optimal solution (approximate euristic solutions are accepted as well)
- (Optional) to possibly provide a representation of the problem by formulas
Notes
Please, don't hesitate to ask me further details on the problem if this can help you to provide a solution: I will amend the original question to include asked details.