List the largest possible cuboids inside a 16x16x16 matrix

91
August 01, 2019, at 05:20 AM

I have a 16x16x16 cubic matrix containing [0;k] possible values I would like to be able to list the largest possible cuboids inside that matrix where every value is the same for this cuboid.

An iterative "expansion" algorithm could do the trick, but given there are 4096 cells, that would be way to expensive to do.

There are similar questions, but they only address a two-dimensional matrix

Answer 1

I expect that by "cuboid", you mean that it must be the same size in all 3 dimensions.

In that case, the size of the largest cuboid with maximal point (x,y,z) can be calculated from the sizes of the largest cuboids with maximal points (x-1,y,z), (x,y-1,z), (x,y,z-1), (x-1,y-1,z), (x-1,y,z-1), (x,y-1,z-1), and (x-1, y-1, z-1).

Just process the points in sum(x,y,z) order, and then, if all those neighboring points have the same value, then largest_cuboid_size(x,y,z) = 1 + min(largest_cuboid_size(..for each neighbor with a smaller coordinate...))

READ ALSO
How to handle user corrections during intent confirmation?

How to handle user corrections during intent confirmation?

We collect some user input during a dialogAt the end, we ask the user for confirmation: "Do you want to start XYZ with the parameters x, y and z?"

119
Processing Program not running on runnable JAR

Processing Program not running on runnable JAR

I have a GUI program that I wrote in Eclipse that uses Processing codeThe processing code executes in Eclipse with the jssc

91
@PropertyId annotation “is disallowed for this location”

@PropertyId annotation “is disallowed for this location”

I got this error and just can't seem to find how to get it workingMy code, simply following some Vaadin10+ exercises:

109
Auto Complete in elastic search

Auto Complete in elastic search

I have to implement autocomplete functionalityI am new in es

107