[Osi] OsiClp WarmStarts

John J Forrest jjforre at us.ibm.com
Fri Oct 31 12:24:24 EDT 2008


Jan-Willem,

Yes - just always set solution and warmstart - dual and primal.

John





RE: [Osi] OsiClp WarmStarts

Goossens Jan-Willem 
to:
John J Forrest
10/31/2008 12:15 PM


Cc:
"osi at list.coin-or.org"







John,
 
Thanks for your reply.
This works! zero iterations in resolve.
 
Just to be sure: you're saying "not only get/set the WarmStart object, but 
also get/set the col solution" ?
(and make sure to *copy* the getColSolution() array..)
 
Now, is it safe to simply do this also in the dual algorithm? 
If yes, then I'll simply always get/set both WarmStart and ColSolution()..
 
Again, thanks for you help.
 
Jan-Willem
 
 
 
From: osi-bounces at list.coin-or.org [mailto:osi-bounces at list.coin-or.org] 
On Behalf Of John J Forrest
Sent: 31 October 2008 16:33
Cc: osi at list.coin-or.org
Subject: Re: [Osi] OsiClp WarmStarts
 

Jan, 

I think the trouble is that OsiClp trusts the current solution as well as 
the basis.  In Primal it will use the current solution and basis, which 
will explain the behavior in Primal.  In Dual,  I am not sure what the 
problem is.  Presolve may make a small difference, but should not make a 
major difference.  Clp itself has more flexibility. 

Is it OK with you to use getColSolution(0 and setColSolution()? 

John Forrest 





[Osi] OsiClp WarmStarts
 


Goossens Jan-Willem 
to: 
osi at list.coin-or.org 
10/31/2008 06:48 AM
 



Sent by: 
osi-bounces at list.coin-or.org



 




Hi, 
  
I have some questions about WarmStarts using OsiClp. 
I'm solving pure LPs and I tried to recreate my real problem using miplib 
3.0s "p0548" (See http://www.caam.rice.edu/~bixby/miplib/miplib3.html) 
See below for code and output. 
  
Basically, I (1) solve the problem, store a warm start, (2) change the 
objective and resolve, and (3) restore original objecte, load warmstart 
and resolve. 
I was expecting the step (3) to take zero iterations. However, this is not 
(always) the case: In this test problem, 
Test run 1) if I do NOT set hints concerning DoDualIn*, then indeed (3) 
takes zero iterations. 
Test run 2) but if I set HintTry for these to false (so use primal), then 
(3) reoptimises (see end of email) 
  
In my real instances the (3) resolve takes a *lot* of iterations. 
Note that this test problem doesn?t completely represent my real problem: 
the real instances show this behaviour even without the DoDual = false 
settings, but the resulting iterations are the same. 
  
What could be the cause for these reoptimizations? 
A) different algorithm after warmstart compared to solve warmstart was 
based on? 
B) presolve chooses to remove different rows/columns in resolve? 
C) something else? 
  
Or is this simply not what the warmstarts are for? 
  
Any help would be appreciated. 
Regards, 
  
Jan-Wilem Goossens 
  
????????????????????-- 
  
Here is the test problem 
  
      OsiClpSolverInterface model; 
 
      model.setHintParam(OsiHintParam::OsiDoDualInInitial, false); // 
comment out 
      model.setHintParam(OsiHintParam::OsiDoDualInResolve, false); // 
comment out 
      model.setHintParam(OsiHintParam::OsiDoPresolveInInitial); 
      model.setHintParam(OsiHintParam::OsiDoPresolveInResolve); 
  
      int status = model.readMps("p0548.mps", true, false); 
      int n = model.getNumCols(); 
      for (int i = 0; i < n; i++) model.setContinuous(i); // change to LP 
  
      // (1) do initial solve of original problem, and store warm start 
info 
      model.initialSolve(); 
      CoinWarmStart *warmStart = model.getWarmStart(); 
  
      // (2) change the objective function and resolve 
      const double * objCoefs = model.getObjCoefficients(); 
      double * oldCoefs = new double[n]; 
      for (int i = 0; i < n; i++) oldCoefs[i] = objCoefs[i]; 
      for (int i = 0; i < n; i++) model.setObjCoeff(i,1.0); 
  
      model.resolve(); 
  
      // (3) restore the original problem, and load warm start 
      model.setObjective(oldCoefs); 
      model.setWarmStart(warmStart); 
      model.resolve(); 
  
