forum.alglib.net
http://forum.alglib.net/

minbleicoptimize slower in commercial version
http://forum.alglib.net/viewtopic.php?f=2&t=2062
Page 1 of 1

Author:  cron [ Fri Jun 20, 2014 9:36 pm ]
Post subject:  minbleicoptimize slower in commercial version

Hello,

I tested both free and commercial versions of Alglib in C#.

My test works properly with the free version ~700 optimizations with N=500. But when I switch to Managed or Native version it becomes really really slow when N>150, I cannot even finish my test.
I am running this on a 64bit - 4 cores - 8G windows 2008 server.

Is there any extra parameter to define in the comercial version which is not required in the free version?
With the free version I was calling the following method: alglib.minbleicsetoutercond(state, _epso, _epsi).
This method does not exist in the commercial version, could it explain the difference?

With the free version all my optimization ends with return code=4.

I would really appreciate your help. Thank you

Code with free version:
private int OptimizeWithGradient(alglib.ndimensional_grad grad)
{
alglib.minbleicstate state;
alglib.minbleicreport rep;
alglib.minbleiccreate(_x0, out state);
alglib.minbleicsetbc(state, _l, _u);
if (_constraints != null)
{
alglib.minbleicsetlc(state, _constraints, _constraintsSide);
}

alglib.minbleicsetinnercond(state, _epsg, _epsf, _epsx);
alglib.minbleicsetoutercond(state, _epso, _epsi);
alglib.minbleicoptimize(state, grad, null, null);
alglib.minbleicresults(state, out _s, out rep);

return rep.terminationtype;
}

Code with commercial version:
private int OptimizeWithGradient(alglib.ndimensional_grad grad)
{
alglib.minbleicstate state;
alglib.minbleicreport rep;

alglib.minbleiccreate(_x0, out state);

alglib.minbleicsetbc(state, _l, _u);

if (_constraints != null)
{
alglib.minbleicsetlc(state, _constraints, _constraintsSide);
}

alglib.minbleicsetcond(state, _epsg, _epsf, _epsx,_maxIts);
alglib.minbleicoptimize(state, grad, null, null);
alglib.minbleicresults(state, out _s, out rep);

return rep.terminationtype;
}

Author:  Sergey.Bochkanov [ Mon Jun 23, 2014 6:26 am ]
Post subject:  Re: minbleicoptimize slower in commercial version

Hello! I replied to you by e-mail, answer is duplicated here for other ALGLIB users.

That's because you compared different versions of ALGLIB - most recent commercial edition (3.8.2) with older release of free edition (3.6.0 or earlier). BLEIC algorithm was changed in ALGLIB 3.7.0, and although this change generally resulted in better convergence, in your situation old algorithm is far more better. I.e., is it not "free-vs-commercial", it is "3.8.2-vs-3.6.0" question.

Old versions of ALGLIB used Augmented Lagrangian algorithm (AUL) to solve linearly constrained problem, in ALGLIB 3.7.0 it was changed to active sets method. AUL algorithm has lesser precision (constraints are satisfied only approximately, usually with relative error as large as 0.0001), and in most cases it required far more iterations than active sets method. Furthermore, it requires some manual tweaking (tuning barrier width and outer stopping criteria). Active sets method is more robust and does not require such tweaking.

It turned out after your report that in some cases AUL method gives better results. I think that I will reintroduce AUL method in 3.9.0... As for your situation, in my e-mail I offered two possible solutions.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/