How to create an optimized packing function in python?

后端 未结 4 1471
独厮守ぢ
独厮守ぢ 2020-12-28 19:36

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 pa

相关标签:
4条回答
  • 2020-12-28 19:45

    This an old question, but just in case somebody stumbles upon this... there is python library called pyshipping that solves this problem:

    https://pypi.python.org/pypi/pyShipping

    0 讨论(0)
  • 2020-12-28 19:48

    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.

    0 讨论(0)
  • 2020-12-28 19:48

    This seems a good problem to which to apply the simplex algorithm or some sort of genetic algorithm. If you never heard of the latter, I highly recommend you to read about them. As I can see from your question, you're doing this enhancement because you like to make things work optimally, and not because you were told to do so. Imagine when you tell them you applied an Artificial Intelligence technique for solving their problem!

    There are many straight-forward algorithms that solve your problem, but this can be a great opportunity to learn some evolutionary computation. Some interesting links about genetic algorithms [everyone, feel free to edit and add]:

    1. These pages introduce some fundamentals of genetic algorithms.
    2. Genetic Algorithms in Plain English

    Luck with that!
    Manuel

    0 讨论(0)
  • 2020-12-28 19:57

    That’s your typical knapsack problem. Many solutions for different languages can be found at Rosetta Code.

    0 讨论(0)
提交回复
热议问题