0% found this document useful (0 votes)
13 views30 pages

IMB425 Chapter 2

Linear Programming Basics

Uploaded by

befrankbyfrank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views30 pages

IMB425 Chapter 2

Linear Programming Basics

Uploaded by

befrankbyfrank
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

IMB425

Operations Research
Michael Mutingi
[email protected]
Office: 248-182

Chapter 2
Linear Programming: Basics
1
Overview

• Background
• Linear Programming (LP) Situations
• Prototype Example
• LP Modelling
• LP Standard Form
• Graphical Solution Method
• Excel Solver Solution Approach

2
Background
• linear programming is among the most significant advances in
the 90s

• Has become a standard tool that has saved thousands or millions


of dollars for most companies or businesses

• Application: allocating limited resources among competing


activities in the best possible (i.e., optimal) way.

• Task: Select the level of certain activities that compete for


scarce resources necessary to perform those activities.

• The choice of activity levels dictates how much of each resource


will be consumed by each activity.
3
Linear Programming Problem Situations
• Linear programming problem situations include

– Production scheduling
– Employee scheduling, e.g., scheduling of healthcare staff in hospitals
– Selection of shipping patterns or routes
– Portfolio selection
– allocation of national resources to domestic needs
– Agricultural planning
– allocation of production facilities to products

 Allocation resources to activities by choosing the levels of those activities.

4
Linear Programming Preliminaries
• Linear Programming uses mathematical models

• Linear : all the mathematical functions in this model are linear


functions

• Programming -synonym for planning linear programming


involves

 The planning of activities to obtain an optimal result among


many possible alternatives

5
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Wyndor has developed the following new products:
– An 8-foot glass door with aluminum framing.
– A 4 x 6-foot double-hung, wood-framed window.

• The company has three plants


– Plant 1 produces aluminum frames and hardware.
– Plant 2 produces wood frames.
– Plant 3 produces glass and assembles the windows and doors.

• Product 1 requires some of the production capacity in Plants 1 and 3,


but none in Plant 2. Product 2 needs only Plants 2 and 3.

Questions:
1. Should they go ahead with launching these two new products?
2. If so, what should be the product mix?
6
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Which mix of the two products would be most profitable.
 Product mix problem

• An OR team is formed to study the problem:


– Identify management objectives
– Objective - to maximize total profit, subject to the restrictions
imposed by production capacities
– What are the constraints?
– Gather necessary data: available production time, profit per
batch…

7
Prototype Example: Wyndor Glass Co.
Product Mix Problem
• Summary of data gathered.

Production Time per


Batch, Hours
Product
Production Time
Plant 1 2 Available per Week, Hours
1 1 0 4
2 0 2 12
3 3 2 18
Profit per batch $3,000 $5,000

Resource limits
8
Linear Programming Formulation
• Objective: Maximize profit
– Let
Z = profit per week ($000) from producing these two products

• Decision variables
– Let
x1 = number of batches of product 1 produced per week
x2 = number of batches of product 2 produced per week

• Restraints (Constraints)
– Production capacity constraints
– Non-negativity constraints

9
Linear Programming Formulation
Production Time per
Batch, Hours
Product
Production Time
Plant 1 2 Available per Week, Hours
1 1 0 4
2 0 2 12
3 3 2 18
Profit per batch $3,000 $5,000

Formulation Maximize Z = 3x1 + 5x2,


Subject to restrictions
x1 ≤ 4 Plant 1
2x2 ≤ 12 Plant 2
3x1 + 2x2 ≤ 18 Plant 3
and
x1 ≥ 0, x2 ≥ 0 Non-negativity 10
The Linear Programming Model
• Wyndor Glass Co. problem - a typical LP problem
• Important LP Terminology

Prototype Example General Problem


Production capacities of plants Resources
3 plants m resources
Production of products Activities
2 products n activities
Production rate of product j, xj Level of activity j, xj
Profit Z Overall measure of
performance Z

• Allocation of resources → choosing the levels of the


activities that achieve the best possible value of the overall
measure of performance 11
The Linear Programming Model
Important LP Terminology and symbols

Z = value of overall measure of performance.


