0% found this document useful (0 votes)
2 views

Lecture 7 Examples

The document outlines a linear programming problem related to McDonald's menu items, detailing decision variables, an objective function to minimize cost, and various nutritional constraints. It includes calculations for calories, protein, vitamins, and minerals, along with a total cost of $7.14. Additionally, it mentions the use of a Solver engine to find an optimal solution that satisfies all constraints.

Uploaded by

詠芯謝
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lecture 7 Examples

The document outlines a linear programming problem related to McDonald's menu items, detailing decision variables, an objective function to minimize cost, and various nutritional constraints. It includes calculations for calories, protein, vitamins, and minerals, along with a total cost of $7.14. Additionally, it mentions the use of a Solver engine to find an optimal solution that satisfies all constraints.

Uploaded by

詠芯謝
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 24

A B C D E F

1 McDonald's Problem
2

Chicken Garden
3 Decision Hamburger Big Mac McNuggets Salad Baked
Variables: (x1) (x2) (x3) (x4) Apple Pie (x5)
4 6.26 0.00 0.00 0.87 1.32

6 Objective
Function: 0.69 1.99 1.99 2.05 0.79
7
8 Constraints:
9 Calories 260 560 250 35 260
10 Protein 13 25 15 2 3
11 Vit. C 2 2 2 40 40
12 Calcium 15 25 2 4 2
13
14
15
G H I J K
oblem 1
2

5
Total Cost ($)
6
7.14
7
8 LHS Type RHS Units
9 2000 <= 2000
10 87 >= 55 g
11 100 >= 100 %
12 100 >= 100 %
13
14
15 excess
McDonald's Problem

Chicken Garden
Decision Hamburger Big Mac McNuggets Salad Baked
Variables: (x1) (x2) (x3) (x4) Apple Pie (x5)

Objective
Function: 0.69 1.99 1.99 2.05 0.79

Constraints:
Calories 260 560 250 35 260
Protein 13 25 15 2 3
Vit. C 2 2 2 40 40

𝐌𝐈𝐍 0.69 𝑥_1+1.99 𝑥_2+1.99 𝑥_3+2.05


Calcium 15 25 2 4 2

𝑥_4+0.79 𝑥_5

260𝑥_1+560𝑥_2+250𝑥_3+35𝑥_4+260𝑥_5≤2000
s.t. (such that)

13𝑥_1+ 25𝑥_2+ 15𝑥_3+ 2𝑥_4+ 3𝑥_5≥55


2𝑥_1+ 2𝑥_2+ 2𝑥_3+40𝑥_4+ 40𝑥_5≥100
15𝑥_1+ 25𝑥_2+ 2𝑥_3+ 4𝑥_4 +
2𝑥_5≥100
𝑥_𝑖≥0 for 𝑖=1,2,3,4,5
m

Total Cost ($)

LHS Type RHS Units


<= 2000
>= 55 g
>= 100 %
>= 100 %
Par Inc.

Decision Variables Standard Bag (x1) Deluxe Bag (x2)

Total Profit
Objective Function: 10 9

Constraints:
Cutting & Dyeing
Sewing
Finishing
Inspection & Packaging

𝐌𝐀𝐗 10 𝑥_1+ 9 〖 𝑥〗
_2

7/10 𝑥_1+ 𝑥_2≤630


s.t.

1/2 𝑥_1+ 5/6 𝑥_2≤600


Cutting & Dyeing:

𝑥_1+ 2/3 𝑥_2≤708


Sewing:

1/10 𝑥_1+ 1/4


Finishing:

𝑥_2≤135
Inspection & Packaging:

Non-negativity: 𝑥_1≥0, 𝑥_2≥0


_1+ 9 〖 𝑥〗

_2≤630
00

1/4

0
McDonald's Problem

Chicken Garden
Decision Hamburger Big Mac McNuggets Salad Baked Apple Pie
Variables: (x1) (x2) (x3) (x4) (x5)
6.26 0.00 0.00 0.87 1.32

Objective
Function: 0.69 1.99 1.99 2.05 0.79

Constraints:
Calories 260 560 250 35 260
Protein 13 25 15 2 3
Vit. C 2 2 2 40 40
Calcium 15 25 2 4 2
Total
Cost ($)

7.14

LHS Type RHS Units


