Skip to main content

Suboptimal termination and unbounded or infeasible solution

Answered

Comments

6 comments

  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi Jacob,

    This looks like a perfect example of a model with bad numerics (no warnings, but it is a very big model).
    I'd first recommend upgrading to the latest version (10.0.1).
    If the problem persists, we have a guide: Solver parameters to manage numerical issues.
    There are three main sets of parameters to try:

    Also, you don't need to set NodeMethod as you are solving an LP.

    Cheers, 
    David

    1
  • Jacob Mannhardt
    Gurobi-versary
    Conversationalist
    First Question

    Hi David,

    thanks a lot for your quick reply. Jaromił has also already recommended going to v10, however I am running my optimizations on a central computation cluster, where it is not super easy to install new versions - I will keep it in mind though.

    I will try the parameters (again - it seems like a constant game of enabling and disabling parameters...) and see if it helps. 

    My main questions weren't actually hinted at how to solve numerically bad model but a) why the homogenous Barrier algorithm doesn't give a definitive answer if the problem is infeasible or unbounded and b) why the barrier algorithm terminates with a suboptimal solution even though the last iterations were smooth.

    I thought it was necessary to set NodeMethod = 2, Method = 2, and Crossover = 2 to disable Crossover.

    Thanks a lot and Cheers
    Jacob

     

    0
  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi Jacob,

    I will try the parameters (again - it seems like a constant game of enabling and disabling parameters...) and see if it helps.

    Reformulating the problem to avoid large coefficient ranges (you have no warning but they pretty big) is likely to be a longer-term solution.

    My main questions weren't actually hinted at how to solve numerically bad model but a) why the homogenous Barrier algorithm doesn't give a definitive answer if the problem is infeasible or unbounded and

    The homogenous algorithm is typically better at handling more numerically challenging models on the boundary of infeasibility. But of course, there is no guarantee that this is always the case, there are instances where the standard algorithm is more stable.

    b) why the barrier algorithm terminates with a suboptimal solution even though the last iterations were smooth.

    In this case, the last iterations were not smooth. The final solution is infeasible as it has a primal violation of the order of 1e-02. Crossover typically helps clean this up.
    As Jaromił also mentions in this post with similar behaviour: https://support.gurobi.com/hc/en-us/community/posts/9130435458193/comments/9136607863953.

    I thought it was necessary to set NodeMethod = 2, Method = 2, and Crossover = 2 to disable Crossover.

    From the docs NodeMethod: "Algorithm used for MIP node relaxations".

    Cheers, 
    David

    1
  • Goran Durakovic
    First Comment
    Gurobi-versary

    Dear Jacob and David,

    I am also having trouble writing an IIS file, and get a similar error as Jacob (Warning: unable to write requested result file 'test.ilp').

    I have tried writing this file both by explicitly passing the option

    opt.options['ResultFile'] = "test.ilp"

    and by passing the option string

    results = opt.solve(instance, tee=True, logfile=result_file_path + '/logfile_' + name + '.log', options_string='ResultFile=test.ilp')

    Neither of these attempts have worked. Note that while the logfile in the second example is successfully written, the .ilp file is not.

    Do either of you have a solution for this problem?

    0
  • David Torres Sanchez
    Gurobi Staff Gurobi Staff

    Hi Goran,

    Can you try writing the MPS/LP file from Pyomo and then using the Gurobi command to compute the IIS?
    I don't know enough about Pyomo to understand why your approach doesn't work.

    gurobi_cl ResultFile=iis.ilp my_file.mps

    Cheers, 
    David

    1
  • Goran Durakovic
    First Comment
    Gurobi-versary

    Hi David,

    Thank you for the quick response here.

    I can happily report that your method works! Thank you for suggesting this!

    Also, while deliberately creating an infeasible test model, I stumbled upon another interesting finding: if the model is truly infeasible, then the approach

    opt.options['ResultFile'] = "test.ilp"

    will also work.

    However, if the model is feasible, then I get the (somewhat misleading and cryptic) error message

    Warning: unable to write requested result file 'test.ilp'

    I mistook this as meaning that there was a mistake, or it didn't work. However, it seems that if the model starts optimizing, then you will just get the warning above.

    1

Please sign in to leave a comment.