Suboptimal solution for LP

277 views
Skip to first unread message

szajko...@gmail.com

unread,
Jan 9, 2015, 5:23:55 AM1/9/15
to gur...@googlegroups.com
Hi,

I am trying to solve large LPs with Gurobi from C++. As it would take too much time to get the exact optimal solution, I would like to get a suboptimal one. It would make sense to set either a "MIPgap" or a time limit. If the Gap is below 1e-6, than I am not interested in further optimization.

When I set the time limit through model.getEnv().set(GRB_DoubleParam_TimeLimit, 200);, than I cannot get access to the suboptimal values of the variables.

In addition, I did not found any settable gap similar to MIPgap for LPs.

There are so many nice C++ examples available for Gurobi, but I did not found any that stopped an LP and got a suboptimal solution. Can anybody help me? Do you have a simple example that I could use to stop solving my problems and get suboptimal values of my variables?

I am trying to solve this problem for already more week. Thanks for any help in advance!

Aniko

-----------------------------------------------------------------------------------------------------------------------

Optimize a model with 77175 rows, 51618 columns and 81752717 nonzeros

Concurrent LP optimizer: dual simplex and barrier
Showing barrier log only...
...

Barrier statistics:
 AA' NZ     : 1.193e+08
 Factor NZ  : 1.193e+08 (roughly 1.0 GBytes of memory)
 Factor Ops : 1.226e+12 (roughly 1100 seconds per iteration)
 Threads    : 3

                  Objective                Residual
Iter       Primal          Dual         Primal    Dual     Compl     Time
   0   4.87784660e+05 -1.55684679e+05  3.87e+01 0.00e+00  6.27e+00  2489s
   1   4.49578461e+04 -5.84229980e+03  2.89e+00 1.82e-15  3.85e-01  3218s
...
  40   1.42089199e+03  1.42089195e+03  2.24e-05 1.25e-13  5.82e-10  36324s
...
  60   1.42089193e+03  1.42089198e+03  1.02e-05 1.11e-13  6.68e-11  54416s
...

-----------------------------------------------------------------------------------------------------------------------

Greg Glockner

unread,
Jan 9, 2015, 9:19:56 AM1/9/15
to gur...@googlegroups.com
> I am trying to solve large LPs with Gurobi from C++. As it would take too much time to get the exact optimal solution, I would like to get a suboptimal one.

Sorry, not possible.


Jianguang Feng

unread,
Jan 10, 2015, 3:54:35 PM1/10/15
to gur...@googlegroups.com
    Hi, Aniko

    I am new to Gurobi, but for your problem, i have a idea which i don't konw whether it is OK or not, you can add  a additional binary variable (say, x) and a redundant constraint (say, x<=0) in your model, which let the solver to treat your model as MIP, then you can set the MIPGap parameter. All this is just imaginary, so i don't konw if this work for you.


   Best regards,
   Jianguang
  
   

在 2015年1月9日星期五 UTC+1上午11:23:55,szajko...@gmail.com写道:

Jakob Sch.

unread,
Jan 11, 2015, 10:42:15 AM1/11/15
to gur...@googlegroups.com
Hi Aniko, Hi Jianguang,

This won't do anything... First, the variable and the constraint is likely removed by the presolving, resulting in the original model. Even if this is not the case, for solving the problem you'll first need to solve the root relaxation which is the original problem with the additional constraint/variable. Thus, as the problem here is that the continuous problem needs too much time to be solved, this is not helping...

Best regards,
Jakob

Stuart Mitchell

unread,
Jan 11, 2015, 9:52:28 PM1/11/15
to gur...@googlegroups.com
Remove the objective function?

though if your problem is large it will still probably take a long time to find a feasible solution.

Stu

--

---
You received this message because you are subscribed to the Google Groups "Gurobi Optimization" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gurobi+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Stuart Mitchell
PhD Engineering Science
Extraordinary Freelance Programmer and Optimisation Guru
Reply all
Reply to author
Forward
0 new messages