algorithmsystemsolverlinear-programminginequality

How to solve a system of inequalities?


I've reduced my problem (table layout algorithm) to the following problem:

Imagine I have N variables X1, X2, ..., XN. I also have some (undetermined) number of inequalities, like:

X1 >= 2
x2 + X3 >= 13
etc.

Each inequalities is a sum of one or more variables, and it is always compared to a constant by using the >= operator. I cannot say in advance how many inequalities I will have each time, but all the variables have to be non-negative, so that's already one for each variable.

How to solve this system in such a way, that the values of the variables are as small as possible?

Added: Read the wikipedia article and realized that I forgot to mention that the variables have to be integers. Guess this makes it NP-hard, huh?


Solution

  • Minimizing x1 + x2 + ... where the xi satisfy linear constraints is called Linear Programming. It's covered in some detail in Wikipedia