Professional Documents
Culture Documents
1D - Tom and Pie Eating
1D - Tom and Pie Eating
1D - Tom and Pie Eating
2
Formulating as an optimization
problem
3
The decision variables
One set of decision variables
• Let x be the number of tortes that Tom eats
• Let y be the number of pies that Tom eats
Number of Tortes
0 1 2 3
0 0 4 8 12
Number of Pies
1 5 9 13 17
2 10 14 18 22
3 15 19 23 27
Points for eating tortes and pies
5
The objective function
• x = number of tortes eaten
• y = number of pies eaten
Objective function
maximize 4x + 5y
6
Constraints.
What limitations or restrictions are there on the
decision variables?
Max has only 60 minutes to eat pies and tortes.
Number of Tortes
0 10 20
Number of Pies
0 0 20 30
10 30 50 70
20 60 80 100
Constraint on time
2x + 3y ≤ 60 (minutes)
Maximize 4x + 5y
subject to 2x + 3y ≤ 60 (minutes)
9
The optimization problem, so far
• x = number of tortes eaten
• y = number of pies eaten
Maximize 4x + 5y
subject to 2x + 3y ≤ 60 (minutes)
x ≥ 0, y ≥ 0 Non-negativity constraints
x integer,
Integrality constraints.
y integer, 10
Tom’s pie eating contest:
LP terminology
and geometry
Linear programs
Max 4x + 5y
s.t. 2x + 3y ≤ 60
x ≥ 0, y ≥ 0
12
Terminology
Decision variables: e.g., x and y.
Constraints: e.g., 2x + 3y ≤ 60 , x ≥ 0 , y ≥ 0
Objective Function. e.g., maximize 4x + 5y
Feasible solution:
e.g., x = 0, y = 0
x = 10, y = 10.
Optimal solution: a feasible solution with the best
(max) objective value.
13
The feasible region(s)
20
2x + 3y ≤= 60
Pies
10
0
0 10 20 30
Tortes 14
Finding the optimal solution
20
Number of pies
10
0
0 10 20 30
Number of tortes 15
The unique optimal solution: x = 30; y = 0.
– For other problems there may be more than one
optimal solutions.
– It is also possible that the optimum value is
unbounded.
16