Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

quadprog too slow

438 views
Skip to first unread message

hicham bouchnaif

unread,
May 27, 2008, 7:14:02 AM5/27/08
to
Hi there
I am trying to solve a quadratic problem with linear
constraints using quadprog function. I get the solution but
it's just too slow .it takes about 10min to get the problem
solved.
the problem consists of 1000 (one thousand variables) and
the hessian matrix is a sparse matrix thus I guess the
problem should be solved much faster.
is it possible to make it faster by changing the options.I
tried suitching on the LargeScale option,but nothing
changed. does anyone have any idea?
thanx a lot in advance.

Johan Löfberg

unread,
May 27, 2008, 8:58:02 AM5/27/08
to
Are the constraints sparse too?

Have you tried an alternative solver, such as clpmex,
bpmpdmex, ooqp

http://control.ee.ethz.ch/~joloef/wiki/pmwiki.php?n=Solvers.Solvers

Sparse problems of size 1000 is solved in ~10 seconds using
clp when I tried it

"hicham bouchnaif" <bouc...@gmail.com> wrote in message
<g1gqdq$ns6$1...@fred.mathworks.com>...

hicham bouchnaif

unread,
May 27, 2008, 9:29:02 PM5/27/08
to

> Are the constraints sparse too?

yes the constraints are aparse too.



> Have you tried an alternative solver, such as clpmex,
> bpmpdmex, ooqp

haven'tried yet but I d like to make the tool 100%matlab
for some technical reasons.

Johan L&#xF6;fberg

unread,
May 28, 2008, 5:25:05 AM5/28/08
to
"hicham bouchnaif" <bouc...@gmail.com> wrote in message
<g1icgu$b2a$1...@fred.mathworks.com>...

The alternatives are interfaced to MATLAB, or do you mean
that you won't accept mex?


Stefan

unread,
May 28, 2008, 7:07:02 AM5/28/08
to
Hi there,

maybe this helps:

http://sigpromu.org/quadprog/index.html

Regards,
Stefan

"Johan L?fberg" <loef...@control.ee.ethz.ch> wrote in
message <g1j8dh$nbj$1...@fred.mathworks.com>...

hicham bouchnaif

unread,
May 28, 2008, 8:50:18 PM5/28/08
to
Hi Stefan
thanx for the link.
I think that QPC supports only dense matrices which means
that it doesn't suit large scale problems.

Regards

hicham bouchnaif

unread,
May 28, 2008, 8:55:04 PM5/28/08
to

> The alternatives are interfaced to MATLAB, or do you mean
> that you won't accept mex?

no it's just a matter of accuracy, I ll try this OOQP stuff
and see how it works.

Regards


Johan L&#xF6;fberg

unread,
May 29, 2008, 8:32:01 AM5/29/08
to
"hicham bouchnaif" <bouc...@gmail.com> wrote in message
<g1kut8$g50$1...@fred.mathworks.com>...

Correct, QPC is not applicable due to sparsity. clpmex
should work straight out of the box, so will bpmpdmex. I
think I had problems obtaining compiled versions of ooqp
last time I tried.

hicham bouchnaif

unread,
Jun 2, 2008, 2:55:04 AM6/2/08
to
I tried clpmex, it's realy fast, quite impressing.
I ll try to test it for a higher scale.
by the way do you happen to know any other free soft that
you recommand for solving problems of type QP with
quadratic and linear constraints?

thanx alot.

Johan L&#xF6;fberg

unread,
Jun 2, 2008, 5:21:02 AM6/2/08
to
Those listed on the page I referenced are the ones with
MATLAB interfaces that I am aware of

"hicham bouchnaif" <bouc...@gmail.com> wrote in message

<g205g8$kam$1...@fred.mathworks.com>...

Min

unread,
Oct 6, 2008, 2:35:06 PM10/6/08
to
Hi All,

I'm facing almost exactly the same problem.
Therefore I would like to try out clpmex as well.
I wonder should I download the file from
"http://control.ee.ethz.ch/~hybrid/cplexint.msql"?
And do I need to download the cplex library from http://www.ilog.com/ as well?
I tried to use the mex file directly but failed (libstdc++.so.5: cannot open shared object file: No such file or directory).
Any suggestions and pointers will be a great help for me.

Best,
MS

"Johan L?fberg" <loef...@control.ee.ethz.ch> wrote in message <g20e1u$dop$1...@fred.mathworks.com>...

Min

unread,
Oct 6, 2008, 3:00:27 PM10/6/08
to
Hi Johan,

Clpmex seems to need a license. Therefore, bpmpdmex might be the only free option for large-scale sparse QP problems.
However, the bpmpdmex that I downloaded only has a pre-compiled 32bit linux version.
Do you know how to compile bpmpdmex for a 64bit linux machine? The reason I can'y compile it is because I do not find the source code of bpmpd and any documents on using bpmpdlib.

Best,
-MS


"Johan L?fberg" <loef...@control.ee.ethz.ch> wrote in message <g1m7o1$dgi$1...@fred.mathworks.com>...

sally

unread,
Jul 11, 2012, 4:00:19 PM7/11/12
to
I was able to speed up my solver significantly using the following recommendations from the documentation:

If you have a convex problem, or if you don't know whether your problem is convex, use interior-point-convex.
If you have only bounds, or only linear equalities, use trust-region-reflective.
If you have a nonconvex problem that does not satisfy the restrictions of trust-region-reflective, use active-set.


"Min " <alien...@gmail.com> wrote in message <gcdn8b$6pn$1...@fred.mathworks.com>...

Saad

unread,
Nov 27, 2012, 2:52:15 PM11/27/12
to
"sally" wrote in message <jtkm0j$rm2$1...@newscl01ah.mathworks.com>...
Dear All,

I have the same problem with quadprog. It seems that my quaprog gets stuck and doesn't optimize my problem. Could you please give advice on more powerful optimization function. I did read the thread above and I could not find a straight answer as everyone seemed to use different functions. Any advice is most welcome. For example which optimization function can I use as an alternative to gradprog (without the need to compile anything). Thanks again

Saad

unread,
Nov 28, 2012, 10:09:18 AM11/28/12
to
"Saad" wrote in message <k935lf$ele$1...@newscl01ah.mathworks.com>...
I finally found the answer to my problem and I found that the function QPC (free of use for acamedia) solve my quad programming issue.....

http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Solvers.QPC

The reason why I used it, is because quadprog was too slow and sometimes it didnt give me any output even though the optimization problem I had seemed to perfectly fit the problem that the function solves. Hope this will help others matlab users
0 new messages