[Clp] ClpSimplexNonlinear question

John Forrest john.forrest at fastercoin.com
Fri Mar 22 07:59:07 EDT 2013


William,

a) QSECTION was an alternative format.  I used it as example used it and 
it separates out the model loading actions.

On accuracy, I will send you modified code for comments.

I do not have any difficult quadratic problems.  Can someone send me a 
problem where it would help to modify exit criterion?

John


On 21/03/13 16:40, William H. Patton wrote:
> What is the difference between QSECTION   in your log for share2b.mps
> and QUADOBJ  needed by -barrier?
>
> Also, Quadratic objectives need more attention to scaling and RELATIVE 
> tolerances.
> http://en.wikipedia.org/wiki/Relative_change_and_difference
> with some kind of tempering near  0 of the expected objective.
> I lean toward a relative denominator of    ( 1 + abs(x) + abs(y) )
> The sum abs for big values  away from 0 and the 1 so that relative 
> becomes absolute difference when the objective gets close to 0.
>
> In the -barrier case  i think it goes here:
> earching for: sloppyOptimal   it seems to be locally detected
> ClpPredictorCorrector.cpp(212): bool sloppyOptimal = false;
> ClpPredictorCorrector.cpp(275): if (!sloppyOptimal) {
> ClpPredictorCorrector.cpp(361): if (sloppyOptimal) {
> ClpPredictorCorrector.cpp(403): if ((gapO < 1.0e-6 || (gapO < 1.0e-4 
> && complementarityGap_ < 0.1)) && !sloppyOptimal) {
> ClpPredictorCorrector.cpp(404): sloppyOptimal *= true;*
> ClpPredictorCorrector.cpp(417): if (saveIteration >= 0 && sloppyOptimal) {
>
> So if you keep your current scale for the problem you need to tweek 
> the block *around line 403*   perhaps the bold block needs tweaking by 
> ratio of gap to objective
>   say the bold gap0/(primalObjective_ * objScale - 
> dblParam_[ClpObjOffset])     and same for *complementarityGap_*
> *18 Primal -1.3318263e+09 Dual -1.3318263e+09 Complementarity 
> 40.006314 - 134 fixed, rank 3924 *
>           if ((gapO < 1.0e-6 ||*(gapO < 1.0e-4 && complementarityGap_ 
> < 0.1)) && !sloppyOptimal)* {
>                sloppyOptimal = true;
>
> >>>>>>>>>>
> from the log in message V of 11/27/2012 10:50 AM, Stephanie Jakus wrote:
> I'm using the Clp executable with the barrier method, and running into 
> problems where the complementarity value gets small and then diverges. 
> I'm wondering if there is an option to change the convergence 
> tolerance value for the complementarity when using the barrier method. 
> (I see the options for tolerance on primal and dual feasibility... but 
> are those enough?)
> <<<<<<<<<<
>
> I would want to quit around here at iter 18 or 22. The relative 
> Complementary is 40/ 10^9  which is 8 digits of precision.
> Pretty good when you should expect only 5 to 6 digits after a bunch 
> of  double precision scalar products on the 911766 elements in sparse 
> Cholesky,.
>
> 16 Primal -1.3318262e+09 Dual -1.3318287e+09 Complementarity 2519.259 
> - 76 fixed, rank 3924
>
> 17 Primal -1.3318263e+09 Dual -1.3318263e+09 Complementarity 40.523345 
> - 134 fixed, rank 3924
>
> *18 Primal -1.3318263e+09 Dual -1.3318263e+09 Complementarity 
> 40.006314 - 134 fixed, rank 3924*
>
> 19 Primal -1.3318263e+09 Dual -1.3318264e+09 Complementarity 39.542777 
> - 134 fixed, rank 3924
>
> 20 Primal -1.3318263e+09 Dual -1.3318265e+09 Complementarity 39.128027 
> - 134 fixed, rank 3924
>
> 21 Primal -1.3318263e+09 Dual -1.3318266e+09 Complementarity 38.757635 
> - 134 fixed, rank 3924
>
> *22 Primal -1.3318263e+09 Dual -1.3318263e+09 Complementarity 
> 0.87384878 - 134 fixed, rank 3924*
>
> 23 Primal -1.3318263e+09 Dual -1.331649e+09 Complementarity 
> 0.0061784205 - 134 fixed, rank 3924
>
> 24 Primal -1.3318263e+09 Dual -1.3047041e+09 Complementarity 
> 4.0066434e-05 - 134 fixed, rank 39
>
>
>
>
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> your log
>
> Coin0001I At line 1 NAME          SHARE2B
> Coin0001I At line 2 ROWS
> Coin0001I At line 100 COLUMNS
> Coin0001I At line 482 RHS
> Coin0001I At line 495 ENDATA
> Coin0002I Problem SHARE2B has 96 rows, 79 columns and 694 elements
> Coin0001I At line 496 NAME          SHARE2B
> *Coin0001I At line 497 QSECTION*
> Coin0001I At line 526 ENDATA
> My log
> H:\lpsolve-55\glpk445bin>clp2
> Coin LP version 1.14.4, build Nov 10 2011
> Clp takes input from arguments ( - switches to stdin)
> Enter ? for list of commands or help
> Clp:barrier?
> barr(ier) : Solve using primal dual predictor corrector algorithm
> Clp:barrier??
> barr(ier) : Solve using primal dual predictor corrector algorithm
> This command solves the current model using the  primal dual predictor
> corrector algorithm.  You may want to link in an alternative ordering
> and factorization.  It will also solve models with quadratic objectives.
> Clp:IMPORT share2qp.mps
> At line 1 NAME          SHARE2B
> At line 2 ROWS
> At line 100 COLUMNS
> At line 482 RHS
> *At line 495 QUADOBJ*
> Problem SHARE2B has 96 rows, 79 columns and 694 elements
> At line 524 ENDATA
> Model was imported from .\share2qp.mps in 0.002 seconds
> Clp:barrier
> 2928 elements in sparse Cholesky, flop count 89374
> 0 Primal 1880441 Dual -1.6693328e+008 Complementarity 1.9590728e+008 - 0
> fixed,
> rank 271
> 1 Primal 30581.248 Dual -10443941 Complementarity 26978058 - 0 fixed,
> rank 271
> 2 Primal 1572.4622 Dual -3087057.1 Complementarity 6108433.1 - 0 fixed,
> rank 271
>
> 3 Primal 310.8557 Dual -1459155.3 Complementarity 2507164.8 - 0 fixed,
> rank 271
> 4 Primal 509.42803 Dual -501381.13 Complementarity 606063.42 - 0 fixed,
> rank 271
>
> 5 Primal 967.29319 Dual -105866.26 Complementarity 115919.99 - 0 fixed,
> rank 271
>
> 6 Primal 837.84361 Dual -52400.522 Complementarity 57435.819 - 0 fixed,
> rank 271
>
> 7 Primal 102.95273 Dual -4147.861 Complementarity 4353.3398 - 0 fixed,
> rank 271
> 8 Primal -311.19033 Dual -855.93051 Complementarity 551.31766 - 0 fixed,
> rank 27
> 1
> 9 Primal -349.04464 Dual -618.45146 Complementarity 275.98936 - 0 fixed,
> rank 27
> 1
> 10 Primal -377.72515 Dual -436.0772 Complementarity 59.71886 - 0 fixed,
> rank 271
>
> 11 Primal -393.65235 Dual -415.96868 Complementarity 22.998293 - 0
> fixed, rank 2
> 71
> 12 Primal -398.79134 Dual -403.89314 Complementarity 5.2467322 - 0
> fixed, rank 2
> 71
> 13 Primal -400.18831 Dual -401.99952 Complementarity 1.8687018 - 0
> fixed, rank 2
> 71
> 14 Primal -400.83016 Dual -401.04844 Complementarity 0.22457764 - 0
> fixed, rank
> 271
> 15 Primal -400.90225 Dual -400.9482 Complementarity 0.045949787 - 13
> fixed, rank
>   271
> 16 Primal -400.9224 Dual -400.92272 Complementarity 0.00031159724 - 13
> fixed, ra
> nk 271
> 17 Primal -400.92254 Dual -400.92254 Complementarity 2.5038999e-006 - 13
> fixed,
> rank 271
> 18 Primal -400.92254 Dual -400.92254 Complementarity 1.7307463e-008 - 50
> fixed,
> rank 271
> 19 Primal -400.92254 Dual -400.92254 Complementarity 1.5460613e-008 - 53
> fixed,
> rank 271
> Exiting - using solution from iteration 17
> At end primal/dual infeasibilities 0/0.078454371, complementarity gap
> 1.4091511e
> -007, objective -400.92254
> Optimal objective -400.9225413 - 19 iterations time 0.102
> Clp:
> Clp:solu $
>
> optimal
> Objective value      -400.92254
>        0 010101        0.80133581         1.9143424e-008
>        1 010102          1.798893         8.5572461e-009
>        6 010107         5.8333333         2.6351614e-009
> . . .
>
> William
>
> On 3/20/2013 9:46 AM, John Forrest wrote:
>> Alex,
>>
>> I modified an example and attach it and solution log.  I ran it as
>>
>>  testQP2 ../../../Data/Sample/share2qp.mps
>>
>> that should show you how to load a model and a quadratic function. 
>> With current code constraints are linear.
>>
>> John Forrest
>>
>>
>>
>>
>> _______________________________________________
>> 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/20130322/7f644f64/attachment-0001.html>


More information about the Clp mailing list