How to avoid scheduling conflicts for a timetable problemConstraint on standard deviation of counts always zeroLogical constraints in CPLEXScheduling work shifts using integer programming — how to formulate feasible constraints?CPLEX - define variables with expressionsSetup Objective function in PuLP with four dimensionsWorker Allocation in House Building Optimisationguide me to write a capacity constraintHow to get current time in CP when using Intervals for schedulingAccessing tuple elements based on another tuple element in Cplex OPL
Go for an isolated pawn
Is the interior of a Bag of Holding actually an extradimensional space?
If I have an accident, should I file a claim with my car insurance company?
How can I oppose my advisor granting gift authorship to a collaborator?
ASCII Maze Rendering 3000
Do mortgage points get applied directly to the principal?
Would you recommend a keyboard for beginners with or without lights in keys for learning?
First Number to Contain Each Letter
Bidirectional Dictionary
Draw the ☣ (Biohazard Symbol)
'This one' as a pronoun
In-universe, why does Doc Brown program the time machine to go to 1955?
Is there any reason to change the ISO manually?
How does the UK House of Commons think they can prolong the deadline of Brexit?
What drugs were used in England during the High Middle Ages?
Dissuading my girlfriend from a scam
Left my gmail logged in when I was fired
How can I describe hit point damage without talking about wounds?
When making yogurt, why doesn't bad bacteria grow as well?
Why don't they build airplanes from 3D printer plastic?
Why do old games use flashing as means of showing damage?
What would a biological creature need in order to see into the future?
Are buttons really enough to bound validities by S4.2?
When is it legal to castle moving the rook first?
How to avoid scheduling conflicts for a timetable problem
Constraint on standard deviation of counts always zeroLogical constraints in CPLEXScheduling work shifts using integer programming — how to formulate feasible constraints?CPLEX - define variables with expressionsSetup Objective function in PuLP with four dimensionsWorker Allocation in House Building Optimisationguide me to write a capacity constraintHow to get current time in CP when using Intervals for schedulingAccessing tuple elements based on another tuple element in Cplex OPL
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm trying to create a schedule for shifts for each employee given employee shift availability. I have a tuple defined to include shift start time, shift end time, max people on shift. The input also includes a list of arrays for employee shift preferences, For example [[1 0 0 1 1],...] which represents that employee 1 is available for shifts 1, 4, 5 but not 2, 3. Note that shift times are not mutually exclusive and can overlap.
I have a decision variable x[i,j] which is 1 if employee i is staffed for shift j, 0 otherwise. After I execute, I'm expecting x[i,j] to be a matrix indicating for each employee which shift they are assigned to. I have my other constraints including shift capacity. But I'm stuck on how to create the constraint to make sure that assigned shifts are not overlapping.
One idea I have is to do compare x[i,j] and x[i,k] where j =/= k and see if they checking if start time of i > end time of j OR start time of j > end time of i. But I'm not sure how to implement this in OPL.
linear-programming cplex integer-programming opl
add a comment |
I'm trying to create a schedule for shifts for each employee given employee shift availability. I have a tuple defined to include shift start time, shift end time, max people on shift. The input also includes a list of arrays for employee shift preferences, For example [[1 0 0 1 1],...] which represents that employee 1 is available for shifts 1, 4, 5 but not 2, 3. Note that shift times are not mutually exclusive and can overlap.
I have a decision variable x[i,j] which is 1 if employee i is staffed for shift j, 0 otherwise. After I execute, I'm expecting x[i,j] to be a matrix indicating for each employee which shift they are assigned to. I have my other constraints including shift capacity. But I'm stuck on how to create the constraint to make sure that assigned shifts are not overlapping.
One idea I have is to do compare x[i,j] and x[i,k] where j =/= k and see if they checking if start time of i > end time of j OR start time of j > end time of i. But I'm not sure how to implement this in OPL.
linear-programming cplex integer-programming opl
add a comment |
I'm trying to create a schedule for shifts for each employee given employee shift availability. I have a tuple defined to include shift start time, shift end time, max people on shift. The input also includes a list of arrays for employee shift preferences, For example [[1 0 0 1 1],...] which represents that employee 1 is available for shifts 1, 4, 5 but not 2, 3. Note that shift times are not mutually exclusive and can overlap.
I have a decision variable x[i,j] which is 1 if employee i is staffed for shift j, 0 otherwise. After I execute, I'm expecting x[i,j] to be a matrix indicating for each employee which shift they are assigned to. I have my other constraints including shift capacity. But I'm stuck on how to create the constraint to make sure that assigned shifts are not overlapping.
One idea I have is to do compare x[i,j] and x[i,k] where j =/= k and see if they checking if start time of i > end time of j OR start time of j > end time of i. But I'm not sure how to implement this in OPL.
linear-programming cplex integer-programming opl
I'm trying to create a schedule for shifts for each employee given employee shift availability. I have a tuple defined to include shift start time, shift end time, max people on shift. The input also includes a list of arrays for employee shift preferences, For example [[1 0 0 1 1],...] which represents that employee 1 is available for shifts 1, 4, 5 but not 2, 3. Note that shift times are not mutually exclusive and can overlap.
I have a decision variable x[i,j] which is 1 if employee i is staffed for shift j, 0 otherwise. After I execute, I'm expecting x[i,j] to be a matrix indicating for each employee which shift they are assigned to. I have my other constraints including shift capacity. But I'm stuck on how to create the constraint to make sure that assigned shifts are not overlapping.
One idea I have is to do compare x[i,j] and x[i,k] where j =/= k and see if they checking if start time of i > end time of j OR start time of j > end time of i. But I'm not sure how to implement this in OPL.
linear-programming cplex integer-programming opl
linear-programming cplex integer-programming opl
edited Mar 28 at 12:43
Iago Carvalho
3433 silver badges14 bronze badges
3433 silver badges14 bronze badges
asked Mar 28 at 3:42
John LeeJohn Lee
204 bronze badges
204 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If I understand correctly, the start and end time of each shift j are known constants. Let me call them start[j] and end[j]. So you should be able to use these to specify, using the forall construct, the pairs (j,k) such that the shifts j and k don't overlap.
You will find examples of using forall in the examples installed with the product in the sub-directories of [InstallDir]/opl/examples/opl. More specifically, models that include constructs that you can look at are models/Staffing/staffing.mod, timetabling/timetabling.mod, and teambuilding/teambuilding.mod.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389835%2fhow-to-avoid-scheduling-conflicts-for-a-timetable-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If I understand correctly, the start and end time of each shift j are known constants. Let me call them start[j] and end[j]. So you should be able to use these to specify, using the forall construct, the pairs (j,k) such that the shifts j and k don't overlap.
You will find examples of using forall in the examples installed with the product in the sub-directories of [InstallDir]/opl/examples/opl. More specifically, models that include constructs that you can look at are models/Staffing/staffing.mod, timetabling/timetabling.mod, and teambuilding/teambuilding.mod.
add a comment |
If I understand correctly, the start and end time of each shift j are known constants. Let me call them start[j] and end[j]. So you should be able to use these to specify, using the forall construct, the pairs (j,k) such that the shifts j and k don't overlap.
You will find examples of using forall in the examples installed with the product in the sub-directories of [InstallDir]/opl/examples/opl. More specifically, models that include constructs that you can look at are models/Staffing/staffing.mod, timetabling/timetabling.mod, and teambuilding/teambuilding.mod.
add a comment |
If I understand correctly, the start and end time of each shift j are known constants. Let me call them start[j] and end[j]. So you should be able to use these to specify, using the forall construct, the pairs (j,k) such that the shifts j and k don't overlap.
You will find examples of using forall in the examples installed with the product in the sub-directories of [InstallDir]/opl/examples/opl. More specifically, models that include constructs that you can look at are models/Staffing/staffing.mod, timetabling/timetabling.mod, and teambuilding/teambuilding.mod.
If I understand correctly, the start and end time of each shift j are known constants. Let me call them start[j] and end[j]. So you should be able to use these to specify, using the forall construct, the pairs (j,k) such that the shifts j and k don't overlap.
You will find examples of using forall in the examples installed with the product in the sub-directories of [InstallDir]/opl/examples/opl. More specifically, models that include constructs that you can look at are models/Staffing/staffing.mod, timetabling/timetabling.mod, and teambuilding/teambuilding.mod.
answered Mar 28 at 9:51
Xavier NodetXavier Nodet
3,6782 gold badges31 silver badges47 bronze badges
3,6782 gold badges31 silver badges47 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389835%2fhow-to-avoid-scheduling-conflicts-for-a-timetable-problem%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown