Need to find solution to best fit the products of the cart within a box from a set of boxes of different sizes

152 views
Skip to first unread message

ishaq ticklye

unread,
Jun 30, 2014, 7:04:27 AM6/30/14
to django...@googlegroups.com

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).

Maik Hoepfel

unread,
Jun 30, 2014, 7:09:36 AM6/30/14
to django...@googlegroups.com
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.

ishaq ticklye

unread,
Jun 30, 2014, 7:15:57 AM6/30/14
to django...@googlegroups.com

Thank you so much Maik.. Seems the link for 3dbinpacking very helpful with the fact that they have apis.

Thanks. :)

Michael Lind Hjulskov

unread,
Jun 30, 2014, 7:15:58 AM6/30/14
to django...@googlegroups.com
Hi
I tried to build something like that in PHP but it takes a lot of simulation and is rather complex.
Also it is only effective if you have 100% valid data entered, and it might take a lot of time to enter/alte that data
I ended up with a solution where I just num_packages=total_weight/max_kg_per_package
its maybe 1 out of 1000 that exceeded the max volume allowed or was impossible to put in same package
I always waited to inform customers how many packages is shipped, until it is shipped.



Med venlig hilsen
Michael Hjulskov

Mobil +45 22116322


--
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.

Maik Hoepfel

unread,
Jun 30, 2014, 11:49:36 AM6/30/14
to django...@googlegroups.com
On 30/06/14 12:15, ishaq ticklye wrote:
>
> Thank you so much Maik.. Seems the link for 3dbinpacking very helpful
> with the fact that they have apis.
>
> Thanks. :)

No worries! Just to be clear, that link isn't a recommendation, I just
picked it off the Wikipedia page to prove my point ;)
> <https://github.com/tangentlabs/django-oscar>
> > http://django-oscar.readthedocs.org/en/latest/
> <http://django-oscar.readthedocs.org/en/latest/>
> > https://twitter.com/django_oscar <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 <javascript:>
> > <mailto:django-oscar...@googlegroups.com <javascript:>>.
> <http://groups.google.com/group/django-oscar>.
> <https://groups.google.com/d/msgid/django-oscar/fc322a99-b280-49b3-b08e-d001f7cced80%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/optout>.
>
> --
> 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/00c87922-63a8-48b4-969d-39431fd63c04%40googlegroups.com
> <https://groups.google.com/d/msgid/django-oscar/00c87922-63a8-48b4-969d-39431fd63c04%40googlegroups.com?utm_medium=email&utm_source=footer>.

Rory S.

unread,
Jun 30, 2014, 10:31:20 PM6/30/14
to django...@googlegroups.com
Take a look at www.solvingmaze.com, they have the most detailed 3d bin packing inputs i have seen. From their api doc "You can use any programming languages to access the API web services using HTTP POST with input and output parameters in JSON format."

Otherwise Postmaster has 3d bin packing within their service (not as detailed as Solvingmaze). They offer their service in Python.

and others i have found along the way:


Rory

ishaq ticklye

unread,
Jul 1, 2014, 4:11:34 AM7/1/14
to django...@googlegroups.com
Hi Rory,

Thanks for your reply, seems helpful. Will dig more into it to fit my requirements. Thanks a lot..

Also, i noticed that you mentioned Postmaster in your reply. Can you tell me what is this Postmaster? Or maybe their URL or any link about it so that i can know more about their services as they are providing it in Python.

Thanks,

Rory S.

unread,
Jul 1, 2014, 8:42:33 AM7/1/14
to django...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages