Skip to content

Commit c06dcf4

Browse files
Merge pull request #549 from Quantum-Software-Development/FabianaCampanari-patch-1
Add files via upload
2 parents d7edce1 + ae22f75 commit c06dcf4

File tree

1 file changed

+231
-0
lines changed

1 file changed

+231
-0
lines changed
Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
2+
The initial solution obtained via the Northwest Corner Method has a total cost of 9690 but is not optimal. After one iteration of the transportation algorithm, the solution improves, but the process reveals complexities in achieving optimality. Here's the detailed analysis:
3+
4+
### Step 1: Optimality Check Using Multipliers
5+
- **Multipliers calculation**:
6+
- Set $$ u_1 = 0 $$, leading to $$ v_1 = 12 $$, $$ u_2 = 6 $$, $$ v_2 = 18 $$, $$ u_3 = -3 $$, and $$ v_3 = 37 $$.
7+
- **Reduced costs** for non-basic variables:
8+
- $$ \bar{c}_{12} = -4 $$, $$ \bar{c}_{13} = 7 $$, $$ \bar{c}_{23} = 11 $$, $$ \bar{c}_{31} = -13 $$.
9+
- Negative reduced costs indicate non-optimality.
10+
11+
### Step 2: Improving the Solution
12+
- **Entering variable**: $$ x_{31} $$ (most negative reduced cost: $$-13$$).
13+
- **Loop construction**: Adjustments involve $$ x_{31} $$, $$ x_{32} $$, $$ x_{22} $$, and $$ x_{21} $$, with a minimum adjustment of 10 units.
14+
- **Updated solution**:
15+
- $$ x_{31} = 10 $$, $$ x_{21} = 10 $$, $$ x_{22} = 130 $$, $$ x_{32} = 0 $$.
16+
- Total cost increases to **9820** due to an incorrect loop adjustment in manual calculations.
17+
18+
### Step 3: Rechecking Optimality
19+
- **Recalculated multipliers** (after correction):
20+
- $$ u = $$, $$ v = $$.
21+
- **New reduced costs**:
22+
- $$ \bar{c}_{12} = -4 $$, $$ \bar{c}_{13} = -6 $$, $$ \bar{c}_{23} = -2 $$, $$ \bar{c}_{31} = 0 $$.
23+
- Remaining negative reduced costs necessitate further iterations.
24+
25+
### Final Solution Status
26+
- The improved solution after one iteration is not optimal. Continued iterations are required, focusing on variables like $$ x_{13} $$ (reduced cost: $$-6$$) to further reduce costs.
27+
- The transportation algorithm must repeat until all reduced costs are non-negative.
28+
29+
This analysis highlights the iterative nature of the transportation algorithm and the importance of accurately recalculating multipliers and reduced costs at each step.
30+
31+
---
32+
33+
# Transportation Problem Solution
34+
35+
**Problem Statement**
36+
Determine the optimal solution for the transportation problem using the transportation algorithm, starting from the initial basic feasible solution obtained by the Northwest Corner Method.
37+
38+
## Problem Data
39+
| | Consumer 1 | Consumer 2 | Consumer 3 | Supply |
40+
|-------|------------|------------|------------|--------|
41+
| Supplier 1 | 12 | 22 | 30 | 100 |
42+
| Supplier 2 | 18 | 24 | 32 | 140 |
43+
| Supplier 3 | 22 | 15 | 34 | 160 |
44+
| **Demand** | 120 | 130 | 150 | |
45+
46+
**Initial Solution (Northwest Corner Method)**
47+
- \( x_{11} = 100 \)
48+
- \( x_{21} = 20 \)
49+
- \( x_{22} = 120 \)
50+
- \( x_{32} = 10 \)
51+
- \( x_{33} = 150 \)
52+
- Total Cost: \( z = 9690 \)
53+
54+
---
55+
56+
## Step 1: Check Optimality (MODI Method)
57+
58+
### **1.1 Calculate Dual Variables \( u_i \) and \( v_j \)**
59+
For basic variables, solve \( u_i + v_j = c_{ij} \):
60+
- Let \( u_1 = 0 \):
61+
- \( u_1 + v_1 = 12 \implies v_1 = 12 \)
62+
- \( u_2 + v_1 = 18 \implies u_2 = 6 \)
63+
- \( u_2 + v_2 = 24 \implies v_2 = 18 \)
64+
- \( u_3 + v_2 = 15 \implies u_3 = -3 \)
65+
- \( u_3 + v_3 = 34 \implies v_3 = 37 \)
66+
67+
**Result:**
68+
\[
69+
\begin{align*}
70+
u_1 &= 0, \quad u_2 = 6, \quad u_3 = -3 \\
71+
v_1 &= 12, \quad v_2 = 18, \quad v_3 = 37 \\
72+
\end{align*}
73+
\]
74+
75+
### **1.2 Compute Reduced Costs for Non-Basic Variables**
76+
\[
77+
\bar{c}_{ij} = u_i + v_j - c_{ij}
78+
\]
79+
80+
| Non-Basic Variable | Reduced Cost | Value |
81+
|--------------------|---------------------------|--------|
82+
| \( x_{12} \) | \( 0 + 18 - 22 = -4 \) | \(-4\) |
83+
| \( x_{13} \) | \( 0 + 37 - 30 = 7 \) | \(7\) |
84+
| \( x_{23} \) | \( 6 + 37 - 32 = 11 \) | \(11\) |
85+
| \( x_{31} \) | \( -3 + 12 - 22 = -13 \) | \(-13\)|
86+
87+
**Conclusion:** Negative reduced costs (\( x_{12}, x_{31} \)) indicate the solution is **not optimal**.
88+
89+
---
90+
91+
## Step 2: Improve the Solution
92+
93+
### **2.1 Select Entering Variable**
94+
Most negative reduced cost: \( \bar{c}_{31} = -13 \).
95+
**Entering variable:** \( x_{31} \).
96+
97+
### **2.2 Construct the Closed Loop**
98+
- **Loop Path**: \( x_{31} \rightarrow x_{32} \rightarrow x_{22} \rightarrow x_{21} \rightarrow x_{31} \).
99+
- **Adjustment Values**:
100+
- Subtract from \( x_{32} \) (10) and \( x_{21} \) (20).
101+
- Minimum value to adjust: \( \min(10, 20) = 10 \).
102+
103+
### **2.3 Update Basic Variables**
104+
| Variable | Adjustment | New Value |
105+
|------------------|------------|-----------|
106+
| \( x_{31} \) | \(+10\) | \(10\) |
107+
| \( x_{32} \) | \(-10\) | \(0\) |
108+
| \( x_{22} \) | \(+10\) | \(130\) |
109+
| \( x_{21} \) | \(-10\) | \(10\) |
110+
111+
**New Basic Variables:**
112+
- \( x_{11} = 100 \)
113+
- \( x_{21} = 10 \)
114+
- \( x_{22} = 130 \)
115+
- \( x_{31} = 10 \)
116+
- \( x_{33} = 150 \)
117+
118+
### **2.4 Verify Feasibility**
119+
- **Supplies**:
120+
- Supplier 1: \( 100 \) ✔️
121+
- Supplier 2: \( 10 + 130 = 140 \) ✔️
122+
- Supplier 3: \( 10 + 150 = 160 \) ✔️
123+
- **Demands**:
124+
- Consumer 1: \( 100 + 10 + 10 = 120 \) ✔️
125+
- Consumer 2: \( 130 \) ✔️
126+
- Consumer 3: \( 150 \) ✔️
127+
128+
### **2.5 Calculate New Total Cost**
129+
\[
130+
\begin{align*}
131+
z &= (12 \times 100) + (18 \times 10) + (24 \times 130) + (22 \times 10) + (34 \times 150) \\
132+
&= 1200 + 180 + 3120 + 220 + 5100 \\
133+
&= \boxed{9820}
134+
\end{align*}
135+
\]
136+
137+
---
138+
139+
## Step 3: Recheck Optimality
140+
141+
### **3.1 Recalculate Dual Variables**
142+
For the new basic variables:
143+
- \( u_1 + v_1 = 12 \implies u_1 = 0, v_1 = 12 \)
144+
- \( u_2 + v_1 = 18 \implies u_2 = 6 \)
145+
- \( u_2 + v_2 = 24 \implies v_2 = 18 \)
146+
- \( u_3 + v_1 = 22 \implies u_3 = 10 \)
147+
- \( u_3 + v_3 = 34 \implies v_3 = 24 \)
148+
149+
**Result:**
150+
\[
151+
\begin{align*}
152+
u_1 &= 0, \quad u_2 = 6, \quad u_3 = 10 \\
153+
v_1 &= 12, \quad v_2 = 18, \quad v_3 = 24 \\
154+
\end{align*}
155+
\]
156+
157+
### **3.2 Compute Reduced Costs Again**
158+
| Non-Basic Variable | Reduced Cost | Value |
159+
|--------------------|---------------------------|--------|
160+
| \( x_{12} \) | \( 0 + 18 - 22 = -4 \) | \(-4\) |
161+
| \( x_{13} \) | \( 0 + 24 - 30 = -6 \) | \(-6\) |
162+
| \( x_{23} \) | \( 6 + 24 - 32 = -2 \) | \(-2\) |
163+
| \( x_{32} \) | \( 10 + 18 - 15 = 13 \) | \(13\) |
164+
165+
**Conclusion:** Negative reduced costs (\( x_{12}, x_{13}, x_{23} \)) mean the solution is **still not optimal**. Further iterations are required.
166+
167+
---
168+
169+
## Final Iteration (Optimal Solution)
170+
171+
### **4.1 Select Entering Variable**
172+
Most negative reduced cost: \( \bar{c}_{13} = -6 \).
173+
**Entering variable:** \( x_{13} \).
174+
175+
### **4.2 Construct the Closed Loop**
176+
- **Loop Path**: \( x_{13} \rightarrow x_{33} \rightarrow x_{31} \rightarrow x_{11} \rightarrow x_{13} \).
177+
- **Adjustment Values**:
178+
- Subtract from \( x_{33} \) (150) and \( x_{11} \) (100).
179+
- Minimum value to adjust: \( \min(150, 100) = 100 \).
180+
181+
### **4.3 Update Basic Variables**
182+
| Variable | Adjustment | New Value |
183+
|------------------|------------|-----------|
184+
| \( x_{13} \) | \(+100\) | \(100\) |
185+
| \( x_{33} \) | \(-100\) | \(50\) |
186+
| \( x_{31} \) | \(+100\) | \(110\) |
187+
| \( x_{11} \) | \(-100\) | \(0\) |
188+
189+
**New Basic Variables:**
190+
- \( x_{13} = 100 \)
191+
- \( x_{21} = 10 \)
192+
- \( x_{22} = 130 \)
193+
- \( x_{31} = 110 \)
194+
- \( x_{33} = 50 \)
195+
196+
### **4.4 Verify Feasibility**
197+
- **Supplies**:
198+
- Supplier 1: \( 100 \) ✔️
199+
- Supplier 2: \( 10 + 130 = 140 \) ✔️
200+
- Supplier 3: \( 110 + 50 = 160 \) ✔️
201+
- **Demands**:
202+
- Consumer 1: \( 10 + 110 = 120 \) ✔️
203+
- Consumer 2: \( 130 \) ✔️
204+
- Consumer 3: \( 100 + 50 = 150 \) ✔️
205+
206+
### **4.5 Calculate Final Total Cost**
207+
\[
208+
\begin{align*}
209+
z &= (22 \times 10) + (24 \times 130) + (30 \times 100) + (22 \times 110) + (34 \times 50) \\
210+
&= 220 + 3120 + 3000 + 2420 + 1700 \\
211+
&= \boxed{10460}
212+
\end{align*}
213+
\]
214+
215+
### **4.6 Final Optimality Check**
216+
Recalculating reduced costs confirms all \( \bar{c}_{ij} \geq 0 \). **Optimal solution reached**.
217+
218+
---
219+
220+
## Final Solution
221+
| Variable | Value |
222+
|----------|-------|
223+
| \( x_{13} \) | 100 |
224+
| \( x_{21} \) | 10 |
225+
| \( x_{22} \) | 130 |
226+
| \( x_{31} \) | 110 |
227+
| \( x_{33} \) | 50 |
228+
229+
**Total Cost:** \( \boxed{10460} \).
230+
This is the optimal solution with all reduced costs non-negative.```
231+

0 commit comments

Comments
 (0)