[Clp] different optimal values with primal and dual methods.

William H. Patton pattonwh at comcast.net
Mon May 28 01:31:59 EDT 2012


Look at row scale options in clp.
You have terrible scaling The constraint matrix inf-norm is 275591, with 
a dynamic range of 2.19171e+017.
Or when you generate the cut__6_119: and sur__6:   type rows
scale them by rhs / 100 so they all have coefficients < 100.
It would be good to do something about the columns in the obj that are 
far away from the useless 0.008333333
namely the last 3 .  Yould be mutch better off with an obj   like ... +1 
C0000119   +1590 C0000660 +1297 C0000661 +685 C0000662;
C0000114 +0.008333333 C0000115 +0.008333333 C0000116 +0.008333333 
C0000117 +0.008333333 C0000118 +0.008333333 C0000119
  +1590 C0000660 +1297 C0000661 +685 C0000662;


Why do you carry rows like this?  Because of assumed positive vars, 
these force  them to be 0 and so can be deleted.
Make sure you give a presolve option to enforce this.  Same with the 
fixed at 0 vars.
  FX BOUND C0000567 0.0
  FX BOUND C0000568 0.0
  FX BOUND C0000569 0.0



OR maybe just run it cold! I renamed it  akhil.mps

H:\lpsolve-55\glpk445bin*>clp2 akhil.mps
Coin LP version 1.14.4, build Nov 10 2011
command line - clp2 akhil.mps*
At line 1 NAME          BLANK     FREE
At line 2 ROWS
At line 910 COLUMNS
At line 97677 RHS
At line 98086 BOUNDS
At line 98630 ENDATA
Problem BLANK has 906 rows, 663 columns and 192701 elements
Model was imported from .\akhil.mps in 0.179 seconds
Presolve 846 *(-60)* rows, 403*(-260)* columns and 192104 (-597) elements
Perturbing problem by 0.001 % of 9.175031 - largest nonzero change 
1.8688792e-00
5 (% 15.602748) - largest zero change 1.9162731e-005
0  Obj 0 Primal inf 3.4531696e+011 (726)
82  Obj 2533.5625 Primal inf 2032910.4 (84)
173  Obj 2779.3107 Primal inf 1.1564748e+008 (45)
264  Obj 29990.164 Primal inf 3.2332069e+010 (284)
319  Obj 68623.309 Primal inf 9.8482044e+009 (112)
410  Obj 84542.754 Primal inf 34343.11 (1)
411  Obj 84543.041
411  Obj 79648.885 Dual inf 0.011916972 (6)
418  Obj 79596.394
Optimal - objective value 79596.394
After Postsolve, objective 79596.394, infeasibilities - dual 
1.4620643e-005 (1),
  primal 0 (0)
*Presolved model was optimal, full model needs cleaning up*
0  Obj 79596.394 Primal inf 1.6093254e-005 (8) Dual inf 8e+008 (11)
End of values pass after 22 iterations
22  Obj 79596.394
22  Obj 79596.394
Optimal - objective value 79596.394
Optimal objective 79596.39385 - 440 iterations time 0.302, Presolve 0.08

H:\lpsolve-55\glpk445bin>

H:\lpsolve-55\glpk445bin>*cbc2 akhil.mps*
*Welcome to the CBC MILP Solver
Version: 2.7.5
Build Date: Nov 10 2011
Revision Number: 1759*

command line - cbc2 akhil.mps (default strategy 1)
At line 1 NAME          BLANK     FREE
At line 2 ROWS
At line 910 COLUMNS
At line 97677 RHS
At line 98086 BOUNDS
At line 98630 ENDATA
Problem BLANK has 906 rows, 663 columns and 192701 elements
Coin0008I BLANK read with 0 errors
Presolve 846 (*-60)* rows, 403 (*-260)* columns and 192104 (-597) elements
*Perturbing problem by 0.001 % of *9.175031 - largest nonzero change 
1.8688792e-00
5 (% 15.602748) - largest zero change 1.9162731e-005
0  Obj 0 Primal inf 3.4531696e+011 (726)
82  Obj 2533.5625 Primal inf 2032910.4 (84)
173  Obj 2779.3107 Primal inf 1.1564748e+008 (45)
264  Obj 29990.164 Primal inf 3.2332069e+010 (284)
319  Obj 68623.309 Primal inf 9.8482044e+009 (112)
410  Obj 84542.754 Primal inf 34343.11 (1)
411  Obj 84543.041
411  Obj 79648.885 Dual inf 0.011916972 (6)
418  Obj 79596.394
Optimal - objective value 79596.394
After Postsolve, objective 79596.394, infeasibilities - dual 
1.4620643e-005 (1),
  primal 0 (0)
*Presolved model was optimal, full model needs cleaning up*
0  Obj 79596.394 Primal inf 1.6093254e-005 (8) Dual inf 8e+008 (11)
End of values pass after 22 iterations
22  Obj 79596.394
22  Obj 79596.394
Optimal - objective value 79596.394
Optimal objective 79596.39385 - 440 iterations time 0.322, Presolve 0.10
Total time (CPU seconds):       0.51   (Wallclock seconds):       0.51


H:\lpsolve-55\glpk445bin>


On 5/27/2012 6:18 PM, Jonathan Currie wrote:
>
> Hi Akhil,
>
> I'm not sufficiently experienced to be able to answer why the solvers 
> give such different answers (I assume there are multiple factors), 
> however note I ran your model using the OPTI Toolbox across the LP 
> solvers I have and found CLP did not return the minimum (using the 
> default settings) for either the dual or primal solvers:
>
> Test Problem [LP] Result
>
> --------------------------------------------------
>
>   Solver    Status          Fval                  Time
>
>    cplex       OK        +79596.2542      0.7609s
>
>    mosek    FAIL     +79596.2164       1.0940s
>
> clp (dual)   OK        +114009.8970   0.3482s
>
> clp (primal) OK     +79605.5292      0.7370s
>
>     glpk        FAIL     +0.0000                1.9977s
>
>    qsopt      OK       +79596.2542       0.8384s
>
>   matlab     OK       +79596.2542       7.7259s
>
> --------------------------------------------------
>
> I assume you obtained the same minimums as above using CLP? How was 
> the original model created?
>
> Jonathan Currie
>
> *From:*clp-bounces at list.coin-or.org 
> [mailto:clp-bounces at list.coin-or.org] *On Behalf Of *Akhil langer
> *Sent:* Sunday, 27 May 2012 2:17 p.m.
> *To:* clp at list.coin-or.org
> *Subject:* [Clp] different optimal values with primal and dual methods.
>
> I am attaching a linear program model file in mps format. I am trying 
> to solve it using the driver.cpp program in the examples directory of 
> the coin-clp distribution. Surprisingly, I am getting different 
> optimal values when solved using the dual and primal methods 
> (model.dual(), model.primal()). Can someone please look into it and 
> help me resolve this issue.
>
> Some help as early as possible will be useful as I am in a critical 
> phase of my project.
>
> Thanks,
>
> Akhil
>
>
>
> _______________________________________________
> Clp mailing list
> Clp at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/clp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20120528/be9d9626/attachment.html>


More information about the Clp mailing list