Skip to main content

extra simplex goes wild in large LP

Ongoing

Comments

7 comments

  • Riley Clement
    • Gurobi Staff

    Hi Minzhuo,

    The cause of this issue you are seeing is found in this line:

    Extra simplex iterations after uncrush: 100928

    When the model goes through the presolve routine, we say that is being “crushed” to the presolve space.  The optimization then operates on the presolved model and when it is done, we need to “uncrush” solutions back to the original problem space.

    What is happening in your optimization is that the solution in the presolved space satisfies tolerances but when we uncrush it, there are large violations which then need to be cleaned up by simplex, which is where we get the “extra simplex iterations …” message from.  Typically violations after uncrush are small and simplex can clean them up quickly but this is not the case here.

    Note that your matrix range reported in the log is [5e-08, 2e+02].  The lower end is smaller than our default feasiblity tolerance, and perhaps this is part of the issue.  I would also create a presolve model and examine it's matrix coefficients - you will want the feasibility tolerance to be smaller than the low end of the matrix range.  In Python:

    with mymodel.presolve() as p:
        p.printStats()

    If using a tighter feasibility tolerance does not improve the performance then I would experiment with some of the parameters mentioned here: Solver Parameters to Manage Numerical Issues
    In particular I would first experiment with ScaleFlag (=2,3), Aggregate (=0) and NumericFocus (=1,2)

    I would also recommend reading the following section of our reference manual: Why Scaling and Geometry is Relevant

    - Riley

    0
  • MINZHUO HUANG
    • First Comment
    • First Question

    Dear Riley,

     

             Thank you so much for the reply! After following your suggestion and read the documents, I am able to solve the problem within a reasonable time period without any warning information. I would like to have a follow-up question according to the result. 

             I am doing an investment planning type two-stage SP, with objective function that minimize the total cost. I found that the final solution obtained after crossover and clean up process is very closed to the solution obtained from barrier method before crossover (gap < 0.001%). Since I am working on investment planning, I think second stage decision (system operation) is not as important as first stage decision. I am wondering if I could just obtain solution from barrier rather than the full process after crossover? Since the accuracy on second stage decision is not so important. Because it will greatly reduce my computational time (barrier for 10min, whole process for 5hr). I tried to set threads = 1 and crossover = 0, but it started using simplex instead of barrier. Is there any way to force GUROBI only use barrier and return barrier solution? Thank you!

     

    Minzhuo Huang

    0
  • Riley Clement
    • Gurobi Staff

    Hi Minzhuo,

    In your case running barrier without crossover could be a good idea.  I wouldn't touch Threads, if you don't have to - barrier parallelizes well with multiple threads - but you will need to set Method=2 in addition to Crossover=0.  By default if you set 1 thread, and leave Method at its default, then dual simplex will be used.

    - Riley

    0
  • MINZHUO HUANG
    • First Comment
    • First Question

    Dear Riley,

             Just an update from the previous question. I already found the way to only use barrier method, which can be done by setting ‘Method = 2’. But I would still like to hear opinion from you about the barrier solution. Please do share some insights on barrier solution and basis solution in a two-stage SP problem. Thank you!

    Minzhuo Huang

    0
  • MINZHUO HUANG
    • First Comment
    • First Question

    Dear Riley,

             Thank you for your instant update, much appreciated. Looks like you foresee my response. Thank you for your help, have a nice day!

    Minzhuo Huang

    0
  • Riley Clement
    • Gurobi Staff

    Thanks Minzhuo, you too.

    I'll add a slight addition to my response - we lean on crossover to help improve the accuracy.  If you don't run crossover then barrier will work a little bit harder to improve the accuracy itself.

    - Riley

    0
  • MINZHUO HUANG
    • First Comment
    • First Question

    Hi Riley,

         Thanks for the add-on, it's very helpful. Which cause me raising another question on this: I do understand the limit of barrier method. Is it possible to improve the accuracy by changing parameters like ‘Numericfoucs’ and ‘BarConvTol ? For example, if I try to set ‘BarConvTol = 1e-11’ and ‘Numericfocus = 3’, will this help? I know it will take longer time and more barrier iterations, but I believe it will still much faster than a complete process includes crossover. Thank you!

    Minzhuo Huang

    0

Please sign in to leave a comment.