Skip to content

Commit 7079463

Browse files
Merge pull request #550 from Quantum-Software-Development/FabianaCampanari-patch-1
Add files via upload
2 parents c06dcf4 + ee7364b commit 7079463

File tree

1 file changed

+212
-0
lines changed

1 file changed

+212
-0
lines changed
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
# Transportation Problem Solution in Excel (Markdown + LaTeX for README.md)
2+
3+
This guide explains, step by step, how to solve the given transportation problem in Excel using the Solver add-in. It includes all necessary formulas and tables in Markdown and LaTeX, with ready-to-copy Excel formulas.
4+
5+
6+
**You can now copy the formulas above and use them directly in your Excel sheet. The step-by-step process will allow you to model and solve any similar transportation problem using Excel Solver.**
7+
8+
---
9+
10+
## **Problem Statement**
11+
12+
Given the following transportation cost matrix, supply, and demand:
13+
14+
15+
| | Consumer 1 | Consumer 2 | Consumer 3 | Supply |
16+
| :-- | :--: | :--: | :--: | :--: |
17+
| Supplier 1 | 12 | 22 | 30 | 100 |
18+
| Supplier 2 | 18 | 24 | 32 | 140 |
19+
| Supplier 3 | 22 | 15 | 34 | 160 |
20+
| **Demand** | 120 | 130 | 150 | |
21+
22+
**Objective:**
23+
Minimize the total transportation cost.
24+
25+
---
26+
27+
## **Mathematical Formulation (LaTeX)**
28+
29+
Let \$ x_{ij} \$ be the number of units shipped from supplier \$ i \$ to consumer \$ j \$.
30+
31+
**Minimize:**
32+
33+
$$
34+
Z = \sum_{i=1}^{3} \sum_{j=1}^{3} c_{ij} x_{ij}
35+
$$
36+
37+
**Subject to:**
38+
39+
$$
40+
\sum_{j=1}^{3} x_{ij} = \text{Supply}_i \quad \forall i = 1,2,3
41+
$$
42+
43+
$$
44+
\sum_{i=1}^{3} x_{ij} = \text{Demand}_j \quad \forall j = 1,2,3
45+
$$
46+
47+
$$
48+
x_{ij} \geq 0 \quad \forall i, j
49+
$$
50+
51+
---
52+
53+
## **Step-by-Step Solution in Excel**
54+
55+
### **1. Data Layout**
56+
57+
| | B | C | D | E | F |
58+
| :-- | :-- | :-- | :-- | :-- | :-- |
59+
| | Cons1 | Cons2 | Cons3 | Supply | |
60+
| Sup1 | 12 | 22 | 30 | 100 | |
61+
| Sup2 | 18 | 24 | 32 | 140 | |
62+
| Sup3 | 22 | 15 | 34 | 160 | |
63+
| Demand | 120 | 130 | 150 | | |
64+
65+
### **2. Decision Variables Table**
66+
67+
Below the cost table, create a table for the shipment variables (\$ x_{ij} \$), e.g., in cells B7:D9.
68+
69+
70+
| | Cons1 | Cons2 | Cons3 |
71+
| :-- | :-- | :-- | :-- |
72+
| Sup1 | x11 | x12 | x13 |
73+
| Sup2 | x21 | x22 | x23 |
74+
| Sup3 | x31 | x32 | x33 |
75+
76+
**In Excel:**
77+
Enter `0` in each cell as the initial value.
78+
79+
### **3. Total Cost Formula**
80+
81+
Below the variable table, calculate the total cost using `SUMPRODUCT`:
82+
83+
```excel
84+
=SUMPRODUCT(B2:D4, B7:D9)
85+
```
86+
87+
- `B2:D4` is the cost matrix.
88+
- `B7:D9` is the variable matrix.
89+
90+
91+
### **4. Supply Constraints**
92+
93+
For each supplier, sum the variables in the row and set equal to the supply.
94+
95+
96+
| | Formula (Excel) |
97+
| :-- | :-- |
98+
| Sup1 | =SUM(B7:D7) |
99+
| Sup2 | =SUM(B8:D8) |
100+
| Sup3 | =SUM(B9:D9) |
101+
102+
### **5. Demand Constraints**
103+
104+
For each consumer, sum the variables in the column and set equal to the demand.
105+
106+
107+
| | Formula (Excel) |
108+
| :-- | :-- |
109+
| Cons1 | =SUM(B7:B9) |
110+
| Cons2 | =SUM(C7:C9) |
111+
| Cons3 | =SUM(D7:D9) |
112+
113+
### **6. Setting Up Solver**
114+
115+
- **Set Objective:** The total cost cell (e.g., `B12`) - set to Min.
116+
- **By Changing Variable Cells:** The shipment variables (`B7:D9`).
117+
- **Subject to Constraints:**
118+
- Each row sum equals the corresponding supply.
119+
- Each column sum equals the corresponding demand.
120+
- All variables \$ \geq 0 \$.
121+
122+
123+
#### **Solver Constraints (in Excel)**
124+
125+
- `SUM(B7:D7) = F2` (Supply for Sup1)
126+
- `SUM(B8:D8) = F3` (Supply for Sup2)
127+
- `SUM(B9:D9) = F4` (Supply for Sup3)
128+
- `SUM(B7:B9) = B5` (Demand for Cons1)
129+
- `SUM(C7:C9) = C5` (Demand for Cons2)
130+
- `SUM(D7:D9) = D5` (Demand for Cons3)
131+
- `B7:D9 >= 0`
132+
133+
134+
### **7. Solving and Results**
135+
136+
After running Solver, you will get the optimal shipment plan. For this problem, the optimal solution is:
137+
138+
139+
| | Cons1 | Cons2 | Cons3 |
140+
| :-- | :-- | :-- | :-- |
141+
| Sup1 | 100 | 0 | 0 |
142+
| Sup2 | 10 | 130 | 0 |
143+
| Sup3 | 10 | 0 | 150 |
144+
145+
**Total Cost:**
146+
147+
```excel
148+
=SUMPRODUCT(B2:D4, B7:D9)
149+
```
150+
151+
Result: **9820**
152+
153+
---
154+
155+
## **Excel Formulas (Copy-Paste Ready)**
156+
157+
Assuming:
158+
159+
- Cost matrix in `B2:D4`
160+
- Variables in `B7:D9`
161+
- Supplies in `F2:F4`
162+
- Demands in `B5:D5`
163+
164+
**Total Cost:**
165+
166+
```excel
167+
=SUMPRODUCT(B2:D4, B7:D9)
168+
```
169+
170+
**Supply Constraints:**
171+
172+
```excel
173+
=SUM(B7:D7) // For Sup1
174+
=SUM(B8:D8) // For Sup2
175+
=SUM(B9:D9) // For Sup3
176+
```
177+
178+
**Demand Constraints:**
179+
180+
```excel
181+
=SUM(B7:B9) // For Cons1
182+
=SUM(C7:C9) // For Cons2
183+
=SUM(D7:D9) // For Cons3
184+
```
185+
186+
187+
---
188+
189+
## **References**
190+
191+
For more details and visuals, see:
192+
193+
- [Excel Easy: Transportation Problem in Excel][^2]
194+
- [SCM Globe: How to Solve Transportation Problems Using Excel Solver][^3]
195+
- [YouTube: Solving LP Transportation Problem | Excel Solver][^1]
196+
197+
---
198+
199+
## **Summary Table (Markdown)**
200+
201+
| | Cons1 | Cons2 | Cons3 | Supply |
202+
| :-- | :-- | :-- | :-- | :-- |
203+
| Sup1 | 100 | 0 | 0 | 100 |
204+
| Sup2 | 10 | 130 | 0 | 140 |
205+
| Sup3 | 10 | 0 | 150 | 160 |
206+
| Demand | 120 | 130 | 150 | |
207+
208+
**Total Cost:** 9820
209+
210+
---
211+
212+

0 commit comments

Comments
 (0)