如何在python中创建优化的3D体积包装功能? [英] How to create an optimized 3D volume-packing function in python?

查看:59
本文介绍了如何在python中创建优化的3D体积包装功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我已获得为网上商店系统创建运输模块的任务.这可能有点过大,但我真的很想创建一个可以弄清楚如何以最优化的方式打包包裹的包裹.通过简单地学习编程就可以了,这是我所不知道的领域!无论如何,我只能简短描述一下实际问题.

So I have been given the task to create a shipping module for a webshop system. It may be a bit overkill, but I would really like to create one that can figure out how to pack parcels in the most optimized way. Having learned programming simply by doing it, this is an area where I have no knowledge - yet! Anyways I can just give short description of the actual problem.

因此,当用户在网上商店购买商品时,他们的购物车中会有x件商品,它们的尺寸和重量可能会有所不同.因此,我想将该功能提供给该产品列表,并让其确定如何将这些产品包装在包裹中.

So when users buy stuff at webshops they will have x products in their cart with possibly varying sizes and weight. So I want to give that list of products to the function and let it figure out how these products should be packed in parcel(s).

  • 最大包裹长度:100
  • 包裹的最大宽度:50
  • 最大包裹高度:50
  • 最大包裹重量:20

每种产品都具有重量,长度,宽度和高度.

Every product has a weight, length, width and height as well.

由于包裹和产品基本上都是盒子,所以我猜这会相当复杂,因为有不同的方式将产品放入包裹中.我的目标不是发挥完美的包装功能,但我想做得比将产品放入包裹中直到达到极限为止更好.

Since parcels and products are basically boxes, I'm guessing this would be rather complex, as there are different ways of putting the products inside the parcel. My goal is not to make the perfect packaging function, but I would like to do something better than just putting products inside the parcel until a limit has been reached.

现在,我不希望你们为我做这个,但是我想问的是三件事.

Now, I don't expect you guys to make this for me, but what I would like to ask is three things.

  1. 在哪里可以找到可以教我所需基础知识的优质在线资源?
  2. 是否有一些本地Python工具会很好用?
  3. 我需要注意的一些指针,陷阱等

就像我说的那样,我不打算做到完美和100%优化,但是我想最终会接近.如果用户认为发送费用会比实际费用高很多,我会感到讨厌.

Like I said, I don't plan for this to be perfect and 100% optimized, but I would like to end up with something that will come close. I would hate if users feel that the sending fee will be a lot higher than it actual is.

推荐答案

您的身高,长度和宽度比一个简单的背包问题要难得多.这是关于 3D背包问题的有趣讨论.

The fact that you have height, length and width makes it harder than a simple knapsack problem. Here's an interesting discussion of a 3D knapsack problem.

这是有关该主题的由相同的人.

Here's a paper on the topic by the same guys.

这篇关于如何在python中创建优化的3D体积包装功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