How do I create an optimal MULTI-day work schedule using mixed integer linear programming?
조회 수: 18 (최근 30일)
이전 댓글 표시
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
채택된 답변
David Ding
2017년 9월 27일
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
Serien Ali
2018년 8월 30일
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?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear Least Squares에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!