How to find the corners of a shape given 4 inequalities?

354 Views Asked by At

I'm trying to display the feasible space of four 2-variable linear inequalities as a quadrilateral shape. I have a simple solution so far but it makes a few key assumptions I want to remove:

  1. There are 4 sides to the shape
  2. Inequality 1 makes up the left side of the shape, inequality 2 makes up the top side, inequality 3 makes up the right side, and inequality 4 makes up the bottom side.

With these assumptions I can turn the inequalities into equations and get the 4 corner points of quadrilateral (going clockwise from top left) by finding the intersection of equation 1 and 2, equation 2 and 3, equation 3 and 4, and equation 4 and 1.

I would like to get rid of both of these assumptions, if possible. (What if the feasible space is a triangle instead... that is, one of the equations could be thrown out?) However, getting rid of either on it's own would be great. Does anyone have any insights?

This result will coded, so it can't be a graphical solution.

1

There are 1 best solutions below

2
On BEST ANSWER

Not a tremendously efficient solution, but with only four inequalities, it shouldn't matter much:

  • As you say, turn each of the inequalities into equations.
  • Compute the solution (if any) of each of the $6$ pairings of equations.
  • For each of the resulting points, see if it satisfies the $\leq$ or $\geq$ forms of all of the inequalities.
  • Those that do are the vertices of the region.