Il faudrait clairement creuser plus, en test rapide j'arrive à 3 containers (sans superposition) :
Si on accepte de superposer (avec une hauteur plus importante mais pas délirante non plus = 5000), tout rentre bien sûr dans un seul container :
Avec bien sûr les données fournies en entrées (et une des librairies trouvées sur github, la première en java) :
final List<StackableItem> products = new ArrayList<StackableItem>();
products.add(new StackableItem(Box.newBuilder().withId("Item 1").withConstraint(constraintBoxes).withRotate2D().withSize(5100, 2300, 1800).withWeight(1500).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 2").withConstraint(constraintBoxes).withRotate2D().withSize(1450, 850, 1500).withWeight(400).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 3").withConstraint(constraintBoxes).withRotate2D().withSize(1250, 1250, 1500).withWeight(100).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 4").withConstraint(constraintBoxes).withRotate2D().withSize(1100, 900, 1600).withWeight(200).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 5").withConstraint(constraintBoxes).withRotate2D().withSize(600, 600, 1200).withWeight(150).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 6").withConstraint(constraintBoxes).withRotate2D().withSize(400, 400, 600).withWeight(100).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 7").withConstraint(constraintBoxes).withRotate2D().withSize(2200, 1700, 1400).withWeight(600).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 8").withConstraint(constraintBoxes).withRotate2D().withSize(8100, 2300, 2400).withWeight(8000).build(), 1));
products.add(new StackableItem(Box.newBuilder().withId("Item 9").withConstraint(constraintBoxes).withRotate2D().withSize(10500, 2300, 2400).withWeight(9000).build(), 1));
(clairement je ne suis pas au bout de l'optimisation sur ce test préliminaire)
(le poids par container n'est pas considéré non plus ici)
(le rendu 3D est navigable à la souris en local, pas sûr que ce soit très lisible en screenshots)