You are on page 1of 15

Chapter1

Introduction to Linear Programming

Textbook support:

3.1 Prototype Example

3.2 The LP model

3.5 Formulating and Solving on Excel Spreadsheet


The Wyndor Glass Co. example - Product Mix and Resource Allocation

Company has 3 plants with some available hours per week.


Wants to launch two products. How many of each?

📫 Goal: maximum profit

📫 Decision variables: how many of each product line.

📫 Profit: linear combination of produced items, each has profit/item.

📫 Constraints stem from limited resource: hours of production time in each plant
Wyndor Glass --- LP Model and Graphical Solution

Maximize Z= 3x1 + 5x2


subject to:
x1 ≤4
x2 ≤ 6
3x1 + 2x2 ≤ 18
x1 ≥ 0, x2 ≥ 0

Graphical Solution

• Feasible region is a convex


polygone, is the set of points that
satisfy the constraints.

• Each constraint is a facet of the


polygone.

• Straight lines are “contours” (level


curves) of the economic function.

• Optimal Solution x1=2, x2=6


Another Product Mix example: the potter
A potter produces two products, a pitcher and a bowl. It takes about 1 hour to produce
a bowl and requires 4 pounds of clay. A pitcher takes about 2 hours and consumes 3
pounds of clay. The profit on a bowl is $40 and $50 on a pitcher. She works 40 hours
weekly, has 120 pounds of clay available each week, and wants more profits.

Max Z = 40x + 50y (profit) 4


s.t. 0
x + 2y ≤ 40 hours
4x + 3y ≤ 120 clay
x, y ≥ 0 non-negativity 2
Grad(Z)
0
(40, 50)
2
4
,
8

3 4
0 0
Example with minimization
A farmer is preparing to plant a crop in the spring and needs to fertilize a field. There
are two brands of fertilizer he can use: SuperGro and CropKwik. Each brand has a
specific amount of nitrogen and phosphate. The field requires at least 16 pounds of
nitrogen and 24 pounds of phosphate. SuperGro costs $6 per bag and CropKwik $3.
How many bags of each type should the farmer use to adequately fertilize his field?

(lbs / bag) Nitrogen Phosphate


SuperGro 2 4
CropKwik 4 3

8
Minimize Z = 6x1 + 3x2 (-6, -3)
s.t.
2x1 + 4x2 ≥ 16
4
4x1 + 3x2 ≥ 24 4
.
8

x1 , x2 ≥ 0 ,
1
.
6

6 8
Graphical LP Solution
■ Good to illustrate concepts, aid in conceptual understanding

■ Works well when we have only 2 decision variables

■ “Possible” for 3 decision variables, but very difficult

■ Impossible for 4+ variables


■ Other solution approaches necessary.

🡺 We need efficient algorithms and software…


Assumptions of LP
■ Linear objective function, linear constraints
■ Proportionality
■ Additivity
■ Divisibility
■ Continuous decision variables
■ If not, we fall in a variant called “integer programming”

■ Certainty
■ Deterministic parameters
LP Concepts
■ “Constrained optimization”
■ Decision variables
■ Objective function
■ Constraints
■ Feasible solutions
■ Feasible region is a convex polytope
■ polygon in 2D
■ polyhedron in 3D etc…

■ Find the optimal solution at corner points


Linear Programming Mathematical Model
Optimize a linear function of many variables, under linear inequalities.
• The function to optimize is called the economic function
• The linear inequalities are called constraints
• The variables are called decision variables
• Optimizing means finding for the decision variables the values that
maximize or minimize (according to context) the economic function

Max Z = c1x1 + c2x2 + … + cnxn

subject to
a11x1 + a12x2 + … + a1nxn ≤ b1
a21x1 + a22x2 + … + a2nxn ≤ b2

am1x1 + am2x2 + … + amnxn ≤ bm

x1 ≥ 0, x2 ≥ 0, …, xn ≥ 0
Max Z = c1x1 + cnxn + … + cnxn
LP Standard
s.t.
Form
a11x1 + a12x2 + … + a1nxn ≤ b1
a21x1 + a22x2 + … + a2nxn ≤ b2
In Matrix form:
.
. Max Z = cT x s.t.
amnx1 + am2x2 + … + amnxn ≤ bm Ax ≤ b
x≥0
x1≥0, x2≥0, … xm≥0,

📫 xi : Decision variables. ai, bi and ci : input constants (coefficients, parameters).

📫 Z: Objective function (or economic function). The inequalities are called constraints.

📫 Vectors x that verify the constraints are called “feasible solutions”. They form the feasible region.

📫 In the case of LP the feasible region is “convex Polyhedron” (or polytope).

📫 The corners of the feasible region are called “ corner-point feasible” or “Basic feasible” solutions.

📫 In the standard LP Form, the decision variables are ≥ 0, the constants b i are ≥ 0, the
inequalities are in the form ‘ ≤ ’, and Z is to Maximize. All other forms of LP can be transformed
into the standard form (as we will see later).
Solving Wyndor Glass example with Excel Solver – Entering the Data

📫 Cells with numbers cells are the relevant numbers. Other cells are just for comment.

📫 Batches produced: E17 and D17 cells are the decision variables, to calculate.

📫 Total Profit: G12 =SUMPRODUCT(C4:D4, C12:D12)

📫 Hours Used: E7 =SUMPRODUCT(C7:D7, C12:D12)


E8 =SUMPRODUCT(C8:D8, C12:D12)
E9 =SUMPRODUCT(C8:D8, C12:D12)

📫 Alternatively, we can use ‘Array formula’ using Matrix multiplication:


E7:E9 =MMULT(C7:D9, TRANSPOSE(C12:D12))
Solving Wyndor Glass example with Excel Solver – Entering the constraints

📫 After installing the Excel ‘Solver Add-in’, you can access the Solver via the menu Data🡪Solver

📫 Set Objective: G12, and Select ‘Max’ since we want to maximize.

📫 Enter the constraint one by one using the button ‘Add’: E7:E9 <= G7:G9

📫 Select the Solving Method ‘Simplex LP’ The click ‘Solve’.

📫 The Decision variable are set to their optimal values in worksheet. Done!
Anther Example of LP: Investment (portfolio diversification)

An investor has $70,000 to invest. She can invest in municipal


bonds (8.5% annual return), CD’s (5%), treasury bills (6.5%), or
in a growth stock fund (13%). She has established the following
guidelines to manage her risk and diversify her portfolio:

• No more than 20% in municipal bonds


• CD’s can be no more than sum of the other three
• At least 30% must be in CD’s and treasury bills
• The sum of treasury bills and CD’s must be at least 120% of
the sum invested in bonds and stock
• All $70,000 must be invested
LP Model of the Investment Example
x1 = bonds x3 = T-Bills
x2 = CD’s x4 = stocks

Max Z = 0.085x1 + 0.05x2 + 0.065x3 + 0.13x4 returns


s.t.
x1 ≤ 0.2 (x1 + x2 + x3 + x4)bonds
x2 ≤ x1 + x3 + x4 CD’s
x2 + x3 ≥ 0.3 (x1 + x2 + x3 + x4) CD’s, T-Bills
x2 + x3 ≤ 1.2(x1 + x4) CD’s, T-Bills
x1 + x2 + x3 + x4 = 70,000 investment
x1 , x2 , x3 , x4 ≥ 0
Some assignment exercises
From Textbook Hillier and Lieberman, 10th ed. Chapter 3

3.1-11
3.2- 1, 3.2-4, 3.2-5, 3.2-6,
3.4-14

You might also like