Unit 5
Unit 5
1 3
(SEHS4648) (SEHS4648)
(SEHS4648) (SEHS4648)
6 8
(SEHS4648) (SEHS4648)
2. Linear Programming
Slack Variables
2.1 Basic Concepts A linear constraint of the form can be converted into
an equality by adding a new, nonnegative variable to the left-hand
Maximize or minimize: z = f (x1, x2 xn) side of the inequality. Such a variable is known as slack variable.
subject to: b1 Slack variable equal to the difference between the right- and left-
hand sides of the inequality constraint.
b2
=
Example: The constraint
bm
4
Decision Variables: Variables that represent the decision that can be made
(x1, x2 xn). The inequality can be transformed into the equation
Objective function: Each optimization problem is trying to optimize
4 + S1 = 30000
(maximize/minimize) some goal such as costs, profits, revenue.
Constraints: Set of real restricting parameters that are imposed in real life by adding the slack variable S1 to the left-hand side of the inequality.
or by the structure of the problem. 9 11
(SEHS4648) (SEHS4648)
(SEHS4648) (SEHS4648)
Example-1:
A furniture maker has 6 units of wood and 28h of free time, in which he
will make decorative screens. Two models have sold well in the past, so he x2
will restrict himself to those two. He estimates that model I requires 2 units
of wood and 7 h of time, where model II requires 1 unit of wood and 8 h of
time. The prices of the models are $120 and $80, respectively. How many
screens of each model should the furniture maker assemble if he wishes to
maximize his sales revenue?
The non-negativity constraint
Decisions variables:
x1 = number of model I screens to be produced
x2 = number of model II screens to be produced
Objective Function:
x1
sales revenue, z=120x1+80x2, to be maximized
Constraints
Wood: 2x1 + x2 6
Time: 7x1 + 8x2 14 16
(SEHS4648) (SEHS4648)
objective: z = 120x1+80x2
X2 z = 380 x2
5 The wood constraint: z = 330 5
2x1+x2
4 z = 240
4
3 3
(SEHS4648) (SEHS4648)
(SEHS4648) (SEHS4648)
2) Graph the objective function, and move toward optimality 2.3 Some Special Cases of Linear Programs
x2
Min 5x1+2x2 Four special cases and difficulties arise at times in linear
6
programming:
5
1) Redundancy
4x1 - x2 > 12
4
2) Infeasibility
x 1 + x2 > 4
3
3) Unboundedness
2 2x1 + 5x2 > 10
4) Alternate Optimal Solutions
1
x1
1 2 3 4 5 6 22 24
(SEHS4648) (SEHS4648)
0 | | | | | | 25 27
5 10 15 20 25 30 x1
(SEHS4648) (SEHS4648)
8 10
max: 2 x1 + 2x2
2x1 + x2 subject to: x1 + x2 < 10 All points on
6
x1 < 5 red segment are
Region Satisfying x2 < 6 6
4 Third Constraint optimal
x 1, x 2 > 0
2
x1 +2x2
0 | | | | | | | | | |
2 4 6 8 x1 0
Region Satisfying First Two Constraints 0 5 10 x1
26 28
(SEHS4648) (SEHS4648)
(SEHS4648) (SEHS4648)
Linear Program 30 32
(SEHS4648) (SEHS4648)
33 35
(SEHS4648) (SEHS4648)
34 36
(SEHS4648) (SEHS4648)
Example: Wyndor Glass Co. problem (Ref. 1, pp. 26-28) Some concepts and ideas Constraint boundaries
The WYNDOR GLASS Co. produces high-quality glass products, including window and
Feasible region
x2
glass doors. It has three plants. Aluminum frames and hardware are made in Plant 1, (0,9) Optimal solutions always exist at
wood frames are made in Plant 2, and Plant 3 produces the glass and assembles the x1 corner points: Corner-point
products. solutions
Because of declining earnings, top management has decided to revamp the (the points of intersection)
(0,6) (2,6) (4,6)
2x2 Corner-point feasible (CPF)
production capacity to launch two new products having large scales potential: product-1 solutions
(glass door with aluminum frame), product-2 (double-hung wood-framed window).
(the corners of the feasible region)
Production Time per Batch, Hours Product Time Available
(4,3) Edges of the feasible region
Plant Product-1 Product-2
per Week, Hours Feasible region Adjacent CPF solutions
3x1 + 2x2 (in a problem with n decision
1 1 0 4
2 0 2 12
variables, two CPF solutions share
3 3 2 18
(0,0) (4,0) (6,0) n-1 constraint boundaries)
Profit per batch $3,000 $5,000 x1 If the solution is not optimal, you
Z = 3x1 + 5x2 can always find a better Adjacent
37 CPF solution. 39
(SEHS4648) (SEHS4648)
Example: Wyndor Glass Co. problem (Ref. 1, pp. 26-28) Optimality test in the Simplex Method:
The WYNDOR GLASS Co. produces high-quality glass products, including window and If a CPF solution has no adjacent solutions that are better, then it must
glass doors. It has three plants. Aluminum frames and hardware are made in Plant 1, be an optimal solution.
wood frames are made in Plant 2, and Plant 3 produces the glass and assembles the
products. An iterative procedure
Because of declining earnings, top management has decided to revamp the
Initialization
production capacity to launch two new products having large scales potential: product-1 (Find initial CPF solution)
(glass door with aluminum frame), product-2 (double-hung wood-framed window).
41 43
Augmented solutions
3.2 The Key Solution Concepts Augmented Form
X2
Maximize : Z= 3x1+ 5x2
1) The simplex method focus only on CPF solutions; (0,9,4,-6,0)
subject to : x1 + S1 =4
2) The simplex method is an iterative algorithm; 2x2 + S2 = 12
3x1+ 2x2 +S3 = 18
3) If possible, use the origin as the initial CPF solution;
x1, x2, S1, S2, S3
4) Move always to the adjacent and best CPF solution;
(0,6,4,0,6) (2,6,2,0,0) (4,6,0,0,-6)
The basis: the set of basic variables; x1, x2, S1, S2, S3
The rest variables are Non-basic variables (there are 2 non-basic variables in
Wyndor Glass).
2) Example of Adjacent BF Solution:
Non-basic variables are set to 0;
The values of the basic variables can be obtained by solving the system of
constraint equations;
If basic variables satisfy the non-negativity constraint, we have a BFS; x1 x2 x1 S2
Between two BFS, if all but one of their non-basic variables are the same, [ Only one non-basic variable x2 is replaced by S2. ]
then they are adjacent.
45 47
(SEHS4648) (SEHS4648)
Wyndor Glass
Non-basic variables
z 1 -3 -5 0 0 0 0 S1 0 1 0 1 0 0 4
S2 0 0 2* 0 1 0 12
S1 0 1 0 1 0 0 4
S3 0 3 2 0 0 1 18
S2 0 0 2 0 1 0 12
S3 0 3 2 0 0 1 18 Pivot number
49 51
(SEHS4648) (SEHS4648)
Z 1 -3 -5 0 0 0 0 Basic
variable
Z x1 x2 S1 S2 S3 r.h.s.
S1 0 1 0 1 0 0 4
S2 0 0 2 0 1 0 12 Z 1 -3 0 0 0 30
S3 0 3 2 0 0 1 18 S1 0 1 0 1 0 4
(1)
x2 0 0 1 0 0.5 0 6
S3 0 3 0 0 1 6
50 52
(SEHS4648) (SEHS4648)
Optimality test
Iteration 2: Basic
Z x1 x2 S1 S2 S3 r.h.s.
variable
1) Optimality test (every coefficient in row Z is nonnegative?) Z 1 0 0 0 1 36
Basic Z = 36
variable
Z x1 x2 S1 S2 S3 r.h.s.
S1 = 2
Z 1 -3 0 0 0 30 Basic variables
x2 = 6
S1 0 1 0 1 0 4
x1 = 2
x2 0 0 1 0 0.5 0 6
S2 = 0
S3 0 3 0 0 1 6 Non-basic variables
S3 = 0
Z 1 -3 0 0 0 30 Basic
variable
Z x1 x2 S1 S2 S3 r.h.s.
S1 0 1 0 1 0 0 4
(1) Z 1 -3 0 0 0 30
x2 0 0 1 0 0 6
S1 0 1 0 1 0 0 4
S3 0 3* 0 0 -1 1 6
x2 0 0 1 0 0 6
S3 0 3* 0 0 -1 1 6
Basic
variable
Z x1 x2 S1 S2 S3 r.h.s.
Basic
Z 1 0 0 0 1 36 variable
Z x1 x2 S1 S2 S3 r.h.s.
S1 0 0 0 1 -1/3 2 Z 1 0 0 0 1 36
(2)
x2 0 0 1 0 0 6 S1 0 0 0 1 -1/3 2
x1 0 1 0 0 1/3 2 x2 0 0 1 0 0 6
54 56
x1 0 1 0 0 1/3 2
(SEHS4648)
Reference:
(R. Bronson and G. Naadimuthu,
Schaum's outline of theory and problems of Operations
Research, McGraw Hill, 1997)
1. Mathematical Programming, pp. 1 ~ 7.
2. Linear Programming: Basic Concepts, pp. 18 ~ 20.
Frederick s. Hillier and Gerald J. Lieberman,
Introduction to Operations Research, Eighth Edition
McGraw Hill, 2000
Chapter 4. Solving Linear Programming Problems: The Simplex
Method, pp. 103 ~ 121.
57