Group: sci.op-research
From: Paul Rubin
Date: Thursday, February 07, 2008 10:19 AM
Subject: Re: Need Help - Constrained linear least square optimization C code

navon2@gmail.com wrote:
> Hi
> I need to find x that will minimize Ax-b=0, under the inequality
> constraints Cx> Actually the constraints in my problem are only upper and lower bounds
> to x values.
> x is 4x1 vector, A is about 100x4 (and b is of course 100x1(.
> What is the appropriate algorithm?
> Is there any C / C++ code available?
>
> I succeeded solving the non-constrained problem with SVD, but some
> times it give non-legal solution.
>
> Thanks a lot in advance
> Ariel

Depends on what you mean by "minimize Ax-b=0", which does not actually
make sense as written. I assume you want to minimize the norm of the
error in the solution, subject to bounds on x. How you do this depends
on which norm you like. To minimize the L2 (Euclidean) norm, you can
use any quadratic programming code. To minimize the L1 (absolute value,
a.k.a. "taxicab") norm, you could use any linear programming code. LP
code will also handle the L0 (or L-infinity if you prefer) norm (a.k.a.
"sup norm"), where you would minimize the worst absolute discrepancy in
any component.

A good starting point to find software is
http://plato.asu.edu/guide.html. There are lots of programs out there
to do linear and quadratic programming, and your problem is pretty small
by LP/QP standards, so you shouldn't have any problem finding something
suitable. In fact, if you're an Excel user, you could do it with the
version of Frontline Solver that comes with Excel.

/Paul

Safety Articles | Usenet Groups | Usenet News | Bluegrass