Question 1106875
make a cost matrix like the one shown below:

<pre>
                           warehouse 1       warehouse 2

     customer A               11                15
     customer B               12                13

</pre>


the maximum number of speakers from warehouse 1 is 9.
the maximum number of speakers from warehouse 2 is 5.


it's clear from this matrix that the minimum cost to ship to customer A is from warehouse 1.


since customer A requires 7 and warehouse 1 has 9, then ship all stereos to customer A from warehouse 1.


since the cost to ship to customer B is cheaper from warehouse 1, then ship the remaining 2 that warehouse 1 has to customer B.


the remaining 4 that customer B requires is then shipped from warehouse 2.


your total cost will be:


7 from warehouse 1 to customer A = 77 
2 from warehouse 1 to customer A = 24
4 from warehouse 2 to customer B = 52


total cost is 153.


the cheapest cost to ship is 153.


i then double checked to see if my logic was correct.


i used excel solver.


excel confirmed that my logic was correct.


it came up with the same minimum cost.


the variables that i used were:


xa = amount shipped from warehouse 1 to customer a.
xb = amount shipped from warehouse 1 to customer b.
ya = amount shipped from warehouse 2 to customer a.
yb = amount shipped from warehouse 2 to customer b.


the objective function which i wanted to minimize was:


xa * 11 + xb * 12 + ya * 15 + yb * 13


this objective function represented the total cost of shipping.


my constraints were:


xa + ya = 7 because customer a required 7 speakers.
xb + yb = 6 because customer b required 6 speakers.


xa + xb <= 9 because warehouse 1 could ship a maximum of 9 speakers.
ya + yb <= 5 because warehouse 2 could ship a maximum of 5 speakers.


here's a picture of my excel spreadsheet.


<img src = "http://theo.x10hosting.com/2018/012001.jpg" alt="$$$">