xj = level of activity j (for j 1, 2, . . . , n)
cj = increase in Z that would result from each unit increase in level
of activity j.
bi = amount of resource i that is available for allocation to
activities (for i = 1, 2, . . . , m).
aij = amount of resource i consumed by each unit of activity j.

• xj → decision variables
• cj, bi , and aij → input constants or parameters
12
The LP Standard Form
Maximize Z = c1x1 + c2x2 +…+ cnxn
Subject to Constraints
a11x1 + a12x1 +… + a1nxn ≤ b1
a21x1 + a22x1 +… + a2nxn ≤ b2
..
.
am1x1 + a2x1 +… + amnxn ≤ bm
and x1 ≥ 0, x2 ≥ 0, . . . , xn ≥ 0.
Resource Usage per Unit of Activity Amount of
Resource Available
Activity
Resource 1 2 … n
1 a11 a12 … a1n b1
2 a21 a22 … a2n b2
. .
. .
. … … … … .
3 am1 am2 … amn bm
Contribution to Z c1 c2 … cn 13
per unit of activity
Graphical Solution Method: Product Mix
W

Production rate (units per week) for windows 8


A p roduct mix of
7 D = 4 and W = 6

6 (4, 6)
Graph shows the points
5 (D, W) = (2, 3) and (D,
W) = (4, 6) for the
4 A p roduct mix of
D = 2 and W = 3
Wyndor Glass Co.
product-mix problem.
3 (2, 3)

1
Origin

-2 -1 0 1 2 3 4 5 6 7 8 D
Production rate (units p er week) for doors
-1

14
-2
Graph Showing Constraints: D ≥ 0 and W ≥ 0
W

Graph showing
that the constraints
D ≥ 0 and W ≥ 0
6
Production rate for windows

rule out solutions


for the Wyndor
Glass Co. product-
4
mix problem that
are to the left of the
vertical axis or
under the
2 horizontal axis.

0 2 4 6 8 D 15
Production rate for doors
Nonnegative Solutions Permitted by D ≤ 4
W

D=4

6
Production rate for windows

Graph showing that the


nonnegative solutions
4 permitted by the constraint
D ≤ 4 lie between the
vertical axis and the line
2
where D = 4.

0 2 4 6 8 D16
Production rate for doors
Nonnegative
ate for windows
Solutions Permitted by 2W ≤ 12
W

2 W = 12
Production rate for windows

4
Graph showing that the nonnegative solutions
permitted by the constraint 2W ≤ 12 must lie
between the horizontal axis and the constraint
boundary line whose equation is 2W = 12.
2

0 2 4 6 8 17D
Production rate for doors
Boundary Line for Constraint 3D + 2W ≤ 18
Production rate for windows
W
10

(0, 9) Graph showing that the


Production rate for windows
8 boundary line for the
1
(1, 7 _ )
2
constraint 3D + 2W ≤ 18
6 (2, 6) intercepts the horizontal
3 D + 2 W = 18 axis at D = 6 and
1
(3, 4 _ )
4
2 intercepts the vertical
axis at W = 9.
(4, 3)

2
1
(5, 1 _ )
2

(6, 0)
0 2 4 6 8 D 18
Production rateforfordoors
Production rate doors
Changing Right-Hand Side Creates
n rate for windows
Parallel Constraint Boundary Lines
W
12

Graph showing that changing


Production rate for windows

10 only the right-hand side of a


3D + 2W = 24
constraint (such as 3D + 2W ≤
8
18) creates parallel constraint

6
boundary lines.

3D + 2W = 18
4

2 3D + 2W = 12

0 2 4 6 8 10 D
19
Production
Production rate for doors
rate for doors
Nonnegative Solutions Permitted by
3D + 2W ≤ 18
Production rate for windows
W
10
Graph showing that nonnegative
solutions permitted by the
Production rate for windows

8 constraint 3D + 2W ≤ 18 lie within


the triangle formed by the two axes
and this constraint’s boundary line,
6
3D + 2W = 18.
3D + 2W = 18
4

