如何在Python中创建一个优化的包装功能? [英] How to create an optimized packing function in python?

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

问题描述

所以,我一直在考虑建立一个船模的网上商店系统的任务。这可能有点矫枉过正,但我​​真的想创造一个能弄清楚如何收拾包裹在最优化的方式。有学过编程简单地做,这是一个领域,我不知道 - 但!反正我可以只给实际问题的简短描述。

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产品的购物车中有可能不同大小和重量。所以我想给产品的功能列表,并让它弄清楚如何将这些产品应在包裹(S)进行包装。

So when users by 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 is 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.

下面是一个<一href="http://books.google.com/books?id=mhrOkx-xyJIC&lpg=PA34&ots=1XEOcysErv&pg=PA34">paper由同一人的话题。

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

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