Skip to main content

Not able to retrieve suboptimal solutions. Gurobi does not return the ones it identifies during the solution.

Answered

Comments

11 comments

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Gaurav,

    To summarize, it looks like the PoolObjVal is correct for SolutionNumber=0.  It looks incorrect for SolutionNumber=3.  The error for SolutionNumber=4 is expected since there only 4 solutions, and are numbered 0,1,2,3.

    I don't think I will be able to reproduce the issue without a model.  Are you able to share a MPS file with us via a service like Filemail, Dropbox, Box, Google Drive, OneDrive, etc.

    Which version of Gurobi are you using?

    - Riley

    0
  • Gaurav Malik
    Conversationalist
    First Question

    Thanks Riley for the reply! 
    Your summary is absolutely correct. In fact, it was incorrect for both SolutionNumber =2 and 3. 
    I am using Gurobi Optimizer version 10.0.0 build v10.0.0rc2 (win64) in Python 3.9.13. I can share the MPS files. Can you please provide me a private email address for this?  

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Gaurav,

    I'll avoid posting an email address, it'll get picked up by web crawlers and spammed into oblivion.  This is why we suggest using a file sharing service.  How many lines long is the MPS file?  If it is not too large you can paste it as text.

    - Riley

    0
  • Gaurav Malik
    Conversationalist
    First Question

    Hi Riley! 
    That's understandable. You can access the mps file (coefficients are a little different so don't expect the exact same values as in the screenshot) here:
    https://drive.google.com/file/d/1KcuhMRdyJlUMxG7ArmyWtowEi2LOMFdD/view?usp=drive_link

    Please let me know once you have downloaded. I will remove the file after that. 

    I already notice that if I tighten the Feasibility tolerances, then the -433K sol are not identified. Anyways, it remains strange that when these solutions are identified, they can not be accessed. 
    Regards

    Gaurav

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Thanks Gaurav, you can remove the file.

    - Riley

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Gaurav,

    I can't reproduce the issue with this model file.  Do you see the same behavior with this model?

    - Riley

     

     

    0
  • Gaurav Malik
    Conversationalist
    First Question

    Hi Riley,

    Please set these model parameters.

    m.setParam("NonConvex", 2)
    m.setParam("NoRelHeurWork",40)

    I think then you would be able to replicate the issue.

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Gaurav,

    I was able to reproduce the issue with these parameters.  I note that if you set SolutionLimit=1 we can actually get output like this, which simplifies the situation:

    Solution count 1: -432935 

    Solution limit reached
    Best objective -4.166578762417e+05, best bound -4.047859488774e+05, gap 2.8493%

    I can also reproduce with v11 and it adds a little more information to the log:

    Warning: uncrushing solution improved objective value from -432723.8670 to -416657.8761

    What this is saying is that in the presolved model the value of the solution was -432723.8670 and when translated back to the original model the objective was recalculated as -416657.8761 (for the same solution).  If you take a look at this article:

    https://support.gurobi.com/hc/en-us/articles/19976474687377-What-does-the-warning-uncrushing-solution-degraded-improved-objective-value-mean

    you will see that this can often occur with BigM constraints, which will be arising from your indicator constraints, and given it looks like none of your continuous variables have upper bounds then it is perhaps not surprising that you're experiencing this issue.  There are strategies to help mitigate the issue listed in the article but the first thing I'd do is ask yourself whether you can define some reasonable upper bounds on the continuous variables - this is almost always a good idea.

    I will also ask our dev team whether we can avoid the inconsistency when reporting the objective values in the solution count, but then this would also introduce an inconsistency between the those values and the objectives of the solutions reported earlier in the log, so it's not clear what the best option is.

    - Riley

     

    0
  • Gaurav Malik
    Conversationalist
    First Question

    Hi Riley, 

    Thanks a lot for all the effort! I tried with upper bound on my variables (using solution values as some reference) but unfortunately, the issue still exists.   

    Anyways, would it be correct to conclude that the solution with Obj of -433K does not really exist and was printed erroneously? and that the Obj retrieved later by setting Solution Number parameter is the actual Obj. at those variable values? Can the -433K solution be completely discarded. Does it even correspond to a feasible point if not a local optimum? 

    I was actually interested in this for another reason as well. So, when I minimize the Obj, the optimum has Obj of -416k and when I maximise it, it also has an optimum of -416K but identifies a solution of -433K along the way. It made me think, why is -433K not found while minimizing then! 
    But if that -433K is due to some wrong computation, it removes the problem I think. 


    Regards

    Gaurav 

    0
  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Gaurav,

    would it be correct to conclude that the solution with Obj of -433K does not really exist and was printed erroneously

    I think it would be more precise to say that the solution exists (meaning the values of the variables), just that the objective value is incorrect.

    - Riley

    0
  • Gaurav Malik
    Conversationalist
    First Question

    That's indeed a more correct way to put it. Thanks for resolving this issue. It was getting a bit confusing. 

    0

Please sign in to leave a comment.