Algorithm to Minimize Number of Shipments from Multiple Warehouses

前端 未结 5 1773
伪装坚强ぢ
伪装坚强ぢ 2021-02-10 13:04

I have 10 warehouses across the US. Each of them may or may not have product A, B, C, D, E in stock. Someone orders all five items from my website.

I want to minimize th

5条回答
  •  你的背包
    2021-02-10 13:53

    Well, what I could think of on top of my head is that you need 2 matrices. first one will have columns as the place of your warehouse and rows will be products A,B,C..ect. Like for the given case it will be a 5X3 matrix. Another matrix will contain the distance vectors from your warehouse to the destination. Like columns could be your warehouse place - New York, Chicago, etc and rows could be the places where you want to ship. Now to figure out which warehouse will send which product should be the outcome of the minimum distance from 2nd matrix and maximum products available from the first matrix. there are definitely some method to get it from two matrix , you just need to search and do some maths.

提交回复
热议问题