OUTPUT: 
Test run 1, with commented out: 
      // model.setHintParam(OsiHintParam::OsiDoDualInInitial, false); // 
comment out 
      // model.setHintParam(OsiHintParam::OsiDoDualInResolve, false); // 
comment out 
  
      // (1) do initial solve of original problem, and store warm start 
info 
Coin0506I Presolve 163 (-13) rows, 543 (-5) columns and 1561 (-150) 
elements 
Clp0006I 0  Obj 0 Primal inf 38.8018 (12) 
Clp0006I 95  Obj 315.255 
Clp0000I Optimal - objective value 315.255 
Coin0511I After Postsolve, objective 315.255, infeasibilities - dual 0 
(0), primal 0 (0) 
Clp0006I 0  Obj 315.255 
Clp0006I 0  Obj 315.255 
Clp0000I Optimal - objective value 315.255 
  
      // (2) change the objective function and resolve 
Coin0506I Presolve 165 (-11) rows, 543 (-5) columns and 1579 (-132) 
elements 
Clp0006I 0  Obj 59.3381 Primal inf 0.314674 (1) Dual inf 161381 (290) 
Clp0006I 103  Obj 16.571 Primal inf 8.57907 (29) 
Clp0006I 165  Obj 26.1669 
Clp0000I Optimal - objective value 26.1669 
Coin0511I After Postsolve, objective 26.1669, infeasibilities - dual 0 
(0), primal 0 (0) 
  
      // (3) restore the original problem, and load warm start 
Coin0506I Presolve 163 (-13) rows, 543 (-5) columns and 1561 (-150) 
elements 
Clp0006I 0  Obj 366.255 Primal inf 30.9296 (2) Dual inf 304.123 (2) 
Clp0000I Optimal - objective value 315.255 
Coin0511I After Postsolve, objective 315.255, infeasibilities - dual 0 
(0), primal 0 (0) 
  
Test run 2, with: 
      model.setHintParam(OsiHintParam::OsiDoDualInInitial, false); 
      model.setHintParam(OsiHintParam::OsiDoDualInResolve, false); 
  
      // (1) do initial solve of original problem, and store warm start 
info 
Coin0506I Presolve 163 (-13) rows, 543 (-5) columns and 1561 (-150) 
elements 
Clp0028I Crash put 44 variables in basis, 0 dual infeasibilities 
Clp0006I 0  Obj 0 Primal inf 38.8018 (12) Dual inf 5.62868e+012 (120) 
Clp0006I 132  Obj 20103.2 Primal inf 1.08159 (1) Dual inf 1.10445e+011 
(193) 
Clp0006I 289  Obj 345.667 Dual inf 627.385 (26) 
Clp0006I 316  Obj 315.255 
Clp0000I Optimal - objective value 315.255 
Coin0511I After Postsolve, objective 315.255, infeasibilities - dual 0 
(0), primal 0 (0) 
Clp0006I 0  Obj 315.255 
Clp0006I 0  Obj 315.255 
Clp0000I Optimal - objective value 315.255 
  
      // (2) change the objective function and resolve 
Coin0506I Presolve 165 (-11) rows, 543 (-5) columns and 1579 (-132) 
elements 
Clp0006I 0  Obj 69.5868 Dual inf 38838.5 (125) 
Clp0006I 94  Obj 26.1669 
Clp0000I Optimal - objective value 26.1669 
Coin0511I After Postsolve, objective 26.1669, infeasibilities - dual 0 
(0), primal 0 (0) 
Coin0506I Presolve 163 (-13) rows, 543 (-5) columns and 1561 (-150) 
elements 
  
      // (3) restore the original problem, and load warm start 
Clp0006I 0  Obj 1817.67 Dual inf 3514.68 (6) 
Clp0029I End of values pass after 37 iterations 
Clp0006I 37  Obj 1817.67 Dual inf 3515.85 (5) 
Clp0006I 170  Obj 336.741 Dual inf 20.3286 (24) 
Clp0006I 202  Obj 315.255 
Clp0000I Optimal - objective value 315.255 
Coin0511I After Postsolve, objective 315.255, infeasibilities - dual 0 
(0), primal 0 (0) 
 _______________________________________________
Osi mailing list
Osi at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/osi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/osi/attachments/20081031/386378ca/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 821 bytes
Desc: not available
URL: <http://list.coin-or.org/pipermail/osi/attachments/20081031/386378ca/attachment.gif>


More information about the Osi mailing list