Linear Programming Formulate
Linear Programming Formulate
Formulation
1
Outline
• Definition of Linear Programming
• Formulation of Linear Programming
• Surviving in an island
• Extending a problem formulation
• Wyndor Glass Co. Product Mix Problem
• Linear Programming Terminology
2
Outline
• Definition of Linear Programming
• Formulation of Linear Programming
• Surviving in an island
• Extending a problem formulation
• Wyndor Glass Co. Product Mix Problem
• Linear Programming Terminology
• Graphical Solution to Linear Programming
• Properties of Linear Programming
3
What is Mathematical Programming?
• Mathematical programming is selecting the best
option(s) from a set of alternatives mathematically
• Minimizing/maximizing a function where your alternatives
are defined by functions
• Many industries use mathematical programming
• Supply chain, logistics, and transportation
• Health industry, energy industry, finance, airlines
• Manufacturing industry, agriculture industry
• Education, Military
4
What is Linear Programming?
• Linear Programming problem (LP) is a mathematical programming
problem where all of your functions are linear
• A function is linear when
• The variables have power of 1 and the variables are not multiplied with each other
• 𝑓 𝑥 = 3𝑥 + 5 linear
• 𝑓 𝑥 = 3𝑥 2 + 5 not linear
• 𝑓 𝑥1 , 𝑥2 = 3𝑥1 + 5𝑥2 + 7 linear 𝑓 𝑥
• 𝑓 𝑥1 , 𝑥2 = 3𝑥1 𝑥2 + 7 not linear
• It is assumed that our variables are continuous (for now)
5
Outline
• Definition of Linear Programming
• Formulation of Linear Programming
• Surviving in an island
• Extending a problem formulation
• Wyndor Glass Co. Product Mix Problem
• Linear Programming Terminology
• Graphical Solution to Linear Programming
• Properties of Linear Programming
6
How to formulate?
• What do we need to formulate a linear programming problem?
• Have a problem!!
• Know your problem
• Gather the relevant data
• Know what each number means
• Pay attention to the class
• Best way to learn is to do some examples….
7
Example 1: Surviving in an island
• Linear programming will save you!
• Suppose that you will be left in a deserted island
• You want to live as many days as you can to
increase chance of rescue
• Fortunately (!), you can take a bag with you to
the island
• What would you put into the bag?
8
Example 1: Surviving in an island
• The bag can carry at most 50 lbs
• There are limited set of items you can carry
• Bread: You can survive for 2 days with 1 lb of bread
• Steak: You can survive for 5 days with 1 lb of steak (Memphis style grilled!)
• Chicken: You can survive for 3 days with 1 lb of chicken (southern style deep
fried!)
• Chocolate: You can survive for 6 days with 1 lb of chocolate
• How much of each item to take with you?
9
Example 1: Formulation Steps
• STEP 0: Know the problem and gather your data
• Your problem is to increase your chance of rescue by maximizing the number
of days you survive
• You can have 1 bag which can carry 50 lbs at most
• You can only put bread, steak, chicken and chocolate into you bag
• Each item enables you survive for a specific number of days for each pound
you take
Bread: 2 days/lb Steak: 5 days/lb
Chicken: 3days/lb Chocolate: 6days/lb
10
Example 1: Formulation Steps
• STEP 1: Identify your decision variables
• Decision variables are the things you control
• The amount of each item you will take with you
• 𝑥1 : 𝑡ℎ𝑒 𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑏𝑟𝑒𝑎𝑑 (𝑙𝑏𝑠)
• 𝑥2 : 𝑡ℎ𝑒 𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑠𝑡𝑒𝑎𝑘 (𝑙𝑏𝑠)
• 𝑥3 : 𝑡ℎ𝑒 𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑐ℎ𝑖𝑐𝑘𝑒𝑛 (𝑙𝑏𝑠)
• 𝑥4 : 𝑡ℎ𝑒 𝑎𝑚𝑜𝑢𝑛𝑡 𝑜𝑓 𝑐ℎ𝑜𝑐𝑜𝑙𝑎𝑡𝑒 𝑙𝑏𝑠
Warning: Always be careful with the metrics (try to use the same metrics)
11
Example 1: Formulation Steps
• STEP 2: Define your objective function and objective
• Your objective function is the measure of performance as a result of your
decisions
• Your objective is what you want to do with your objective function
Objective
• Recall that you want to maximize the number of days you will survive in the
island
Performance measure
Not a function though
12
Example 1: Formulation Steps
• STEP 2: We know our objective (maximize) and our
performance of measure (number of days)
• Express the performance of measure as a function of your
decision variables to get the objective function
• If you take 𝑥1 lbs of bread, you will survive for 2𝑥1 days
• If you take 𝑥2 lbs of steak, you will survive for 5𝑥2 days
• If you take 𝑥3 lbs of chicken, you will survive for 3𝑥3 days
• If you take 𝑥4 lbs of chocolate, you will survive for 6𝑥4 days
• Then objective function in terms of decision variables:
2𝑥1 +5𝑥2 + 3𝑥3 + 6𝑥4
𝑀𝑎𝑥𝑖𝑚𝑖𝑧𝑒
13
Example 1: Formulation Steps
• STEP 3: Define your restrictions (constraints)
• There may be some restrictions which limit what you can do (hence, they
define set of your alternatives)
• You can carry 1 bag and it can carry 50 lbs at most
Limit on how
𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 ≤ 50 much you can
carry
Total amount you
decide to carry
• You cannot get negative amounts!!!
𝑥1 ≥ 0, 𝑥2 ≥ 0, 𝑥3 ≥ 0, 𝑥4 ≥ 0
14
Example 1: LP Formulation
• Combine your objective, objective function, and constraints
15
Example 1: Extending the LP
• Suppose that you can also take cheese
• Cheese: You can survive for 4 days with 1 lb of cheese
• 𝑥5 : 𝑡ℎ𝑒 𝑎𝑚𝑜𝑢𝑛𝑓 𝑜𝑓 𝑐ℎ𝑒𝑒𝑠𝑒 𝑙𝑏𝑠
• We have a new decision variable: Update LP
16
Example 1: Extending the LP
• Furthermore, suppose you have a budgetary limit
• 1 lb of bread costs you $3
• 1 lb of steak costs you $6
• 1 lb of chicken costs you $7
• 1 lb of chocolate costs you $15
• 1 lb of cheese costs you $8
• You can spend at most $150
• Write the new restriction:
3𝑥1 + 6𝑥2 + 7𝑥3 + 15𝑥4 + 8𝑥5 ≤ 150 Limit on how
much you can
spend
18
Summary of Formulation Steps
• Gather all of your data, know what they mean
• Then
1. Identify your decision variables
2. Identify your objective and objective function
3. Identify your constraints
• Express your objective function and constraints in terms of your decision variables
• Steps 2 and 3 can change order
19
Case 1: Wyndor Glass Co. Product
• Wyndor Glass Co. produces high-quality glass products
• The company decides to produce two new products
• A glass door with aluminum framing
• A wood-framed glass window
• The company has 3 plants
1 1 hour 0 4 hours
2 0 2 hours 12 hours
3 3 hours 2 hours 18 hours
20
Case 1: Wyndor Glass Co. Product
• Unit profit for doors is $300
• Unit profit for windows is $500
21
Case 1: Formulating the LP
• Step 0: Gather the data (we have it all!)
• Step 1: Decision variables
• D: the number of doors produced weekly
• W: the number of windows produced weekly
• Step 2: Define the objective & objective functions
• Objective: Maximization
• Objective function: Profit=300D+500W
• It is the weekly profit
22
Case 1: Formulating the LP
• Step 3: Define the constraints
• Plant 1 capacity: D ≤ 4
• Plant 2 capacity: 2W ≤ 12
• Plant 3 capacity: 3D+2W ≤ 18
• Combine what you have!
Maximize 300D+500W
subject to D ≤4
2W ≤ 12
3D+2W ≤ 18 Do not forget the
D≥0, W ≥0 non-negativity
constraints
23
Outline
• Definition of Linear Programming
• Formulation of Linear Programming
• Surviving in an island
• Extending a problem formulation
• Wyndor Glass Co. Product Mix Problem
• Linear Programming Terminology
• Graphical Solution to Linear Programming
• Properties of Linear Programming
24
LP Terminology
• Decision Variables: things we control
• Objective function: measure of performance
• Nonnegativity constraints
• Functional constraints: restrictions we have
• Parameters: constants we use in the objective function and constraint definitions
• Solution: any choice of values for the decision variables
• Feasible solution is one that satisfies the constraints
• Optimal solution is the best feasible solution
25