I am trying to find a way to solve system of linear inequalities such as:
c>0
y+c<0
x+c>0
x+y+c<0
w+c>0
w+y+c>0
w+x+c>0
w+x+y+c<0
I have had no luck in finding a fast computational method to solve them. I have tried using wolfram alpha. It works for some sets but not for others. Moreover I also tried solving such systems using matlab's solve function but with no luck. Any help regarding this matter would be very much appreciated.
In general there are infinite solutions to an under determined system. You could however search for the smallest solution of an adapted problem. In that case you could preceed as follows:
You first vectorize your problem
x = [c y x w].';
M = [1 0 0 0
1 1 0 0
1 1 1 0
1 0 0 1
1 1 0 1
1 0 1 1
1 1 1 1];
y = [ 1 -1 1 -1 1 1 1 -1].';
You can set the values of y
like you want. They only need to suffice the conditions of your inequalities (i.e y(1)>0
, y(2)<0
,...).
Now you solve the under determined system Mx=y.
The smallest solution of this system can be found by using the pseudo-inverse of M.
x = M.'(M*M.')^(-1)*y;
If you have chosen y
accordingly to your restrictions, the solution of this problem is also a solution of your problem.
If you want the smallest solution to your problem, just give y
only an epsilon room (but then you should calculate it analytical).