Intro To Linear Programming
Intro To Linear Programming
Textbook support:
📫 Constraints stem from limited resource: hours of production time in each plant
Wyndor Glass --- LP Model and Graphical Solution
Graphical Solution
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?
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
■ 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…
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,
📫 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.
📫 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.
📫 After installing the Excel ‘Solver Add-in’, you can access the Solver via the menu Data🡪Solver
📫 Enter the constraint one by one using the button ‘Add’: E7:E9 <= G7:G9
📫 The Decision variable are set to their optimal values in worksheet. Done!
Anther Example of LP: Investment (portfolio diversification)
3.1-11
3.2- 1, 3.2-4, 3.2-5, 3.2-6,
3.4-14