Example: For $r=2$ and $n = 4$ The examples below, the following combination (givengiven by the pictures of $4$ parallel slices), satisfies the two above assumptions.
$\substack{
\displaystyle{◻◻◼◼} \cr
\displaystyle{◼◼◻◻} \cr
\displaystyle{◼◻◼◻} \cr
\displaystyle{◻◼◻◼}
} $
$\substack{
\displaystyle{◻ ◼ ◼ ◻} \cr
\displaystyle{◼ ◻ ◼ ◻} \cr
\displaystyle{◻ ◼ ◻ ◼} \cr
\displaystyle{◼ ◻ ◻ ◼}
} $
$\substack{
\displaystyle{◼ ◻ ◻ ◼} \cr
\displaystyle{◻ ◻ ◼ ◼} \cr
\displaystyle{◼ ◼ ◻ ◻} \cr
\displaystyle{◻ ◼ ◼ ◻}
} $
$\substack{
\displaystyle{◼ ◼ ◻ ◻} \cr
\displaystyle{◻ ◼ ◻ ◼} \cr
\displaystyle{◻ ◻ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼ ◻}
} $ For $r=2$ and $n = 3$:
$\substack{
\displaystyle{◻ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼} \cr
\displaystyle{◼ ◼ ◻}
} $ $\substack{
\displaystyle{◼ ◼ ◻} \cr
\displaystyle{◻ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼}
} $ $\substack{
\displaystyle{◼ ◻ ◼} \cr
\displaystyle{◼ ◼ ◻} \cr
\displaystyle{◻ ◼ ◼}
} $
For $r=3$ and $n = 4$:
$\substack{
\displaystyle{◻ ◼ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼ ◼} \cr
\displaystyle{◼ ◼ ◻ ◼} \cr
\displaystyle{◼ ◼ ◼ ◻}
} $ $\substack{
\displaystyle{◼ ◼ ◼ ◻} \cr
\displaystyle{◻ ◼ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼ ◼} \cr
\displaystyle{◼ ◼ ◻ ◼}
} $ $\substack{
\displaystyle{◼ ◼ ◻ ◼} \cr
\displaystyle{◼ ◼ ◼ ◻} \cr
\displaystyle{◻ ◼ ◼ ◼} \cr
\displaystyle{◼ ◻ ◼ ◼}
} $ $\substack{
\displaystyle{◼ ◻ ◼ ◼} \cr
\displaystyle{◼ ◼ ◻ ◼} \cr
\displaystyle{◼ ◼ ◼ ◻} \cr
\displaystyle{◻ ◼ ◼ ◼}
} $
An ordering $b_1, b_2, \dots, b_{rn^2}$ of $B$ is Eulerian if for all $i>1$ and for all $j<i$, there is $k<i$ such that $b_i$ and $b_k$ are in a same line $l$, and if $b_i$ and $b_j$ are in a same slice $s$, then $l \subset s$.
Note that theThe notion of Eulerian ordering is related to the notion of shelling, as explained in this post.
Remark: If $r=n$ then the grid contains black boxes only and the lexicographic ordering is Eulerian.
Question: Has $B$ (satisfying the two above assumptions) an Eulerian ordering if
If $r \ge 3$?
Remark$r=n-1$ then both cases are possible: The
The above combination (with $r=2$ andexample with $n = 4$) admits$(r,n) = (2,3)$ has no Eulerian ordering (proved below, as shown by brute brute-force search; a conceptual proof would be useful). Note thatsearch below, and any partial Eulerian ordering of it has length at most $11$, see an$8$:
The above example belowwith $(r,n) = (3,4)$ has an Eulerian ordering:
Note thatQuestion: Do the black box marked "?" cannot be added because it shares a slice withtwo above assumptions imply the black box n°7 whereas there is no marked black box in this slice which shares a line with "?"existence of an Eulerian ordering if (idem for every unmarked black box).$r \ge 3$?
sage: %attach SAGE/EulerianGrid.spyx
Compiling ./SAGE/EulerianGrid.spyx...
sage: B=[[1S=[[1,1,2]1],[1,1,4]2],[1,2,1],[1,2,3],[1,3,1],[1,3,2],[1,43,3],[1,4,4],[2,1,1],[2,1,4]3],[2,2,2],[2,2,4]3],[2,3,1],[2,3,3],[2,4,2],[2,4,3],[3,1,2],[3,1,3],[3,2,1],[3,2,2],[3,3,3],[3,3,4],[3,4,1],[3,4,4],[4,1,1],[4,1,3],[4,2,3],[4,2,4],[4,3,2],[4,3,4],[4,4,1],[4,4,2]]3]]
sage: %time PartialOrdering(BS,[],118)
CPU times: user 55min10.4 s, sys: 3.4915 sms, total: 55min10.4 4ss
Wall time: 56min10.5 52ss