Hi Ishaq,
that's a classic example of the bin packing problem:
https://en.wikipedia.org/wiki/Bin_packing_problem
It's not an easy problem to solve. There's even people specialising in
solving it:
http://www.3dbinpacking.com/
... good luck! :)
- Maik
On 30/06/14 12:04, ishaq ticklye wrote:
>
> We need to find a solution on how to best fit the products of the cart
> within one box from a set of boxes of different sizes without wastage of
> space.
>
> We have 5 types of boxes, you can say as small, medium, large, extra
> large & trunk (for example). Now we need to find a solution such that as
> per the products (which are of different sizes & volumes) in the
> cart/order, one of these 5 boxes are chosen with the fact that all items
> fit in the box & also without any wastage of space. So basically we need
> to know a method or solution for best & optimum fitting the of the
> products in the box.
>
> Sometimes it may happen that the largest box is not able to fit the
> products that are there in the cart. This is because the contents of the
> cart are too many. Hence in this case, the largest box must be taken to
> fit the most number of products & then the remaining products must be
> fit within the best fit box.
>
> This is the explanation -
>
> As per our shipping company, the shipping Rates will be calculated based
> on either volumetric weight or weight per products. Which ever of these
> 2 is higher will be taken into consideration.
>
> *Volume calculation* : Length X Height X width
>
>
> Note: Add 1⁄2 cm to the length, width & height of each product before
> calculating the volume. The purpose of the addition of 1⁄2 cm is for
> protective material that will be placed around each item
>
>
> *Weight* = Weight of each product
>
> *Products Volume* = (Volume of Item 1 + Volume of Item 2 + Volume of
> Item 3 + ...)
> *Products Total Weight* = (Weight of item 1+ Weight of item 2 + Weight
> of item 3 + ...)
>
> For packaging purpose we will have fixed sized 5 boxes which will be the
> actual volume considered. Volumetric weight of the selected box will be
> passed to shipping company for getting the shipping rate.
>
> Box 1, Box 2, Box 3, Box 4, Box 5
> The box to be considered for packaging will be selected and calculated
> based on the below:
>
> *Volume* : Box 1 volume - Total Products Volume. If this formula results
> in a negative value then other boxes to be tried in sequence until its
> results in a positive value. The box which results a positive value, its
> volume will be considered.
>
> Calculation to be done in such a way that items can be placed either
> vertically or horizontally to ensure the most economical shipping
> charges to customers.
>
> If the volume of the box is higher than the actual weight than pass the
> volume weight otherwise just pass the actual weight.
>
> _Points to be taken care of_:
>
> The situation is that we have a number of "Boxes" of varying sizes
> (these are boxes that we have on hand to ship orders in, we may have
> about 5 different sizes). When someone makes an order they will have a
> number of products, the "boxes" need to contain the items with the least
> amount of wasted space.
>
> Volume calculations doesn't seem to be practical because it doesn't take
> into account the size of the box relative to the item (a golf club's
> volume is about the size of a jewelry box), so in addition to the volume
> we have to check that the items can fit into the box.
>
> So, we have to think in away that:
>
> 1. The items can fit in the box.
> 2. The items can be placed either vertically or horizontally to ensure
> the most economical shipping charges to our customers (Not much wasted
> area in the carton).
>
> --
>
https://github.com/tangentlabs/django-oscar
>
http://django-oscar.readthedocs.org/en/latest/
>
https://twitter.com/django_oscar
> ---
> You received this message because you are subscribed to the Google
> Groups "django-oscar" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
django-oscar...@googlegroups.com
> <mailto:
django-oscar...@googlegroups.com>.
> Visit this group at
http://groups.google.com/group/django-oscar.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/django-oscar/fc322a99-b280-49b3-b08e-d001f7cced80%40googlegroups.com
> <
https://groups.google.com/d/msgid/django-oscar/fc322a99-b280-49b3-b08e-d001f7cced80%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit
https://groups.google.com/d/optout.