I have a lot of cuboids in 3D space, each has a starting point at (x,y,z) and has size of (Lx,Ly,Lz). I wonder how to find a largest cube in this 3D space that is contained in the union of the cuboids. Is there an efficient algorithm for this?
For instance, If I have the following cuboids:
- a cuboid starting at (0,0,0) with size (10,10,10),
- a cuboid at (10,0,0) with size (12,13,15),
- a cuboid at (0,10,0) with size (10,10,10),
- a cuboid at (0,0,10) with size (10,10,10), and
- a cuboid at (10,10,10) with size (9,9,9).
Then, the largest cube contained in the union of these cuboids will be a cube starting at (0,0,0) with size (19,19,19).
A more general version of this question:
Given a collection of $n$ boxes in $\mathbb{R}^d$, find the largest hypercube contained within the union of the boxes.