1

I'm looking for a technique or algorithm that can help with a design idea. Keep in mind that my proposed solution is open for modification, as well.
I have a series of blocks (square and rectangular) that fit into a grid. The grid and the pieces are unique in that some blocks can fit into multiple locations and others can fit only into a limited number of locations. If it helps, think of something like "Battleship" where the pieces have unique connectors which limits their placement.
I imagine this as a multi-dimensional array. Using a sort of collision or storage contention technique I would like to devise the series of solutions where all pieces are able to fit. An optimal solution would be the one which allows the most pieces to fit on the board at any one time. I have considered Interval Scheduling, a variety of 2D collision detection algorithms, and looked into graph theory (e.g. Flow Network). These all seem to be overkill for the design.
I don't have specific terminology for what I am looking for so searching for a solution is difficult. If I have to brute force this then, OK, but I have to believe there is a more elegant solution.

McArthey
  • 1,614
  • 30
  • 62
  • possible duplicate of [How can I programmatically determine how to fit smaller boxes into a larger package?](http://stackoverflow.com/questions/140406/how-can-i-programmatically-determine-how-to-fit-smaller-boxes-into-a-larger-pack) – John Dvorak May 08 '14 at 14:28
  • Interesting question but the constraints I have would mean that the boxes can only be placed in specific locations (e.g. heaviest at the bottom). Additionally I am working in a 2D space. I will read for further inspiration. Thanks. – McArthey May 08 '14 at 14:35
  • 1
    Then I'm afraid it's unclear to me what exactly you want. Can you provide a graphical example? – John Dvorak May 08 '14 at 14:53

0 Answers0