Skip to main content

The results of the gurobi solution do not satisfy the constraints

Answered

Comments

3 comments

  • Meihan Wu
    • Gurobi-versary
    • First Comment
    • First Question

    I'm sorry I made a mistake.

    where a matrix of bb is
    val(:,:,1) =

         1     1     1     1     1     1     0     1     1     1     0     0     1     1     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0    -1     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0
         0     0     0     0     0     0     0     0     0     0     0     0     0     0     0

    a matrix of cc is

    val(:,:,1) =

      列 1 至 10

            1000        1000        1000        1000        1000        1000          -1        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000           0        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000
            1000        1000        1000        1000        1000        1000        1000        1000        1000        1000

      列 11 至 15

               0          -1        1000        1000          -1
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0
               0           0        1000        1000           0

    bb(1, 1, 7) = 0   cc(1, 1, 7) = -1

    0
  • Jaromił Najman
    • Gurobi Staff Gurobi Staff

    I am not familiar with YALMIP but from Gurobi's MATLAB API, you could call the gurobi_write() function to write a human-readable LP file. You can then open this file with any standard text editor and inspect whether the model you generated is correct. I would assume that YALMIP has a possibility to call Gurobi's write function or even has its own.

    A next step would be to find the seemingly violated constraint in the LP file and try to find out why it is violated.

    0
  • Gwyneth Butera
    • Gurobi Staff Gurobi Staff

    Additionally, our article How do I diagnose a wrong result? may be a good starting place. -G

    0

Please sign in to leave a comment.