1

Summary of problem:

We need to keep track of inventory of solid three dimensional rectangles (I believe these are called cuboids but I stand to be corrected).

Each cuboid arrives with a fixed length, breadth, and depth. Let's say it's 20x5x5 for argument's sake. So to begin, we have 10 of these 20x5x5 cuboids in stock.

Then during the course of business, smaller / secondary cuboids of variable dimensions are cut out from these bigger / primary cuboids.

Summary of question:

A) What data structure would be best to track stock of primary cuboid stock availability.

B) What algorithm(s) would be best to determine whether a primary cuboid can cater for a secondary cuboid cut out?

Additional details and issues:

The first cut from a primary cuboid is very easy to calculate / determine. The problem comes into hand with the second, third, and so on cuts, since we need to track the resulting dimensions of all edges and vertices of the primary cuboid remaining in stock.

If more than one primary cuboid meets the requirements for the secondary cuboid, the smallest primary cuboid is preferable so as to cater for FIFO depletion of stock. So we would need to calculate the remaining volume of all matching primary cuboids to determine which is the smallest one.

This gets tricky because once a secondary cuboid has been cut out from a primary cuboid, the primary cuboid's new variable dimensions need to be tracked (all edges and vertices). Thus we will need to keep track of the points on the primary cuboid that the secondary cuboid was cut out of (as well as the resulting shape).

So it's both a volume problem and a "does this piece fit in that piece" problem.

I should add that cuboids are measured and cut to millimetre precision (in case this has any implications for the data structure).

Kosta Kontos
  • 4,152
  • 7
  • 25
  • 28
  • It is a cuboid. More correctly, it's a rectangular cuboid (among other names). See http://en.wikipedia.org/wiki/Cuboid – Jim Mischel Apr 27 '15 at 16:48

1 Answers1

1

I have an incomplete answer for you, but it might be helpful:

First of all, here is a similar question, only in 2D.
Looking through one of the answers, someone mentioned the ARC project. From a glance, it seems that the idea there discussed in 2D could (maybe) be applied to your issue in 3D.

I would think the applying any idea from the AC project, with a constraint of it being applied to all 3 dimensions might work.

In any case, I think this is a case of balancing between the complexity of the DS and the time it will take to calculate whether or not each cuboid can be cut for the next piece required...

Community
  • 1
  • 1
shapiro yaacov
  • 2,308
  • 2
  • 26
  • 39