2D computing: fitting shape within bigger shapes efficiently

Joined
Aug 30, 2024
Messages
6
Reaction score
0
Hi, I got a HARD one here.
I have a rectangle of fixed dimensions: 48 x 98.
the user inputs various rectangles. they must be less than 48x98.
these rectangles are to fit inside the 48x98 area.
they can be place vertically (if length is less than 48 only obviously) or horizontally.
if there is no more room, we put in a new rectangle of 48x98 and continue filling remaining pieces.
repeat until no more rectangles left.

my question is, what it the most efficient way to do this, to result in fewest 48x98 rectangles needed??
 
Joined
Aug 30, 2024
Messages
6
Reaction score
0
obviously, the first piece to place would be the longest piece. since it can only be placed along the 98 side (if it is bigger than 48)
from here, if we continue with placing shorter and shorter pieces, we can run into this failure shown in the image.
side lengths of each piece is shown:
 

Attachments

  • placement Algorythm fail.jpg
    placement Algorythm fail.jpg
    82 KB · Views: 9
Joined
Sep 21, 2022
Messages
149
Reaction score
21
Before I start to work on a problem like this, a few things run through my head.

1. Have I already solved this? I should skim my notes.

2. Is this problem "equivalent" to a problem I have already solved?

3. Is this problem "similar" to a problem I have already solved?

4. Is this a well known problem that already has a published solution?

5. How would a human pack rectangles into rectangles?

6. Is this equivalent to a well known (proven) unsolvable problem?

7. If I code a backtracking search (will find all solutions, slowly), would that give me an idea for a more elegant solution? The solutions may have an obvious pattern that can be proven.

8. Is this problem a special case of a more general problem? The general case may be easier to compute.

9. If I work on something similar to this problem, would that give me an idea how to solve this problem?

10. Is this a trick question? Did the person that made this problem, take a simple idea and obfuscate it with geometry?
 
Joined
Aug 30, 2024
Messages
6
Reaction score
0
??
i am posting here asking this very thing. I searched a bit and could find anything. Are you saying this problem is similar to a well known one?
Id love to have any advice and pointed to proper direction. thanks!
 
Joined
Sep 21, 2022
Messages
149
Reaction score
21
The problem you're describing sounds like a packing problem.

There is a wikipedia article called Rectangle packing.

I suspect there is no easy way to find the best method.
 

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

Members online

No members online now.

Forum statistics

Threads
473,880
Messages
2,569,944
Members
46,246
Latest member
RosalieMar

Latest Threads

Top