How can linear programming condition check if variable is a multiple of number?

57 Views Asked by At

Let's say we have linear programming problem

with x1 and x2 variables.

Maximize x1 + x2

where (for example)

0.3x1 + 0.7x2 <= 2

0.2x1 + 0.3x2 <= 3

How can be added one more condition, so linear programming solve should take into account, that

x1 should come a multiple of 20 (or any other number) ?

something towards:

(1/20)*x1 + 0 <= something towards 20

So, for this example x1 variable,

right answer should be 20 or 40 or 60, ...

1

There are 1 best solutions below

9
On

It sounds like you want to enforce the constraint that there exists an integer $k$ such that $x_1 = k \cdot 20$. Once you enforce this type of constraint, you no longer have a linear programming problem. In particular, the set of decision variables is no longer convex, because you're only allowing $x_1$ "on a grid" so to speak.

Once you add in constraints like this, your problem becomes one of "integer linear programming".