20 D
0 2 4 6 8
Production
Productionrate
ratefor
fordoors
doors
Production rate for windows Graph of Feasible Region
W
10 Graph showing how the feasible region is
formed by the constraint boundary lines, where

3 D + 2 W = 18 the arrows indicate which side of each line is


8
Production rate for windows

permitted by the corresponding constraint.


D=4

6 2 W =12

Feasible

region
2

0 2 4 6 8 D
Production rate for doors 21
Production rate for doors
Objective Function (Let P = 1,500)
Production rate W

for windows
8 Graph showing the line containing
all the points (D, W) that give a
value P = 1,500 for the objective
6
function.

Feasible
4
region
P = 1500 = 300D + 500W

0 2 4 6 8 D22
Production rate for doors
Finding the Optimal Solution
Production rate W
for windows
Figure 2.7 Graph showing
8

P = 3600 = 300D + 500W


three objective function lines
Optimal solution
for the Wyndor Glass Co.
P = 3000 = 300D + 500W 6 (2, 6)
product-mix problem, where
the top one passes through the
Feasible optimal solution.
4
region
P = 1500 = 300D + 500W

0 2 4 6 8 1023 D
Production rate for doors
Summary of the Graphical Method
• Draw the constraint boundary line for each constraint. Use the origin
(or any point not on the line) to determine which side of the line is
permitted by the constraint.
• Find the feasible region by determining where all constraints are
satisfied simultaneously.
• Determine the slope of one objective function line. All other objective
function lines will have the same slope.
• Move a straight edge with this slope through the feasible region in the
direction of improving values of the objective function. Stop at the last
instant that the straight edge still passes through a point in the feasible
region. This line given by the straight edge is the optimal objective
function line.
• A feasible point on the optimal objective function line is an optimal
solution.

24
Solver: Identify Target & Changing Cells
B C D E F G
3 Doors Windows • Choose the “Solver”
4 Unit Profit $300 $500
5 Hours Hours from Tools menu.
6
7 Plant 1
Hours Used Per Unit Produced
1 0
Used
1 <=
Available
1
• Select the cell you
8 Plant 2 0 2 2 <= 12 wish to optimize in
9
10
Plant 3 3 2 5 <= 18 the “Set Target
11 Doors Windows Total Profit Cell” window.
12 Units Produced 1 1 $800
• Choose “Max” or
“Min” depending on
whether you are
maximizing or
minimizing.
• Enter all the
changing cells in the
“By Changing
Cells” window.

25
Solver: Adding Constraints
• To begin entering constraints, click the “Add” button to the right of the
constraints window.
• Fill in the entries in the resulting Add Constraint dialogue box.
B C D E F G
3 Doors Windows
4 Unit Profit $300 $500
5 Hours Hours
6 Hours Used Per Unit Produced Used Available
7 Plant 1 1 0 1 <= 1
8 Plant 2 0 2 2 <= 12
9 Plant 3 3 2 5 <= 18
10
11 Doors Windows Total Profit
12 Units Produced 1 1 $800

26
Solver: Complete Solver Dialogue Box

The Solver dialogue box after specifying the entire model in


terms of the spreadsheet.
27
Solver: Some Important Options
• Click on the “Options” button, and click in both the “Assume
Linear Model” and the “Assume Non-Negative” box.
– “Assume Linear Model” tells the Solver that this is a linear
programming model.
– “Assume Non-Negative” adds nonnegativity constraints to
all the changing cells.

28
The Optimal Solution
Doors Windows
Unit Profit $300 $500
Hours Hours
Hours Used Per Unit Produced Used Available
Plant 1 1 0 2 <= 4
Plant 2 0 2 12 <= 12
Plant 3 3 2 18 <= 18

Doors Windows Total Profit


Units Produced 2 6 $3 600

Solver
Results
Dialogue
Box
29
Modelling Languages

• Mathematical Programming (MP) modelling language is


software that has been specifically designed for efficiently
formulating large linear programming models:
– AMPL, MPL, GAMS, and LINGO

• LINGO : is a product of LINDO Systems, Inc. The latest student


version available www.lindo.com

• LP solvers : CPLEX, LP Solve, Excel Solver

• Most of these can be downloaded freely as student versions

30

You might also like