In the cartesian plane consider rectangles with sides parallel to the coordinate axes. We say that one rectangle is below another rectangle if there is a line $g$ parallel to the $x$-axis such that the first rectangle is below $g$, the second one above $g$ and both rectangles do not touch $g$. Similarly, we say that one rectangle is to the right of another rectangle if there is a line $h$ parallel to the $y$-axis such that the first rectangle is to the right of $h$, the second one to the left of $h$ and both rectangles do not touch $h$. Show that any finite set of $n$ pairwise disjoint rectangles with sides parallel to the coordinate axes can be enumerated as a sequence $(R_1,\dots,R_n)$ so that for all indices $i,j$ with $1 \le i<j \le n$ the rectangle $R_i$ is to the right of or below the rectangle $R_j$
Problem
Source: Germany 2019, Problem 3
Tags: geometry, rectangle, combinatorics, analytic geometry
20.06.2019 13:51
Create a graph $G$ with $n$ vertices, and an edge from $v_i$ to $v_j$ iff $R_i$ is left AND up of $R_j$. $G$ is clearly acyclic, hence it can be topologically ordered; any topological order provides a valid enumeration.
30.06.2019 06:09
@above I think you probably misread. The "to the right of" condition is actually rather strong, much stronger than you seem to be assuming. However, you are indeed correct that $G$ is acyclic, but it is not clear at all. Whoops, the following solution solves the problem for "to the left of" and "below" rather than "to the right of." Let's start by defining a lot of notation. We will say that a rectangle $R$ eats another rectangle $S$ if $R$ is strictly to the left of $S$ or $R$ is strictly below $S$. We wish to show that we can label the rectangles $R_1, R_2, \cdots, R_n$ so that $R_i$ eats $R_j$ for all $i < j.$ We will say that a rectangle $R$ clogs another rectangle $S$ if $S$ does not eat $R$. For a rectangle $R$, let $f(R)$ be the coordinates of the lower-left corner of $R$. Let $x(R)$ be the $x-$coordinate of $f(R)$ and $y(R)$ be the $y-$coordinate. Define the pool of a rectangle $R$ to be the set of all points $(x, y)$ which are neither strictly to the right of $R$ nor strictly above $R$. For instance, a rectangle with upper-right corner $(2, 3)$ has its pool as the region determined by $x \le 2$, $y \le 3.$ Say that a rectangle $R$ engulfs another rectangle $S$ if $f(R)$ has both its $x-, y-$coordinates at least as large as those of $f(S).$ Observe that if $S$ clogs $R$, and $S$ engulfs $T$, then $T$ also clogs $R$. $\qquad (1)$ As Kayak did, consider the digraph $G$ on the $n$ rectangles where we direct the edge from rectangle $b$ to rectangle $a$ if rectangle $a$ clogs rectangle $b$. We will show that $G$ is acyclic, from which the conclusion readily follows by taking the reverse of a DAG ordering of $G$. Note that $R \rightarrow S$ in $G$ if and only if $S$ touches some part of the pool of $R$ (incl. boundary). We are now prepared to show that $G$ is acyclic. Assume the contrary for contradiction. Then, consider the minimal cycle $R_1 \rightarrow R_2 \rightarrow \cdots \rightarrow R_k \rightarrow R_1$ of $G$. Observation 1. $R_i$ cannot engulf $R_j$, for any $i \neq j$. Proof. Firstly, we clearly cannot have that $i = j+1$. Hence, we then have from $(1)$ that $R_j \rightarrow R_{j+1} \rightarrow \cdots \rightarrow R_{i-1} \rightarrow R_j$ is a smaller cycle, contradiction. $\blacksquare$ By the Observation, we either have $x(R_2) > x(R_1)$ and $y(R_2) < y(R_1)$ or $x(R_2) < x(R_1)$ and $y(R_2) > y(R_1).$ By symmetry, WLOG that the latter is true. Now, since $R_2 \rightarrow R_3$ we know that $R_3$ touches the pool of $R_2$. Again, we have that either $x(R_3) > x(R_2)$ and $y(R_3) < y(R_2)$ or $x(R_3) < x(R_2)$ and $y(R_3) > y(R_2).$ If the former was true, then we'd have that $R_1$ engulfs $R_3$, contradiction. Hence, the former must be true. Proceeding in this manner, we obtain that $x(R_{k+1}) < x(R_k)$ and $y(R_{k+1}) > y(R_k)$ for each $k$. This is a clear contradiction, since there must exist some $k$ for which $x(R_{k+1}) > x(R_k).$ Hence, we've shown that $G$ is acyclic, and hence we're done. $\square$ Remark. This solution requires diagrams to understand.
27.05.2023 13:58
Redacted Proof
27.05.2023 19:20
minusonetwelth wrote: The problem now asks us to find a Hamiltonian path, which is well-known to exist. The problem is that this is not what the problem asks us. Note that the condition should hold for all pairs of indices, not only for successive ones.
08.06.2023 12:40
Tintarn wrote: minusonetwelth wrote: The problem now asks us to find a Hamiltonian path, which is well-known to exist. The problem is that this is not what the problem asks us. Note that the condition should hold for all pairs of indices, not only for successive ones. But isn't this true anyway because my construction is transitive? If it holds for vertices $i-1$ and $i$, and $i$ and $i+1$, then it holds for $i-1$ and $i+1$ as well, doesn't it?
15.06.2023 09:52
Um, no, absolutely not. The problem is that your edge condition has "or" in it. So if $R_{i+1}$ is below $R_i$ and $R_{i+2}$ is to the right of $R_{i+1}$, there is no reason why $R_{i+2}$ should be to the right or below $R_i$ (and indeed it is easy to draw a counterexample to this claim).