Python Forum
2D Bin packing - brute force in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2D Bin packing - brute force in python
#1
Hi everyone,

Does anybody has written in python an optimized solution for brute forcing 2D-BIN packing ?

For instance I have a number of rectangles like 12x54 ; 10x14 ; 58x35 ; 50x50 , etc. And a standard size of bin of 100x100 And i would like to try all combination possibles in order to select the best fit (when we have max remaining place). We can rotate the rectangle by 90°.And if the bin is full, we can put it in another bin.

I have already found and tried plenty of algorithms (like MaxRect, Guillotine, etc). But sometimes the human find better packing than these aglso. so I'll try to see what it cost to brute force.

I am aware that I might be long and hard for my machine to calculate but I want to try.

In order to make sure I understand well, for instance the number of possibilities for my example upper would be 4x2(rotate of 90°)x7x6x5x4x3x2x1 ) = 40320 ?

Thank you in advance for helping me.
Reply
#2
How do you define the remaining place? (the objective function)
Reply
#3
Hi,

The red rectangle is the remaining space.

[Image: None-13600x2400-1.png]
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020