Skip to content

Commit b31fa52

Browse files
Add files via upload
Signed-off-by: Fabiana 🚀 Campanari <113218619+FabianaCampanari@users.noreply.github.com>
1 parent 5a80b81 commit b31fa52

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
2+
3+
4+
# Exercise 1: Problem in Excel: Step-by-Step Solution
5+
6+
This guide shows how to solve the assignment problem from the image using **Excel Solver**. All formulas, tables, and steps are included so you can reproduce the solution in Excel.
7+
8+
---
9+
10+
### Problem Statement
11+
12+
Three tasks must be assigned to three machines and all tasks can be done on any machine,
13+
but with different costs, as described in the scheme below.
14+
15+
<br>
16+
17+
### Problem Recap
18+
19+
- **3 tasks** must be assigned to **3 machines**.
20+
- Each task can be done by any machine, but with different costs.
21+
- Each task must be assigned to exactly one machine, and each machine to exactly one task.
22+
- **Goal:** Minimize total assignment cost.
23+
24+
### Cost Table
25+
26+
| | Machine 1 | Machine 2 | Machine 3 |
27+
|---------|-----------|-----------|-----------|
28+
| Task 1 | 2 | 4 | 3 |
29+
| Task 2 | 1 | 3 | 2 |
30+
| Task 3 | 5 | 2 | 4 |
31+
32+
---
33+
34+
## Step 1: Set Up the Excel Spreadsheet
35+
36+
### 1. Enter the Cost Matrix
37+
38+
| | B | C | D |
39+
|-----|------|------|------|
40+
| | M1 | M2 | M3 |
41+
| T1 | 2 | 4 | 3 |
42+
| T2 | 1 | 3 | 2 |
43+
| T3 | 5 | 2 | 4 |
44+
45+
- Place this table in cells **B2:D4**.
46+
47+
### 2. Create the Decision Variable Table
48+
49+
| | G | H | I |
50+
|-----|------|------|------|
51+
| | M1 | M2 | M3 |
52+
| T1 | x11 | x12 | x13 |
53+
| T2 | x21 | x22 | x23 |
54+
| T3 | x31 | x32 | x33 |
55+
56+
- Place this table in **G2:I4**.
57+
- These cells will be filled with 0 or 1 by the Solver (1 = assigned, 0 = not assigned).
58+
59+
### 3. Calculate the Total Cost
60+
61+
In cell **K2**, enter:
62+
63+
```
64+
65+
=SUMPRODUCT(B2:D4, G2:I4)
66+
67+
```
68+
69+
This formula multiplies each assignment by its cost and sums the total.
70+
71+
### 4. Add Row and Column Sums for Constraints
72+
73+
#### Row Sums (Each Task Assigned Once)
74+
75+
- In **J2**: `=SUM(G2:I2)`
76+
- In **J3**: `=SUM(G3:I3)`
77+
- In **J4**: `=SUM(G4:I4)`
78+
79+
#### Column Sums (Each Machine Assigned Once)
80+
81+
- In **G5**: `=SUM(G2:G4)`
82+
- In **H5**: `=SUM(H2:H4)`
83+
- In **I5**: `=SUM(I2:I4)`
84+
85+
---
86+
87+
## Step 2: Configure Excel Solver
88+
89+
1. **Go to**: Data > Solver
90+
2. **Set Objective**:
91+
- Set **K2** (total cost) to **Minimize**.
92+
3. **By Changing Variable Cells**:
93+
- Select **G2:I4**.
94+
4. **Add Constraints**:
95+
- **J2:J4 = 1** (each task assigned once)
96+
- **G5:I5 = 1** (each machine assigned once)
97+
- **G2:I4 = binary** (only 0 or 1 allowed)
98+
5. **Choose Solving Method**:
99+
- Use "Simplex LP" or "GRG Nonlinear" (either works for this size).
100+
6. **Click Solve**.
101+
102+
---
103+
104+
## Step 3: Solution Example
105+
106+
After running Solver, you should get a solution like:
107+
108+
| | M1 | M2 | M3 | Row Sum |
109+
|-----|----|----|----|---------|
110+
| T1 | 1 | 0 | 0 | 1 |
111+
| T2 | 0 | 0 | 1 | 1 |
112+
| T3 | 0 | 1 | 0 | 1 |
113+
|Col Sum| 1| 1 | 1 | |
114+
115+
- **Task 1 → Machine 1** (cost 2)
116+
- **Task 2 → Machine 3** (cost 2)
117+
- **Task 3 → Machine 2** (cost 2)
118+
119+
**Total minimum cost:** 6
120+
121+
---
122+
123+
## Excel Table and Formula Summary
124+
125+
| | M1 | M2 | M3 | Row Sum |
126+
|-----|------|------|------|---------|
127+
| T1 | G2 | H2 | I2 | J2 |
128+
| T2 | G3 | H3 | I3 | J3 |
129+
| T3 | G4 | H4 | I4 | J4 |
130+
|Col Sum|G5 | H5 | I5 | |
131+
132+
- **Total Cost:** `=SUMPRODUCT(B2:D4, G2:I4)`
133+
- **Row Sums:** `=SUM(G2:I2)`, etc.
134+
- **Column Sums:** `=SUM(G2:G4)`, etc.
135+
136+
---
137+
138+
## Result (in English)
139+
140+
**The optimal assignment is:**
141+
- Task 1 to Machine 1 (cost 2)
142+
- Task 2 to Machine 3 (cost 2)
143+
- Task 3 to Machine 2 (cost 2)
144+
145+
**Total minimum cost:** 6
146+
147+
148+

0 commit comments

Comments
 (0)