need idea/algorithm

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi all,
I have a programming problem and am not sure what's the best way to come to
a solution.

Problem:
I want to know how many blocks fit into a box. The blocks are all the same
size, but are not cubes. So you can put them upstraight or lay down. Or
start a layer upstraight and then a layer layed down. Any number of
possibilities.

Does anyone have a good idea on attacking this problem?

There are only 6 ways to turn a block, so maybe some recursive routine is a
possibility.

Another problem is how to store and show the solution, but that is of later
concern.

Thanks in advance

Frank
 
Well,

I have a similar type of question being asked of me, but haven't started to
work on it.

My am leaning toward using cubic addition to determine how many blocks will
fit in the box, but that is not good enough as length and width need to be
considered.

Now as far as how to present the finished solution. That sounds like a job
for GDI+ or some 3D engine to display the final render.

Best of luck,

Chris
 
Hi Frank

This is generically known as the 'knapsack problem'. If you search (Google)
on that and 'algorithm' you may find some useful links.

HTH

Charles
 
Thanks, I knew there must be a name for it. Now I know what to search for.
Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top