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
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.