Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A company receives orders to deliver its good to three differ cities as follows:

ID: 3814601 • Letter: A

Question


A company receives orders to deliver its good to three differ cities as follows: where the quantity of the order is in truckloads. The company has sufficient stock in its warehouses and a truckload of goods can be delivered from any warehouse to any city. However, there are a limited number of trucks available at each warehouse Warehouse The variable costs (in Rands) per truckload to deliver goods from each warehouse to each destination are What is the cheapest delivery schedule and what is its cost?

Explanation / Answer

NOTE you didin't gave data for variable cost of transportation from Q to other cities. You only gave for P, R. I am using some dummy values for now.

% North west corner rule
x= [[6000 5000 6000 22]
    [1000 7000 5500 21] % Modify first three elements of this row as per your data
    [9000 8500 8000 25]
    [17     31    26     0 ]];
  
[m n]=size(x);
x1=zeros(m,n);

totalDemand=0;
totalSupply=0;

% Total Demand
for i=1:m-1
    totalDemand=totalDemand+x(i,n);
end

% Total Supply
for j=1:n-1
    totalSupply=totalSupply+x(m,j);
end

% Northwest algorithm
if(totalSupply >= totalDemand)
    for i=1:m
        for j=1:n
            x11=min(x(i,n),x(m,j));
            x1(i,j)=x11;
            x(i,n)=x(i,n)-x11;
            x(m,j)=x(m,j)-x11;
        end
    end
else
    disp('insufficient supply');
end

totalCost=0;
for i=1:m-1
   for j=1:n-1
       totalCost=totalCost+(x(i,j).*x1(i,j));       
   end
end
disp(['Total cost of transportation is ',num2str(totalCost)]);

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote