transform linear inequality constraints into bound constraints for optimization solvers
Show older comments
Suppose there are linear inequality constraints
and
are the parameters optimized by fmincon, lsqnonlin, or friends.
are the parameters optimized by fmincon, lsqnonlin, or friends.Since linear inequality constraints can generally not be enforced at intermediate iterations, I want to transform them into bound constraints which can be enforced at all iterations.
General idea:
If A is dense and has m rows (i.e, there are m constraints), then we can make a "change of variables"
, where
.This leads to simple bound constraints
. Does that make sense?
Specific problem:
My parameters y represent interpolation values corresponding to interpolation points x and the resulting interpolation function is supposed to be convex on the interpolation domain. For the specific case of linear interpolation, @Matt J showed that convexity is realized by increasing second order finite differences
(which represents a set of linear inequality constraints) This can be transformed into simpler bounds on the new parameters
by the change of variables
by the change of variables
with 

What I am really working with are smoother B-spline basis functions of higher degree using spapi function. @Bruno Luong showed that the linear inequality matrix A is given by
% k: spline order, x: points where values y live
B = spapi(k,x,eye(length(x)));
Bdd = fnder(B,2);
A = Bdd.coefs'
and
I am wondering whether a change of variables (like for linear interpolation functions) can be applied here to transform the inequalities into bounds?
Any opinions are greatly appreciated!
1 Comment
John D'Errico
on 3 Oct 2024
For example, it is possible to convert a set of linear inequality constraints into a bound constrained problem by the introduction of what are called slack variables.
That is, if you have an inequality
A*x >= b
then you CAN write it as an equality
A*x == b + y
where y is a new (slack) variable that is constrained to be non-negative. If you have multiple constraints, then you would introduce one slack variable for each inequality constraint.
Such slack variables are a common artifice in mathematics, used for example to solve the minimum sum of absolute values problem (versus the traditional linear least squares) but also used to formulate optimization problems using Lagrange multipliers. You can also view the question of whether a point lies inside a convex polytope, in terms of slack variables, one for each facet of the polytope. I can think of at least one other example.
However, you are asking to solve the problem in a different way, by use of a transformation. For example, given a vector x, which must form a monotonic increasing sequence, then we can transform the problem such that y=diff(x)>=0. And this is not always so easy.
Accepted Answer
More Answers (1)
Yes, a set A*y>=0 is a cone and so can equivalently be expressed as
where
are the so-called extreme rays of the cone and
are non-negative coefficients. So, in theory, you could re-express the problem with
as the unknowns and which require only non-negativity constraints. However, finding the extreme rays
given the matrix A can be computationally demanding, depending on the dimension of the problem.
9 Comments
SA-W
on 3 Oct 2024
Matt J
on 3 Oct 2024
For a more general polyhedron A*y>=b, the Weyl-Minkowski theorem says that any y in this set can be expressed in the form,

Unfortunately, this requires an equality constraint on the
and so is not as neat a case.
SA-W
on 3 Oct 2024
Bruno Luong
on 3 Oct 2024
Edited: Bruno Luong
on 3 Oct 2024
One can remove the condition lambdai <= 1 in the Weyl-Minkowski theorem.

So it becomes also a standard form with single equality constraint.
The trade off is one must enumerate all the vertices v_i of the polytopes and this strategy absolutely out of the question numerically in problem with non-toy dimension superior to 4, 5 may be.
SA-W
on 4 Oct 2024
For a small example, you can look here:
There is also 3rd party code for higher dimensional cases. The following is one offering, though I've never used it myself:
Bruno Luong
on 4 Oct 2024
In the theoreme In page 23 of this document the extreme directions (rays directions) can be seen as vertices of an almost similar form of the original polyhedra.
To find a vertices of an polyhedra you need to pick a lot of combination of vectors (50) within a large number of vectors (96 = 2*48). This brute force would be impossible to achieve.
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!