# Given a set of n inequalities each of the form ax+by+cz≤d for some a,b,c,d in Q, determine if there

Given a set of n inequalities each of the form ax+by+cz≤d for some a,b,c,d in Q, determine if there exists x, y and z in Q that satisfy all the inequalities.
Here is an O(n4) algorithm for solving this: for each triple of inequalities, intersect their corresponding planes to get a point (x,y,z) iff possible. If no such intersecting point exists continue on to the next triple of inequalities. Test each of these intersection points against all the inequalities. If a particular point satisfies all the inequalities the solution has been found. If none of these points satisfy all the inequalities then there is no point satisfying the system of inequalities. There are O(n3) such intersection points and there are n inequalities thus the algorithm is O(n4).
I would like a faster algorithm for solving this (eg: O(n3), O(n2), O(n*logn), O(n)). If you can provide such an algorithm in an answer that would be great. You may notice this problem is a subset of the more general k-dimensional problem where there are points in k-dimensions instead of 3 dimensions as in this problem or 2 dimensions as in my previous problem mentioned above. The time complexity of my algorithm generalized to k dimensions is O(nk+1). Ideally I would like something that is a polynomial time algorithm however any improvements over my naive algorithm would be great. Thanks
You can still ask an expert for help

## Want to know more about Inequalities systems and graphs?

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

zwichtsu
You can modify your algorithm a bit to make it $O\left({n}^{3}\right)$.
If we have a line, we can check if there's a point on that line satisfying all inequalities in $O\left(n\right)$ time. If we denote one of the directions on this line "up", each plane gives you an upper or lower bound on the part of the line satisfying the inequalities. So we can compute the intersection points between the line and each plane, and check if the lowest upper bound is above the highest lower bound.
Like in your algorithm, candidate lines can be intersection lines between each pair of planes $O\left({n}^{2}\right)$ of them. So you get a total complexity of $O\left({n}^{3}\right)$.
Note, care must be taken for the special case when all planes are parallel and so there's no intersection lines.