2
$\begingroup$

My experience with OR is pretty limited, so I apologize if I'm using any sort of bespoke terminology.

I have a set of subsets ${ \{ S_1,\cdots,S_m\}}$ of $\mathbb{R}^n$, and corresponding functions $\{f_1,\cdots,f_m\}$, where the domain of $f_i$ is $S_i$.

Every set $S_i$ can be understood as a hypercube in $\mathbb{R}^n$; no discontinuities or funkiness happening there.

Assume that for every set $S_i$, across every dimension of the vector space, your index variable $x_h$ has some concrete constraints

$$a_{x_h} \leq x_h \lt b_{x_h} \forall h \in\{1,\cdots,n\}$$

Additionally, all of these sets are disjoint, eg $$S_i \cap S_j = \emptyset, i \neq j$$

The problem is that these sets don't necessarily cover $\mathbb{R}^n$, eg it's possible that

$$\bigcup_{i=1}^m S_i \neq\mathbb{R}^n$$

What I want is to enumerate the minimum number of disjoint subsets $\{S_{m+1}..S_{m+k}\}$ required to "cover" $\mathbb{R}^n$, eg

$$\bigcup_{i=1}^{m+k} S_i = \mathbb{R}^n$$

As an example, let's take $\mathbb{R}^2$ as the space we want to cover.

Our set of functions $f_i$ might have the following domains:

D1 : { (x, y) : x >= 2, y < -4 }

D2 : { (x, y) : x < -1, y > 5 }

D3 : { (x, y) : -1 <= x < 2 }

From inspection, it's clear that there's at least 2 disjoint subsets of $\mathbb{R}^2$ that are not covered by these domains.

They're depicted by the purple question marks in this image:

https://photos.app.goo.gl/ty6WLpaLgSo2VNWP8

What I want to know is, is there an algorithm which can take these domains as input, and output all existing disjoint, uncovered domains in the larger space?

$\endgroup$
6
  • 1
    $\begingroup$ Just to be clear, you are looking for the minimum number of hypercubes disjoint from each other and from the original hypercubes that would cover $\mathbb{R}^2,$ correct? (I'm abusing the term "hypercube" here to include unbounded polyhedra containing only right angles.) The minimum number of disjoint subsets would be 1 (all the uncovered portions of the space as a single set). $\endgroup$
    – prubin
    Commented Jan 27, 2023 at 16:17
  • $\begingroup$ Yes, that's a better phrasing! Think "connected" from graph theory, maybe "connected hypercubes?" $\endgroup$ Commented Jan 27, 2023 at 16:40
  • $\begingroup$ One more clarification. In your diagram, the left area with a question mark is a rectangular cone, so pretty clearly one "disjoint domain" in your terms. Suppose we add one more function domain $D_4$ given by $-2 \le x \le -1$ and $0 \le y \le 5,$ which takes a chunk out of the left question mark area. Would you still consider the surviving portion of the left question mark area a single domain (it no longer has a "rectangular" boundary), or would you expect it to be chopped up into two or more domains with more regular boundaries? $\endgroup$
    – prubin
    Commented Jan 27, 2023 at 18:40
  • $\begingroup$ In my problem space, it's only hypercubes, so I'd expect it to get chopped into two rectangles $\endgroup$ Commented Jan 27, 2023 at 19:06
  • $\begingroup$ Interesting problem. Would you be able to give us some background or context, as to where such a problem could arise? $\endgroup$ Commented Jan 28, 2023 at 3:38

1 Answer 1

3
$\begingroup$

This can be solved with an integer linear program (although I'm not sure that's the best approach). We first create a grid by running horizontal and vertical lines through all corners of your various domains. We don't need the grid to be evenly spaced. We also need to enclose the overall region in a box (hyperrectangle) big enough that all the vertices of the function domains are in the interior of the box. (We will relax the box later.) We need grid lines along the edges of the box.

I'll refer to any hyperrectangle bounded by consecutive grid lines in all directions as a "cell". We record the center points of each cell for future use, discarding any that are inside function domains.

Next, we form all possible hyperrectangles whose vertices are grid points. Discard any hyperrectangle that overlaps one of the function domains. This is easy to determine. If, in any dimension, both limits of the hyperrectangle are on the same side of the domain (both less than or equal to the lower range limit for that variable, or both greater than or equal to the upper range limit), the domain and the hyperrectangle do not overlap. Otherwise, they do.

Enumerate the surviving hyperrectangles as $R_1,\dots,R_N.$ Compute the set $S$ of pairs $(i,j),\, i<j$ for which $R_i$ and $R_j$ overlap (using the same logic by which we decided if hyperrectangles and domains overlapped).

Finally, for each center point $c_i,$ compute the set $C_i = \lbrace j\in 1,\dots,N : c_i\in R_j\rbrace$ of hyperrectangles containing that point.

Now define binary variables $x_i,\,i=1,\dots,N$ which will indicate whether or not hyperrectangle $R_i$ is part of our cover. The objective is to minimize $\sum_i x_i,$ the number of rectangles used. To avoid hyperrectangles intersecting, for each $(i,j)\in S$ we add the constraint $x_i + x_j \le 1,$ preventing us from using both. Finally, to ensure that everything outside the function domains is covered, for each center point $c_i$ we add the constraint $\sum_{j\in C_i} x_j = 1,$ requiring that the center point belong to exactly one selected hyperrectangle. Since the hyperrectangle boundaries are grid lines, if the center point of a cell is in a hyperrectangle, the entire cell is in the hyperrectangle.

Once we have a solution, we replace the lower (upper) limit of any variable in any selected hyperrectangle with $-\infty$ ($+\infty$) if the edge of the hyperrectangle is on one of the boundaries of the box we imposed at the start.

$\endgroup$
6
  • $\begingroup$ I'll have to take a bit to digest this answer! I'm realizing that a constraint I didn't make explicit enough is that some of these domains are infinite in some dimensions (see $D_3$), which may make the problem of finding a "smallest rectangle" intractable. Or it may not! Does this inform the process at all? $\endgroup$ Commented Jan 27, 2023 at 23:57
  • $\begingroup$ Also, by rectangle, I'm assuming you mean something like an $n$-cube? $\endgroup$ Commented Jan 27, 2023 at 23:58
  • $\begingroup$ Also, does this approach work if any of the domains are degenerate (eg $x_i = \alpha, \alpha \in \mathbb{R}$)? My thought is that it doesn't, but you could equivalently solve the same problem without that dimension and arrive at the same solution. $\endgroup$ Commented Jan 28, 2023 at 0:20
  • 1
    $\begingroup$ I was thinking of the 2-D case, but the method should generalize to any finite number of dimensions (change rectangle to hyperrectangle -- I'm not expecting sides to be equal, so not hypercube). There might be a way to extend it to open-ended domains, but it's a bit tough to visualize. For whatever application you have in mind, can you slap large but finite limits on all the variables, or do you really need them to go to $\pm \infty ?$ $\endgroup$
    – prubin
    Commented Jan 28, 2023 at 4:15
  • $\begingroup$ I'm assuming that the hyperrectangles being added may share a face (or part of a face) with an existing domain as long as the intersection has zero volume. That's in part because strict inequalities are not an option in mathematical programs. Assuming zero volume intersections are OK, a domain where $x_i=\alpha$ would have zero volume and basically would be ignored. $\endgroup$
    – prubin
    Commented Jan 28, 2023 at 4:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.