totuk2 / packer

based on 3dbinpack
MIT License
1 stars 1 forks source link

Possible optimization's for Bin Packing #26

Open vorasmit opened 11 months ago

vorasmit commented 11 months ago

Items are packed as it is, without trying to rotate items for a better fit. Where rotation is allowed and bulk item quantities are there, permutations could be reduced just by rotating all items at once.

There is huge cost of shipping associated with inefficient packing

eg: Efficiency of 70.9% and 12.5% is received for the following case with two boxes.

items = create_items(
        {
            "item1": {
                "name": "euro_pallet",
                "quantity": 40,
                "width": 5,
                "hight": 3.94,
                "depth": 2.625,
                "weight": 40,
            }
        }
    )
    bins = create_bins(
        {
            "container1": {
                "name": "40_ft_container",
                "width": 40,
                "hight": 7.75,
                "depth": 8,
                "max_weight": 20000,
            }
        }
    )
    best_bins = get_best_bins(items, bins)
    print([bin.efficacy for bin in best_bins])

eg: Efficiency of 83.5% is received for the following case with one box just by switching width and height.

items = create_items(
        {
            "item1": {
                "name": "euro_pallet",
                "quantity": 40,
                "width": 3.94,
                "hight": 5,
                "depth": 2.625,
                "weight": 40,
            }
        }
    )
    bins = create_bins(
        {
            "container1": {
                "name": "40_ft_container",
                "width": 40,
                "hight": 7.75,
                "depth": 8,
                "max_weight": 20000,
            }
        }
    )
    best_bins = get_best_bins(items, bins)
    print([bin.efficacy for bin in best_bins])