Packing various data blocks into multiple bins

EDIT: This problem seems to be called a "cutting problem"

I need an algorithm that gives me a (spatial) optimal arrangement of pieces in bins. One way is to put larger pieces first. But look how this algorithm fails in this example:

Chunks        Bins
-----------------------------
AAA BBB CC DD (       ) (   )

Algorithm     Result
-----------------------------
biggest first (AAABBB ) (CC )
optimal       (AAACCDD) (BBB)

"Biggest first" cannot fit in DD. Perhaps this helps to create a table like this:

Size 1: ---
Size 2: CC, DD
Size 3: AAA, BBB

Size 4: CCDD
Size 5: AAACC, AAADD, BBBCC, BBBDD
Size 6: AAABBB

Size 7: AAACCDD, BBBCCDD
Size 8: AAABBBCC, AAABBBDD
Size 10: AAABBBCCDD
+3
source share
4 answers

bin-packing. NP-hard, (.. ).

, / , , , .

: , , (.. ). , "", , , .

:

  • (.. ), , . .

, , , , , :

  • 10-20 , , .
  • ,
+3

Mikera : Knapsack ( ) NP hard.

( ):

+2

(. bin). / googling " bin" , , " " .

+1
source

Donald Knuth Dancing Links Algorithm quickly finds solutions for "accurate coatings."

0
source

Source: https://habr.com/ru/post/1781885/


All Articles