For this question, a region is a subset of Zd defined by finitely many linear inequalities with integer coefficients, where Zd is the set of d-tuples of integers. For example, the set of pairs (x, y)
of non-negative integers with 2x+3y >= 10
constitutes a region with d=2
(non-negativity just imposes the additional inequalities x>=0
and y>=0
).
Question: is there a good way, using integer programming (or something else?), to check if one region is contained in a union of finitely many other regions?
I know one way to check containment, which I describe below, but I'm hoping someone may be able to offer some improvements, as it's not too efficient.
Here's the way I know to check containment. First, integer programming libraries can directly check if a region is empty: in integer programming terminology (as I understand it), emptiness of a region corresponds to infeasibility of a model. I have coded up something using the gurobi library to check emptiness, and it seems to work well in practice for the kind of regions I care about.
Suppose now that we want to check if a region X
is contained in another region Y
(a special case of the question). Let Z
be the intersection of X
with the complement of Y
. Then X
is contained in Y
if and only if Z
is empty. Now, Z
itself is not a region in my sense of the word, but it is a union of regions Z_1, ..., Z_n
, where n
is the number of inequalities used to define Y
. We can check if Z
is empty by checking that each of Z_1, ..., Z_n
is empty, and we can do this as described above.
The general case can be handled in exactly the same way: if Y
is a finite union of regions Y_1, ..., Y_k
then Z
is still a finite union of regions Z_1, ..., Z_n
, and so we just check that each Z_i
is empty. If Y_i
is defined by m_i
inequalities then n = m_1 * m_2 * ... * m_k
.
So to summarize, we can reduce the containment problem to the emptiness problem, which the library can solve directly. The issue is that we may have to solve a very large number of emptiness problems to solve containment (e.g., if each Y_i
is defined by only two inequalities then n = 2^k
grows exponentially with k
), and so this may take a lot of time.