2000 <= 2000
87 >= 55 g
100 >= 100 %
100 >= 100 %
Microsoft Excel 15.0 Answer Report
Worksheet: [Lecture 2-1.xlsx]McDonalds
Report Created: 1/12/2015 2:10:56 PM
Result: Solver found a solution. All Constraints and optimality conditions are satisfied.
Solver Engine
Engine: Simplex LP
Solution Time: 0 Seconds.
Iterations: 5 Subproblems: 0
Solver Options
Max Time 100 sec, Iterations 100, Precision 0.000001
Max Subproblems Unlimited, Max Integer Sols Unlimited, Integer Tolerance 5%, Solve Without Integer Constraints, Assu

Objective Cell (Min)


Cell Name Original Value Final Value

Objective
Function:
Total
$G$6 Cost ($) 0.00 7.14

Variable Cells
Cell Name Original Value Final Value Integer
Hamburger
$B$4 (x1) 0.00 6.26 Contin
Big Mac
$C$4 (x2) 0.00 0.00 Contin
Chicken
McNuggets
$D$4 (x3) 0.00 0.00 Contin
Garden
Salad
$E$4 (x4) 0.00 0.87 Contin
Baked
$F$4 Apple Pie(x5) 0.00 1.32 Contin

Constraints
Cell Name Cell Value Formula Status Slack
$G$9 Calories LHS 2000 $G$9<=$I$9 Binding 0
$G$10 Protein LHS 87 $G$10>=$I$10 Not Binding 32
$G$11 Vit. C LHS 100 $G$11>=$I$11 Binding 0
$G$12 Calcium LHS 100 $G$12>=$I$12 Binding 0
nteger Constraints, Assume NonNegative
McDonald's Problem

Total cost ($) 7.14379955804

Menu Item Pick Price ($) Calories Protein Fat


0 (g)
Hamburger 260 13 9
6.2589366957 0.69
Big Mac 0 1.99 560 25 30
Chicken McNuggets (6pcs) 0 1.99 250 15 15
Garden Salad 0.87092161705 2.05 35 2 0
Baked Apple Pie 1.31613154816 0.79 260 3 13
Consume 2000 87.0564149
Type <= >=
RHS 2000 55
Sodium Vit. A Vit. C Calcium Iron
(mg) % U.S.
530 RDA 2 2 15 15

1010 8 2 25 25
670 2 2 2 4
20 120 40 4 6
200 0 40 2 6
100 100
>= >=
100 100
McDonald's Problem

Chicken Garden
Decision Hamburger Big Mac McNuggets Salad Baked
Variables: (x1) (x2) (x3) (x4) Apple Pie(x5)

Objective
Function: 0.69 1.99 1.99 2.05 0.79

Constraints:
Calories 260 560 250 35 260
Protein 13 25 15 2 3
Vit. C 2 2 2 40 40
Calcium 15 25 2 4 2

(Alternative) CO2 emission (kg)


Question:
Can you design the daily meal plan that has the lowest total carbon dioxide (CO 2) emission, given a
Objective
limited budget (e.g., $10)
Function: 2.11and the nutritious
2.35 standards0.75
must be met? 0.02 2.26
m

Total
Cost ($) Budget ($)

0.00 <= 10

LHS Type RHS Units


0 <= 2000
0 >= 55 g
0 >= 100 %
0 >= 100 %

Total CO2 emission


(kg)
O 2) emission, given a
0.00
Par Inc.

Decision Variables Standard Bag (x1) Deluxe Bag (x2)


540 252
Total profit
Objective Function: 10 9 7668

Constraints: LHS Type RHS


Cutting & Dyeing 0.7 1 630 <= 630
Sewing 0.5 0.833333333333 480 <= 600
Finishing 1 0.666666666667 708 <= 708
Inspection & Packaging 0.1 0.25 117 <= 135

𝐌𝐀𝐗 10 𝑥_1+
9 〖 𝑥〗 _2

7/10 𝑥_1+
s.t.

𝑥_2≤630
Cutting & Dyeing:

1/2 𝑥_1+ 5/6 𝑥_2≤600


𝑥_1+ 2/3 𝑥_2≤708
Sewing:

1/10 𝑥_1+ 1/4


Finishing:

𝑥_2≤135
Inspection & Packaging:

Non-negativity: 𝑥_1≥0, 𝑥_2≥0


