Skip to main content

Help with implementing an LP

Ongoing

Comments

6 comments

  • Simranjit Kaur
    Gurobi Staff Gurobi Staff

    Have you tried to run the Model.ComputeIIS() method on the infeasible model? It will let you know the smallest set of variables and constraints that make your model infeasible. To this end, the following articles will be helpful:

    0
  • Lorenz Wagner
    Investigator
    Gurobi-versary
    Conversationalist

    Simranjit Kaur I just did. It yielded this output!

    Computing Irreducible Inconsistent Subsystem (IIS)...

               Constraints          |            Bounds           |  Runtime
          Min       Max     Guess   |   Min       Max     Guess   |
    --------------------------------------------------------------------------
            0      2031         -         0         0         0           0s
           31        31        31         0         0         0           1s

    IIS computed: 31 constraints, 0 bounds
    IIS runtime: 1.14 seconds (0.69 work units)
    Warning: linear constraint 0 and linear constraint 1 have the same name "CONS1"

    0
  • Simranjit Kaur
    Gurobi Staff Gurobi Staff

    Great! Once you've executed computeIIS(), the constraints participating in the IIS can be exported to an ILP file using model.write("mymodel.ilp"). You can inspect the constraints in this file using any text editor.

    0
  • Lorenz Wagner
    Investigator
    Gurobi-versary
    Conversationalist

    Thats the Output i get:

    \ Model _copy
    \ LP format - for model browsing. Use MPS format to capture full model detail.
    Minimize

    Subject To
    CONS1: x[1,1,5] + x[1,2,5] + x[1,3,5] + x[1,4,5] + x[1,5,5] + x[1,6,5]
    + x[1,7,5] + x[1,8,5] + x[1,9,5] + x[1,10,5] + x[1,11,5] + x[1,12,5]
    + x[1,13,5] + x[1,14,5] + x[1,15,5] + x[1,16,5] + x[1,17,5] + x[1,18,5]
    + x[1,19,5] - y[1,1] <= 0
    CONS1: x[1,1,5] + x[1,2,5] + x[1,3,5] + x[1,4,5] + x[1,5,5] + x[1,6,5]
    + x[1,7,5] + x[1,8,5] + x[1,9,5] + x[1,10,5] + x[1,11,5] + x[1,12,5]
    + x[1,13,5] + x[1,14,5] + x[1,15,5] + x[1,16,5] + x[1,17,5] + x[1,18,5]
    + x[1,19,5] - y[1,2] <= 0
    CONS1: x[2,1,5] + x[2,2,5] + x[2,3,5] + x[2,4,5] + x[2,5,5] + x[2,6,5]
    + x[2,7,5] + x[2,8,5] + x[2,9,5] + x[2,10,5] + x[2,11,5] + x[2,12,5]
    + x[2,13,5] + x[2,14,5] + x[2,15,5] + x[2,16,5] + x[2,17,5] + x[2,18,5]
    + x[2,19,5] - y[2,1] <= 0
    CONS1: x[3,1,5] + x[3,2,5] + x[3,3,5] + x[3,4,5] + x[3,5,5] + x[3,6,5]
    + x[3,7,5] + x[3,8,5] + x[3,9,5] + x[3,10,5] + x[3,11,5] + x[3,12,5]
    + x[3,13,5] + x[3,14,5] + x[3,15,5] + x[3,16,5] + x[3,17,5] + x[3,18,5]
    + x[3,19,5] - y[3,1] <= 0
    CONS1: x[4,1,5] + x[4,2,5] + x[4,3,5] + x[4,4,5] + x[4,5,5] + x[4,6,5]
    + x[4,7,5] + x[4,8,5] + x[4,9,5] + x[4,10,5] + x[4,11,5] + x[4,12,5]
    + x[4,13,5] + x[4,14,5] + x[4,15,5] + x[4,16,5] + x[4,17,5] + x[4,18,5]
    + x[4,19,5] - y[4,1] <= 0
    CONS1: x[4,1,5] + x[4,2,5] + x[4,3,5] + x[4,4,5] + x[4,5,5] + x[4,6,5]
    + x[4,7,5] + x[4,8,5] + x[4,9,5] + x[4,10,5] + x[4,11,5] + x[4,12,5]
    + x[4,13,5] + x[4,14,5] + x[4,15,5] + x[4,16,5] + x[4,17,5] + x[4,18,5]
    + x[4,19,5] - y[4,2] <= 0
    CONS1: x[5,1,5] + x[5,2,5] + x[5,3,5] + x[5,4,5] + x[5,5,5] + x[5,6,5]
    + x[5,7,5] + x[5,8,5] + x[5,9,5] + x[5,10,5] + x[5,11,5] + x[5,12,5]
    + x[5,13,5] + x[5,14,5] + x[5,15,5] + x[5,16,5] + x[5,17,5] + x[5,18,5]
    + x[5,19,5] - y[5,1] <= 0
    CONS1: x[5,1,5] + x[5,2,5] + x[5,3,5] + x[5,4,5] + x[5,5,5] + x[5,6,5]
    + x[5,7,5] + x[5,8,5] + x[5,9,5] + x[5,10,5] + x[5,11,5] + x[5,12,5]
    + x[5,13,5] + x[5,14,5] + x[5,15,5] + x[5,16,5] + x[5,17,5] + x[5,18,5]
    + x[5,19,5] - y[5,2] <= 0
    CONS1: x[6,1,5] + x[6,2,5] + x[6,3,5] + x[6,4,5] + x[6,5,5] + x[6,6,5]
    + x[6,7,5] + x[6,8,5] + x[6,9,5] + x[6,10,5] + x[6,11,5] + x[6,12,5]
    + x[6,13,5] + x[6,14,5] + x[6,15,5] + x[6,16,5] + x[6,17,5] + x[6,18,5]
    + x[6,19,5] - y[6,1] <= 0
    CONS1: x[6,1,5] + x[6,2,5] + x[6,3,5] + x[6,4,5] + x[6,5,5] + x[6,6,5]
    + x[6,7,5] + x[6,8,5] + x[6,9,5] + x[6,10,5] + x[6,11,5] + x[6,12,5]
    + x[6,13,5] + x[6,14,5] + x[6,15,5] + x[6,16,5] + x[6,17,5] + x[6,18,5]
    + x[6,19,5] - y[6,2] <= 0
    CONS1: x[7,1,5] + x[7,2,5] + x[7,3,5] + x[7,4,5] + x[7,5,5] + x[7,6,5]
    + x[7,7,5] + x[7,8,5] + x[7,9,5] + x[7,10,5] + x[7,11,5] + x[7,12,5]
    + x[7,13,5] + x[7,14,5] + x[7,15,5] + x[7,16,5] + x[7,17,5] + x[7,18,5]
    + x[7,19,5] - y[7,1] <= 0
    CONS1: x[8,1,5] + x[8,2,5] + x[8,3,5] + x[8,4,5] + x[8,5,5] + x[8,6,5]
    + x[8,7,5] + x[8,8,5] + x[8,9,5] + x[8,10,5] + x[8,11,5] + x[8,12,5]
    + x[8,13,5] + x[8,14,5] + x[8,15,5] + x[8,16,5] + x[8,17,5] + x[8,18,5]
    + x[8,19,5] - y[8,1] <= 0
    CONS1: x[9,1,5] + x[9,2,5] + x[9,3,5] + x[9,4,5] + x[9,5,5] + x[9,6,5]
    + x[9,7,5] + x[9,8,5] + x[9,9,5] + x[9,10,5] + x[9,11,5] + x[9,12,5]
    + x[9,13,5] + x[9,14,5] + x[9,15,5] + x[9,16,5] + x[9,17,5] + x[9,18,5]
    + x[9,19,5] - y[9,1] <= 0
    CONS1: x[9,1,5] + x[9,2,5] + x[9,3,5] + x[9,4,5] + x[9,5,5] + x[9,6,5]
    + x[9,7,5] + x[9,8,5] + x[9,9,5] + x[9,10,5] + x[9,11,5] + x[9,12,5]
    + x[9,13,5] + x[9,14,5] + x[9,15,5] + x[9,16,5] + x[9,17,5] + x[9,18,5]
    + x[9,19,5] - y[9,2] <= 0
    CONS1: x[10,1,5] + x[10,2,5] + x[10,3,5] + x[10,4,5] + x[10,5,5]
    + x[10,6,5] + x[10,7,5] + x[10,8,5] + x[10,9,5] + x[10,10,5]
    + x[10,11,5] + x[10,12,5] + x[10,13,5] + x[10,14,5] + x[10,15,5]
    + x[10,16,5] + x[10,17,5] + x[10,18,5] + x[10,19,5] - y[10,1] <= 0
    CONS3: x[1,11,5] + x[2,11,5] + x[3,11,5] + x[4,11,5] + x[5,11,5]
    + x[6,11,5] + x[7,11,5] + x[8,11,5] + x[9,11,5] + x[10,11,5] >= 1
    CONS5: 8 x[2,11,1] + 8 x[2,11,2] + 8 x[2,11,3] + 8 x[2,11,4] + 8 x[2,11,5]
    + 8 x[2,11,6] + 8 x[2,11,7] + 8 x[2,12,1] + 8 x[2,12,2] + 8 x[2,12,3]
    + 8 x[2,12,4] + 8 x[2,12,5] + 8 x[2,12,6] + 8 x[2,12,7] + 6 x[2,13,1]
    + 6 x[2,13,2] + 6 x[2,13,3] + 6 x[2,13,4] + 6 x[2,13,5] + 6 x[2,13,6]
    + 6 x[2,13,7] + 8 x[2,14,1] + 8 x[2,14,2] + 8 x[2,14,3] + 8 x[2,14,4]
    + 8 x[2,14,5] + 8 x[2,14,6] + 8 x[2,14,7] + 8 x[2,15,1] + 8 x[2,15,2]
    + 8 x[2,15,3] + 8 x[2,15,4] + 8 x[2,15,5] + 8 x[2,15,6] + 8 x[2,15,7]
    + 8 x[2,16,1] + 8 x[2,16,2] + 8 x[2,16,3] + 8 x[2,16,4] + 8 x[2,16,5]
    + 8 x[2,16,6] + 8 x[2,16,7] - 40 y[2,2] <= 0
    CONS5: 8 x[3,11,1] + 8 x[3,11,2] + 8 x[3,11,3] + 8 x[3,11,4] + 8 x[3,11,5]
    + 8 x[3,11,6] + 8 x[3,11,7] + 8 x[3,12,1] + 8 x[3,12,2] + 8 x[3,12,3]
    + 8 x[3,12,4] + 8 x[3,12,5] + 8 x[3,12,6] + 8 x[3,12,7] + 6 x[3,13,1]
    + 6 x[3,13,2] + 6 x[3,13,3] + 6 x[3,13,4] + 6 x[3,13,5] + 6 x[3,13,6]
    + 6 x[3,13,7] + 8 x[3,14,1] + 8 x[3,14,2] + 8 x[3,14,3] + 8 x[3,14,4]
    + 8 x[3,14,5] + 8 x[3,14,6] + 8 x[3,14,7] + 8 x[3,15,1] + 8 x[3,15,2]
    + 8 x[3,15,3] + 8 x[3,15,4] + 8 x[3,15,5] + 8 x[3,15,6] + 8 x[3,15,7]
    + 8 x[3,16,1] + 8 x[3,16,2] + 8 x[3,16,3] + 8 x[3,16,4] + 8 x[3,16,5]
    + 8 x[3,16,6] + 8 x[3,16,7] - 40 y[3,2] <= 0
    CONS5: 8 x[7,11,1] + 8 x[7,11,2] + 8 x[7,11,3] + 8 x[7,11,4] + 8 x[7,11,5]
    + 8 x[7,11,6] + 8 x[7,11,7] + 8 x[7,12,1] + 8 x[7,12,2] + 8 x[7,12,3]
    + 8 x[7,12,4] + 8 x[7,12,5] + 8 x[7,12,6] + 8 x[7,12,7] + 6 x[7,13,1]
    + 6 x[7,13,2] + 6 x[7,13,3] + 6 x[7,13,4] + 6 x[7,13,5] + 6 x[7,13,6]
    + 6 x[7,13,7] + 8 x[7,14,1] + 8 x[7,14,2] + 8 x[7,14,3] + 8 x[7,14,4]
    + 8 x[7,14,5] + 8 x[7,14,6] + 8 x[7,14,7] + 8 x[7,15,1] + 8 x[7,15,2]
    + 8 x[7,15,3] + 8 x[7,15,4] + 8 x[7,15,5] + 8 x[7,15,6] + 8 x[7,15,7]
    + 8 x[7,16,1] + 8 x[7,16,2] + 8 x[7,16,3] + 8 x[7,16,4] + 8 x[7,16,5]
    + 8 x[7,16,6] + 8 x[7,16,7] - 40 y[7,2] <= 0
    CONS5: 8 x[8,11,1] + 8 x[8,11,2] + 8 x[8,11,3] + 8 x[8,11,4] + 8 x[8,11,5]
    + 8 x[8,11,6] + 8 x[8,11,7] + 8 x[8,12,1] + 8 x[8,12,2] + 8 x[8,12,3]
    + 8 x[8,12,4] + 8 x[8,12,5] + 8 x[8,12,6] + 8 x[8,12,7] + 6 x[8,13,1]
    + 6 x[8,13,2] + 6 x[8,13,3] + 6 x[8,13,4] + 6 x[8,13,5] + 6 x[8,13,6]
    + 6 x[8,13,7] + 8 x[8,14,1] + 8 x[8,14,2] + 8 x[8,14,3] + 8 x[8,14,4]
    + 8 x[8,14,5] + 8 x[8,14,6] + 8 x[8,14,7] + 8 x[8,15,1] + 8 x[8,15,2]
    + 8 x[8,15,3] + 8 x[8,15,4] + 8 x[8,15,5] + 8 x[8,15,6] + 8 x[8,15,7]
    + 8 x[8,16,1] + 8 x[8,16,2] + 8 x[8,16,3] + 8 x[8,16,4] + 8 x[8,16,5]
    + 8 x[8,16,6] + 8 x[8,16,7] - 40 y[8,2] <= 0
    CONS5: 8 x[10,11,1] + 8 x[10,11,2] + 8 x[10,11,3] + 8 x[10,11,4]
    + 8 x[10,11,5] + 8 x[10,11,6] + 8 x[10,11,7] + 8 x[10,12,1]
    + 8 x[10,12,2] + 8 x[10,12,3] + 8 x[10,12,4] + 8 x[10,12,5]
    + 8 x[10,12,6] + 8 x[10,12,7] + 6 x[10,13,1] + 6 x[10,13,2]
    + 6 x[10,13,3] + 6 x[10,13,4] + 6 x[10,13,5] + 6 x[10,13,6]
    + 6 x[10,13,7] + 8 x[10,14,1] + 8 x[10,14,2] + 8 x[10,14,3]
    + 8 x[10,14,4] + 8 x[10,14,5] + 8 x[10,14,6] + 8 x[10,14,7]
    + 8 x[10,15,1] + 8 x[10,15,2] + 8 x[10,15,3] + 8 x[10,15,4]
    + 8 x[10,15,5] + 8 x[10,15,6] + 8 x[10,15,7] + 8 x[10,16,1]
    + 8 x[10,16,2] + 8 x[10,16,3] + 8 x[10,16,4] + 8 x[10,16,5]
    + 8 x[10,16,6] + 8 x[10,16,7] - 40 y[10,2] <= 0
    CONS6: y[1,1] + y[1,2] <= 1
    CONS6: y[2,1] + y[2,2] <= 1
    CONS6: y[3,1] + y[3,2] <= 1
    CONS6: y[4,1] + y[4,2] <= 1
    CONS6: y[5,1] + y[5,2] <= 1
    CONS6: y[6,1] + y[6,2] <= 1
    CONS6: y[7,1] + y[7,2] <= 1
    CONS6: y[8,1] + y[8,2] <= 1
    CONS6: y[9,1] + y[9,2] <= 1
    CONS6: y[10,1] + y[10,2] <= 1
    Bounds
    Binaries
    x[1,1,5] x[1,2,5] x[1,3,5] x[1,4,5] x[1,5,5] x[1,6,5] x[1,7,5] x[1,8,5]
    x[1,9,5] x[1,10,5] x[1,11,5] x[1,12,5] x[1,13,5] x[1,14,5] x[1,15,5]
    x[1,16,5] x[1,17,5] x[1,18,5] x[1,19,5] x[2,1,5] x[2,2,5] x[2,3,5]
    x[2,4,5] x[2,5,5] x[2,6,5] x[2,7,5] x[2,8,5] x[2,9,5] x[2,10,5] x[2,11,1]
    x[2,11,2] x[2,11,3] x[2,11,4] x[2,11,5] x[2,11,6] x[2,11,7] x[2,12,1]
    x[2,12,2] x[2,12,3] x[2,12,4] x[2,12,5] x[2,12,6] x[2,12,7] x[2,13,1]
    x[2,13,2] x[2,13,3] x[2,13,4] x[2,13,5] x[2,13,6] x[2,13,7] x[2,14,1]
    x[2,14,2] x[2,14,3] x[2,14,4] x[2,14,5] x[2,14,6] x[2,14,7] x[2,15,1]
    x[2,15,2] x[2,15,3] x[2,15,4] x[2,15,5] x[2,15,6] x[2,15,7] x[2,16,1]
    x[2,16,2] x[2,16,3] x[2,16,4] x[2,16,5] x[2,16,6] x[2,16,7] x[2,17,5]
    x[2,18,5] x[2,19,5] x[3,1,5] x[3,2,5] x[3,3,5] x[3,4,5] x[3,5,5] x[3,6,5]
    x[3,7,5] x[3,8,5] x[3,9,5] x[3,10,5] x[3,11,1] x[3,11,2] x[3,11,3]
    x[3,11,4] x[3,11,5] x[3,11,6] x[3,11,7] x[3,12,1] x[3,12,2] x[3,12,3]
    x[3,12,4] x[3,12,5] x[3,12,6] x[3,12,7] x[3,13,1] x[3,13,2] x[3,13,3]
    x[3,13,4] x[3,13,5] x[3,13,6] x[3,13,7] x[3,14,1] x[3,14,2] x[3,14,3]
    x[3,14,4] x[3,14,5] x[3,14,6] x[3,14,7] x[3,15,1] x[3,15,2] x[3,15,3]
    x[3,15,4] x[3,15,5] x[3,15,6] x[3,15,7] x[3,16,1] x[3,16,2] x[3,16,3]
    x[3,16,4] x[3,16,5] x[3,16,6] x[3,16,7] x[3,17,5] x[3,18,5] x[3,19,5]
    x[4,1,5] x[4,2,5] x[4,3,5] x[4,4,5] x[4,5,5] x[4,6,5] x[4,7,5] x[4,8,5]
    x[4,9,5] x[4,10,5] x[4,11,5] x[4,12,5] x[4,13,5] x[4,14,5] x[4,15,5]
    x[4,16,5] x[4,17,5] x[4,18,5] x[4,19,5] x[5,1,5] x[5,2,5] x[5,3,5]
    x[5,4,5] x[5,5,5] x[5,6,5] x[5,7,5] x[5,8,5] x[5,9,5] x[5,10,5] x[5,11,5]
    x[5,12,5] x[5,13,5] x[5,14,5] x[5,15,5] x[5,16,5] x[5,17,5] x[5,18,5]
    x[5,19,5] x[6,1,5] x[6,2,5] x[6,3,5] x[6,4,5] x[6,5,5] x[6,6,5] x[6,7,5]
    x[6,8,5] x[6,9,5] x[6,10,5] x[6,11,5] x[6,12,5] x[6,13,5] x[6,14,5]
    x[6,15,5] x[6,16,5] x[6,17,5] x[6,18,5] x[6,19,5] x[7,1,5] x[7,2,5]
    x[7,3,5] x[7,4,5] x[7,5,5] x[7,6,5] x[7,7,5] x[7,8,5] x[7,9,5] x[7,10,5]
    x[7,11,1] x[7,11,2] x[7,11,3] x[7,11,4] x[7,11,5] x[7,11,6] x[7,11,7]
    x[7,12,1] x[7,12,2] x[7,12,3] x[7,12,4] x[7,12,5] x[7,12,6] x[7,12,7]
    x[7,13,1] x[7,13,2] x[7,13,3] x[7,13,4] x[7,13,5] x[7,13,6] x[7,13,7]
    x[7,14,1] x[7,14,2] x[7,14,3] x[7,14,4] x[7,14,5] x[7,14,6] x[7,14,7]
    x[7,15,1] x[7,15,2] x[7,15,3] x[7,15,4] x[7,15,5] x[7,15,6] x[7,15,7]
    x[7,16,1] x[7,16,2] x[7,16,3] x[7,16,4] x[7,16,5] x[7,16,6] x[7,16,7]
    x[7,17,5] x[7,18,5] x[7,19,5] x[8,1,5] x[8,2,5] x[8,3,5] x[8,4,5] x[8,5,5]
    x[8,6,5] x[8,7,5] x[8,8,5] x[8,9,5] x[8,10,5] x[8,11,1] x[8,11,2]
    x[8,11,3] x[8,11,4] x[8,11,5] x[8,11,6] x[8,11,7] x[8,12,1] x[8,12,2]
    x[8,12,3] x[8,12,4] x[8,12,5] x[8,12,6] x[8,12,7] x[8,13,1] x[8,13,2]
    x[8,13,3] x[8,13,4] x[8,13,5] x[8,13,6] x[8,13,7] x[8,14,1] x[8,14,2]
    x[8,14,3] x[8,14,4] x[8,14,5] x[8,14,6] x[8,14,7] x[8,15,1] x[8,15,2]
    x[8,15,3] x[8,15,4] x[8,15,5] x[8,15,6] x[8,15,7] x[8,16,1] x[8,16,2]
    x[8,16,3] x[8,16,4] x[8,16,5] x[8,16,6] x[8,16,7] x[8,17,5] x[8,18,5]
    x[8,19,5] x[9,1,5] x[9,2,5] x[9,3,5] x[9,4,5] x[9,5,5] x[9,6,5] x[9,7,5]
    x[9,8,5] x[9,9,5] x[9,10,5] x[9,11,5] x[9,12,5] x[9,13,5] x[9,14,5]
    x[9,15,5] x[9,16,5] x[9,17,5] x[9,18,5] x[9,19,5] x[10,1,5] x[10,2,5]
    x[10,3,5] x[10,4,5] x[10,5,5] x[10,6,5] x[10,7,5] x[10,8,5] x[10,9,5]
    x[10,10,5] x[10,11,1] x[10,11,2] x[10,11,3] x[10,11,4] x[10,11,5]
    x[10,11,6] x[10,11,7] x[10,12,1] x[10,12,2] x[10,12,3] x[10,12,4]
    x[10,12,5] x[10,12,6] x[10,12,7] x[10,13,1] x[10,13,2] x[10,13,3]
    x[10,13,4] x[10,13,5] x[10,13,6] x[10,13,7] x[10,14,1] x[10,14,2]
    x[10,14,3] x[10,14,4] x[10,14,5] x[10,14,6] x[10,14,7] x[10,15,1]
    x[10,15,2] x[10,15,3] x[10,15,4] x[10,15,5] x[10,15,6] x[10,15,7]
    x[10,16,1] x[10,16,2] x[10,16,3] x[10,16,4] x[10,16,5] x[10,16,6]
    x[10,16,7] x[10,17,5] x[10,18,5] x[10,19,5] y[1,1] y[1,2] y[2,1] y[2,2]
    y[3,1] y[3,2] y[4,1] y[4,2] y[5,1] y[5,2] y[6,1] y[6,2] y[7,1] y[7,2]
    y[8,1] y[8,2] y[9,1] y[9,2] y[10,1] y[10,2]
    End
    0
  • Simranjit Kaur
    Gurobi Staff Gurobi Staff

    Hi Lorenz,

    The sum of the variables participating in the following constraint must be at least one:

    CONS3: x[1,11,5] + x[2,11,5] + x[3,11,5] + x[4,11,5] + x[5,11,5] + x[6,11,5] + x[7,11,5] + x[8,11,5] + x[9,11,5] + x[10,11,5] >= 1 

    However, each of these variables is forced to zero from other constraints, which causes the infeasibility.

    To see this, let's look at the constraints in which x[1,11,5] participates.

    x[1,1,5] + x[1,2,5] + x[1,3,5] + x[1,4,5] + x[1,5,5] + x[1,6,5] + x[1,7,5] + x[1,8,5] + x[1,9,5] + x[1,10,5] + x[1,11,5] + x[1,12,5] + x[1,13,5] + x[1,14,5] + x[1,15,5] + x[1,16,5] + x[1,17,5] + x[1,18,5] + x[1,19,5] <= y[1,1] 
    x[1,1,5] + x[1,2,5] + x[1,3,5] + x[1,4,5] + x[1,5,5] + x[1,6,5] + x[1,7,5] + x[1,8,5] + x[1,9,5] + x[1,10,5] + x[1,11,5] + x[1,12,5] + x[1,13,5] + x[1,14,5] + x[1,15,5] + x[1,16,5] + x[1,17,5] + x[1,18,5] + x[1,19,5] <= y[1,2]
    y[1,1] + y[1,2] <= 1

    The first two constraints imply that x[1,11,5] can be non-zero only if both y[1,2] and y[1,1] are positive. The third constraint forces at least one of y1,1] or y[1,2] to be zero, and therefore x[1,11,5] has to be zero. The same is true for other variables in the constraint CONS3 above.

    To resolve this, please check the data input for accuracy, review the logic behind these constraints, and ensure they are built as expected.

    Best regards,
    Simran

    0
  • Lorenz Wagner
    Investigator
    Gurobi-versary
    Conversationalist

    Thanks i got it. Sadly i dont really know why this happens. Do you have any idea which constraint may cause this issue or could be wrong?

    \[

    \begin{align} &\min\sum_{j,b}^{}j.C \cdot y_{jb}\\&\sum_{i:i.F}^{}x_{jit}\le y_{jf}~~~\forall j\in J,t\in T,f\in F\\&\sum_{j:j.Q\le i.Q}^{}x_{jit}\ge d_{it}~~~\forall i\in I,t\in T\\&\sum_{i,t:i.Night=1\wedge i.F=f}^{}x_{jit}\le 5~~~\forall j\in J,f\in F\\&\sum_{i,t:i.WE=1\wedge i.F=f}^{}x_{jit}\le 2~~~\forall j\in J,f\in F\\
    &\sum_{i,t:i.F=f}^{}i.RT\cdot x_{jit}\le j.WT\cdot y_{jf}~~~\forall j\in J,f\in F\\&\sum_{f\in F}^{}y_{jf}\le 1~~~~\forall j\in J\\&x_{jit}+\sum_{k:k.F=f\wedge k.Night\neq1}^{}x_{jk(t+1)}\le 1~~~\forall j\in J,t\in T,i:i.Night = 1\\\end{align}\]

    0

Please sign in to leave a comment.