[SciPy-User] How to check inequalities for contradiction
Tue Nov 2 22:48:48 CDT 2010
On Tue, Nov 2, 2010 at 8:20 PM, <email@example.com> wrote:
> From: Bastian Weber <firstname.lastname@example.org>
> To: SciPy Users List <email@example.com>
> Date: Tue, 02 Nov 2010 18:46:57 +0100
> Subject: [SciPy-User] How to check inequalities for contradiction
> I have a System of inequalities like this
> Ax + b >= 0
> where the Relation ">=" is meant to hold in every line of the equation
> system. Additionally, every element of x has to be nonnegative.
> m,n = A.shape
> len(x) == n
> len(b) == m
> I have m > n.
> What would be the preferred way to test whether a solution exists?
> In other words, I want to test that there is no contradiction in the
> system of inequalities.
> The main intention of this post is to figure out whether a
> out-of-the-box solution to this type of problems exists.
> Thanks in advance.
This problem is as complicated as the linear programming problem
(http://en.wikipedia.org/wiki/Linear_programming). Your particular
instance has a vector c identically equal to zero. Strangely, having
c=0 doesn't make the problem any easier. There are methods out there
that can solve the problem in polynomial time (where "time" is linear
in the total length of the input data, i.e., the matrix A and the
vector b). Those methods are called "interior-point methods". There
are other methods, such as the simplex method, which are in principle
not polynomial, although in practice, good implementations are
Both types of methods are implemented in GLPK. PuLP provides a Python
interface to GLPK: http://code.google.com/p/pulp-or.
There is also an interior-point method in NLPy: nlpy.sf.net
So yes, there are out-of-the-box solution methods.
More information about the SciPy-User