Units
Hr
Hr
Hr
Hr
Microsoft Excel 16.53 Answer Report
Worksheet: [Lecture 4 Examples - teacher.xlsx]Par (Setup)
Report Created: 2021/9/23 6:46:15 PM
Result: Solver found a solution. All constraints and optimality conditions are satisfied.
Solver Engine
Engine: Simplex LP
Solution Time: 8591223.723 Seconds.
Iterations: 2 Subproblems: 0
Solver Options
Max Time 100 sec, Iterations 100, Precision 0.000001
Max Subproblems 5000, Max Integer Sols 5000, Integer Tolerance 5%, Assume NonNegative

Objective Cell (Max)


Cell Name Original Value Final Value
$D$6 Objective Function: Total profit 0 7668

Variable Cells
Cell Name Original Value Final Value Integer
$B$4 Standard Bag (x1) 0 540 Contin
$C$4 Deluxe Bag (x2) 0 252 Contin

Constraints
Cell Name Cell Value Formula Status Slack
$D$9 Cutting & Dyeing LHS 630 $D$9<=$F$9 Binding 0
$D$10 Sewing LHS 480 $D$10<=$F$10 Not Binding 120
$D$11 Finishing LHS 708 $D$11<=$F$11 Binding 0
$D$12 Inspection & Packaging LHS 117 $D$12<=$F$12 Not Binding 18
Par Inc.

Decision Variables Standard Bag (x1) Deluxe Bag (x2)


708 0
Total profit
Objective Function: 10 9 7080

Constraints: LHS Type RHS


Cutting & Dyeing 0.7 1 495.6 <= 630
Sewing 0.5 0.833333333333 354 <= 600
Finishing 1 0.666666666667 708 <= 708
Inspection & Packaging 0.1 0.25 70.8 <= 135
MINIMUM PRODUCTION 1 708 >= 725

Objective: 𝐌𝐀𝐗 10 𝑥_1+9 〖 𝑥〗 _2

7/10 𝑥_1+ 𝑥_2≤630


s.t.

1/2 𝑥_1+5/6 𝑥_2≤600


Cutting & Dyeing:

𝑥_1+2/3 𝑥_2≤708
Sewing:

1/10 𝑥_1+1/4
Finishing:

𝑥_2≤135
Inspection & Packaging:

𝑥_1 ≥725
Non-negativity: 𝑥_1≥0, 𝑥_2≥0
Units
Hr
Hr
Hr
Hr
Microsoft Excel 16.0 Feasibility Report
Worksheet: [Lecture 7 Examples.xlsx]Par (infeasible)
Report Created: 1/6/2025 6:26:51 PM

Constraints Which Make the Problem Infeasible


Cell Name Cell Value Formula Status Slack
$D$13 MINIMUM PRODUCTION LHS 708 $D$13>=$F$13 Violated -17
$D$11 Finishing LHS 708 $D$11<=$F$11 Binding 0
Par Inc.

Decision Variables Standard Bag (x1) Deluxe Bag (x2)


0 0
Total profit
Objective Function: 12 8 0

Constraints: LHS Type RHS


Cutting & Dyeing 0.7 1 0 <= 630
Sewing 0.5 0.833333333333 0 <= 600
Finishing 1 0.666666666667 0 <= 708
Inspection & Packaging 0.1 0.25 0 <= 135

Objective: 𝐌𝐀𝐗 12 𝑥_1+8 〖 𝑥〗 _2

7/10 𝑥_1+
s.t.

𝑥_2≤630
Cutting & Dyeing:

1/2 𝑥_1+ 5/6


𝑥_2≤600
Sewing:

𝑥_1+ 2/3
𝑥_2≤708
Finishing:

1/10
𝑥_1+ 1/4 𝑥_2≤135
Inspection & Packaging:

𝑥_1≥0,
𝑥_2≥0
Non-negativity:
Units
Hr
Hr
Hr
Hr
Par Inc.

Decision Variables Standard Bag (x1) Deluxe Bag (x2)


0 0
Total profit
Objective Function: 12 8 0

Constraints: LHS Type RHS


1 1 0 >= 1000
1 0 >= 725

𝐌𝐀𝐗 12
𝑥_1+8 〖 𝑥〗 _2

𝑥_1+𝑥_2≥1000
s.t.

𝑥_2≥725
𝑥_1≥0, 𝑥_2≥0
Units
Hr
Hr

You might also like