How do I create an optimal MULTI-day work schedule using mixed integer linear programming?

18 visualizaciones (últimos 30 días)
Hi,
In this blog by Loren Shure Generating an Optimal Employee Work Schedule Using Integer Linear Programming, she showed how to solve a complicated scheduling problem. I am trying to recreate this but I want to do a weekly optimization with the constraint that an employee can work maximum 40 hours a week and one can work only one shift a day. Sean de Wolski made a comment that I could just duplicate the constraints to look at a longer time period at once but I do not know how to formulate it. Can someone please help me?
  9 comentarios
Serien Ali
Serien Ali el 14 de Sept. de 2018
Hi Mai, were you able to get a hold of your laptop? Thanks

Iniciar sesión para comentar.

Respuesta aceptada

David Ding
David Ding el 27 de Sept. de 2017
Hi,
As per the blog, the constraints are captured in A and b where: Ax <= b.
Now, you need to look at how to change the values of A and b to match your scenario. The call to the function "intlinprog" is likely still going to be the same:
[x, cost] = intlinprog(f,1:nVars,A,b,[],[],lb,ub);
The difference will be the values of the input arguments. For starters, just by quickly glancing your description and the blog, for the inequality matrix A:
"...There are two parts to the inequality constraint matrix A, which are clearly visible. The top portion has 24 rows (because there are 24 hours in a day) and each row represents the constraint that at a particular hour, you need a minimum number of staff..."
Now, perhaps, if you wish to extend this to a week and following the above example, you can make the top portion of A to be of 168 rows, since there are 168 hours in a week?
Best of luck,
David
  4 comentarios
Serien Ali
Serien Ali el 30 de Ag. de 2018
Hi David,
I am having trouble setting up weekly constraints. I have turned the example into 168 hours instead of 24, and have min/max hours per shift for each employee. However I am having trouble setting up min hours per week for each employee. How can I go about doing this? How can i add this constraint into the existing matrix that I am setting up?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Linear Least Squares en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by