Warm tip: This article is reproduced from stackoverflow.com, please click
algorithm graph-algorithm knapsack-problem traveling-salesman

Algorithm for picking orders from warehouses

发布于 2020-05-27 13:51:02

I'll explain My Problem With an example.

Let's say we have:

  • An Order from a certain store for five products, We will name those products A,B,C,D, & E, with their quantities In the Order A(19),B(25),C(6),D(33),E(40).

  • A single Truck that can fit different amount of each product:
    A(30), B(40), C(25), D(50), E(30).

Ex: Transporting A & B together, I loaded the the Truck with A(19) so that's two thirds of what my Truck can handle, So that leaves one third for B, Which means i can only transport 1/3 of B's maximum Truck capacity which is (40/3 ≈ 13).

  • A Set of Warehouses which contains different amounts of each product.

I made an Excel spreadsheet which contains more useful info regarding those Warehouses like( Quantities, Distance from Each other, Distance from store ).

I want to Deliver this order to the store with the least amount of trips and distance traveled.

Is there an Algorithm for this kind of problem, Or something close i can modify on?

EDIT: Updated Links.

Questioner
Makdous
Viewed
30
CaptainTrunky 2020-05-07 14:18

I would advise not to reinvent a wheel as a very first step of your work. Developing/adopting a custom algorithm for such a problem would be a very painful venture in my opinion. I would suggest using either a constraint satisfaction programming (CSP) toolkit or a direct mixed integer programming (MIP) solver.

My point is that it would be much easier to encode your problem using such tools. If performance/accuracy won't be enough for you - you could design a custom solution based on your preliminary results.

For CSP I would suggest Minizinc which has decent documentation and examples.

You could start your MIP research with GLPK. It's not very powerful, but it's definitely capable of dealing with some toy examples.