Skip to main content

Infeasibility issue by fixing some of variables and optimizing over others

Answered

Comments

8 comments

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Could you share a minimal working example to reproduce this issue? Since it is not possible to share files via the Community Forum, could you please follow the instructions in Posting to the Community Forum

    If sharing is not possible, could you show log snippets showing the issue?

    Best regards, 
    Jaromił

    0
  • Nasim Mirzavand Boroujeni
    Gurobi-versary
    Conversationalist
    First Question

    Barrier statistics:
     AA' NZ     : 1.000e+01
     Factor NZ  : 1.500e+01
     Factor Ops : 5.500e+01 (less than 1 second per iteration)
     Threads    : 1

                      Objective                Residual
    Iter       Primal          Dual         Primal    Dual     Compl     Time
       0   8.36659750e+01  8.36659750e+01  2.01e+00 0.00e+00  2.56e-02     0s
       1   8.36659750e+01  8.36445634e+01  8.09e-02 4.53e-03  3.12e-03     0s
       2   8.36659750e+01  8.36652690e+01  1.46e-02 5.75e-04  4.23e-04     0s
       3   8.36659750e+01  8.36659071e+01  3.70e-04 5.55e-17  1.25e-05     0s
       4   8.36659750e+01  8.36659754e+01  5.11e-06 5.55e-17  4.36e-09     0s
       5   8.36659750e+01  8.36692938e+01  5.12e-06 5.68e-14  3.18e-07     0s
       6   8.36659750e+01  8.36678019e+01  1.10e-06 4.66e-14  2.87e-07     0s
       7   8.36659750e+01  8.37172252e+01  1.38e-06 2.91e-11  5.00e-05     0s
       8   8.36659750e+01  1.26433624e+02  1.61e-06 1.40e-09  8.98e-03     0s
       9   8.36659750e+01  2.10356356e+12  1.56e-06 6.40e+01  1.21e+08     0s
      10   8.36659750e+01  8.36659750e+01  5.72e+03 0.00e+00  5.85e+05     0s
      11   8.36659750e+01  8.01298956e+01  3.19e+01 5.47e-01  3.60e+01     0s
      12   8.36659750e+01  8.36690390e+01  6.21e-02 4.62e-02  1.33e-02     0s
      13   8.36659750e+01  8.36715368e+01  1.57e-02 1.11e-02  3.76e-03     0s
      14   8.36659750e+01  8.36659830e+01  6.35e-03 3.33e-05  3.55e-04     0s
      15   8.36659750e+01  8.36659768e+01  3.44e-06 6.42e-17  2.87e-07     0s
      16   8.36659750e+01  8.36665327e+01  8.19e-05 2.27e-14  5.99e-03     0s
      17   8.36659750e+01  8.36667467e+01  5.12e-06 8.12e-15  8.18e-05     0s
      18   8.36659750e+01  8.40472336e+01  1.95e-05 1.01e-09  8.82e-02     0s
      19*  8.36659750e+01  1.77836965e+05  3.15e-13 2.89e-14  2.63e-14     0s

    Barrier performed 19 iterations in 0.00 seconds (0.00 work units)
    Infeasible model


    User-callback calls 106, time in user-callback 0.00 sec
    ERROR: LoadError: Result index of attribute MathOptInterface.ObjectiveValue(1) out of bounds. There are currently 0 solution(s) in the model.
    Stacktrace:
      [1] check_result_index_bounds
        @ ~/.julia/packages/MathOptInterface/eoIu0/src/attributes.jl:170 [inlined]
      [2] get(model::Gurobi.Optimizer, attr::MathOptInterface.ObjectiveValue)
        @ Gurobi ~/.julia/packages/Gurobi/WjZv8/src/MOI_wrapper/MOI_wrapper.jl:3134
      [3] get(b::MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}, attr::MathOptInterface.ObjectiveValue)
        @ MathOptInterface.Bridges ~/.julia/packages/MathOptInterface/eoIu0/src/Bridges/bridge_optimizer.jl:946
      [4] get(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, attr::MathOptInterface.ObjectiveValue)
        @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/eoIu0/src/Utilities/cachingoptimizer.jl:803
      [5] _moi_get_result(model::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{Gurobi.Optimizer}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}, args::MathOptInterface.ObjectiveValue)
        @ JuMP ~/.julia/packages/JuMP/yP8fy/src/JuMP.jl:1207
      [6] get(model::Model, attr::MathOptInterface.ObjectiveValue)
        @ JuMP ~/.julia/packages/JuMP/yP8fy/src/JuMP.jl:1232
      [7] objective_value(model::Model; result::Int64)
        @ JuMP ~/.julia/packages/JuMP/yP8fy/src/objective.jl:42
      [8] objective_value
        @ ~/.julia/packages/JuMP/yP8fy/src/objective.jl:42 [inlined]
      [9] fito3(xm::Vector{Float64}, dm::Vector{Float64}, tm::Vector{Float64}, nm::Float64, matrip::Vector{Any}, matriq::Vector{Any}, y::Adjoint{Float64, Matrix{Float64}}, n::Int64, solvetime::Float64, up1::Int64, up2::Int64, up3::Int64, lb1::Int64, lb2::Int64, lb3::Int64)
        @ Main ~/Desktop/codes/optimazationfunctions.jl:282
     [10] fitta(y::Adjoint{Float64, Matrix{Float64}}, n::Int64, solvetime::Float64, matrip::Vector{Any}, matriq::Vector{Any}, up1::Int64, up2::Int64, up3::Int64, lb1::Int64, lb2::Int64, lb3::Int64)
        @ Main ~/Desktop/codes/optimazationfunctions.jl:314
     [11] fitt(y::Adjoint{Float64, Matrix{Float64}}, n::Int64, solvetime::Float64, matrip::Vector{Any}, matriq::Vector{Any})
        @ Main ~/Desktop/codes/optimazationfunctions.jl:332
     [12] top-level scope
        @ ~/Desktop/codes/runfile.jl:129
    in expression starting 

    0
  • Nasim Mirzavand Boroujeni
    Gurobi-versary
    Conversationalist
    First Question

    The error is attached above.I also sent my codes to you. Have you received them?

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Yes, I received the files. However, they are Julia files. Could you please generate the two MPS files of interest as described in How do I write an MPS model file from a 3rd party API?

    Providing MPS/LP files is the easiest way to make issues reproducible.

    Best regards, 
    Jaromił

    0
  • Nasim Mirzavand Boroujeni
    Gurobi-versary
    Conversationalist
    First Question

    I have sent those as well. 

    0
  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Thank you. I received the files. Computing the IIS for the model you sent, provides information about which constraints you have to look at that are altogether causing infeasibility. For example removing one of the equalities

    R30: - C22 = -0.0435638619394513
    R31: - C23 = 0.3960353822998089
    R32: - C24 = 0.0589461930519388

    makes the model feasible.

    You sent the infeasible model. Could you also send the feasible model and let me know which variables exactly you fix after solving the feasible model?

    Best regards, 
    Jaromił

    0
  • Nasim Mirzavand Boroujeni
    Gurobi-versary
    Conversationalist
    First Question

    Hi,

    I am not sure what are these constraints in my original model since the names are different. Thanks for the reply. I am not sure how to get the .mps files for different iterations of my algorithm since the three optimizations model are solved together (each of those has two fixed variables and one to be optimized) and based on the hint for generating .mps files. The generated .mps files are overwritten by the most recent optimization run.

    •  
    0
  • Nasim Mirzavand Boroujeni
    Gurobi-versary
    Conversationalist
    First Question

    I found my issue. Thanks for the help.

    0

Please sign in to leave a comment.