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;








1















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.










share|improve this question
































    1















    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.










    share|improve this question




























      1












      1








      1








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          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.






          share|improve this answer
























            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
            );



            );













            draft saved

            draft discarded


















            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









            0
















            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.






            share|improve this answer





























              0
















              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.






              share|improve this answer



























                0














                0










                0









                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.






                share|improve this answer













                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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





















                    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.



















                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해