Topic 2 Linear Programming
Topic 2 Linear Programming
– CHAP 2 –
Linear Programming
School of Economics;
University of Rwanda
Example
GABI LTD (Gisagara Agro-Business Industries ltd) produces three products: UNO
fruit juice, BORA fruit juice, and GABI beer/ Urwagwa. Producing these products
requires some quantity of agricultural products (i.e., banana, sorghum), labor, and
number of working hours per week. Given the financial capacity of GABI LTD, the
amount of banana, sorghum, and labor force that GABI can afford is limited. Also the
production is limited to the possible working hours per week. Thus, GABI’s problem is
to find out how resources affordable within its financial capacity can be allocated to
the production of its three products to maximize its Profit.
1 Graphic Method and Gaussian Elimination: works for small LP models with at
most two decision variables.
2 Fourier-Motzkin Elimination (FME): A simple (but not yet most efficient) process
to solve linear programs.
3 Simplex Method: works for even large LP models with more than two decision
variables.
In LP, solution is any specification of values for the decision variables solution,
regardless of whether it is a desirable or even an allowable choice.
Resources Required per unit (A) Resources Required per unit (B) Resources Available
Materials 8 10 3400
Labor 2 3 960
The manufacturer would like to determine how many of each model to assemble
in order to maximize profits.
Formulation
Objective criterion: maximize z = 22xA + 28xB
Constraints:
materials 8xA + 10xB <= 3400
Labor 2xA + 3xB <= 960
Finally, as it would be meaningless to have a negative number of terminals
manufactured, we also include the constraints xA >= 0 and xB >= 0
A space agency planning team wishes to set up a schedule for launching satellites
over a period of 3 years. Experimental payloads are of two types (say, Tl and
T2), and each launch carries only one experiment. Externally negotiated agency
policies dictate that at most 88 of payload type Tl and 126 of type T2 can be
supported. For each launch, type Tl payloads will operate successfully with
probability 0.85 and type T2 payloads with probability 0.75. In order for the
program to be viable, there must be a total of at least 60 successful deployments.
The agency is paid $1.5 million for each successful Tl payload, and $1.2 million
for each successful T2 payload. The costs to the agency to prepare and launch
the two types of payloads are $1.05 million for each Tl and $0.7 million for each
T2. One week of time must be devoted to the preparation of each T2 launch
payload and 2 weeks are required for Tl launch payloads. The agency, while
providing a public service, wishes to maximize its expected net income from the
satellite program.
Formulation
The objective is then to maximize z = 0.225x1 + 0.2x2
Problem constraints in this case are of various types. Agency policies impose the
two simple constraints: x1 <= 88 and x2 <= 126
The successful deployment quota yields the constraint 0.85x1 + 0.75x2 >= 60
If we assume that 52 weeks per year (for 3 years) can be applied to the satellite
program, then the launch preparation time constraint is 2x1 + 1x2 <= 156
we include the non-negativity constraints x1 >= 0 and x2 >= 0
Maximize z = 3x1 + x2 ,
s.t. x2 ≤ 5
x1 + x2 ≤ 10 (3)
− x1 + x2 ≥ −2
x1 ≥ 0, x2 ≥ 0,
Figure 1: Graphic Solution (The points labeled A, B, C, D, and E are called extreme points of the
feasible region)
AST3231 Operations Research – CHAP 2 – Linear Programming
School of Economics; University of Rwanda 11 / 64
Graphic Method for Solving LP Models: Example - 1
Minimize z = x1 + x2 ,
s.t. 3x1 + x2 ≥ 6
x2 ≥ 3 (4)
x1 ≤ 4
x1 ≥ 0, x2 ≥ 0,
Minimize z = x1 + 2x2 ,
s.t. − x1 + x2 ≤ 2
x1 + 2x2 ≤ 8 (5)
x1 ≤ 6
x1 ≥ 0, x2 ≥ 0,
Minimize z = 3x1 + x2 ,
s.t. x1 + x2 ≥ 4
− x1 + x2 ≤ 4 (6)
− x1 + 2x2 ≥ −4
x1 ≥ 0, x2 ≥ 0,
Minimize z = 3x1 + x2 ,
s.t. x1 + x2 ≥ 4
− x1 + x2 ≥ 4 (7)
− x1 + 2x2 ≤ −4
x1 ≥ 0, x2 ≥ 0,
3. Rewriting constraints:
Equality constraints require no modification;
Less-than-or-equal-to (<=) inequalities require the introduction of slack variables
to equate the left and right sides of the inequalities,
For example, a constraint such as 3x1 + 4x2 <= 7 becomes the equality
3x1 + 4x2 + s1 = 7 where the introduced slack variable s1 satisfies non-negativity
condition s1 >= 0.
Greaterthan-or-equal-to (>=) constraints are modified by introducing surplus
variables.
For example, the constraint 14x1 + 3x2 >= 12 becomes the equality
14x1 + 3x2 − s2 = 12, where s2 is the non-negative surplus variable.
Slack and surplus variables are treated exactly like any other decision variable
throughout the solution process.
Consider the following data for Dakota Furniture which makes desks, tables, and
chairs and maximize weekly revenue.
Introduce slack variables and convert the Linear Programming problem to the
standard form and write a canonical form
Initial Table
First Tableau
z x1 x2 x3 s1 s2 s3 s4 RHS Ratio
1 0 5 0 0 10 10 0 280
s1 0 0 -2 0 1 2 -8 0 24
x3 0 0 -2 1 0 2 -4 0 8
x1 0 1 1.25 0 0 -0.5 1.5 0 2
s4 0 0 1 0 0 0 0 1 5
ARTIFICIAL VARIABLES
In the original presentation of the Simplex algorithm in previous slides, the sample
problems were ones in which all constraints were of the less-than-or-equal (<=)
type. In that case, we observed that by adding slack variables (in order to achieve
equality constraints), we fortuitously also obtained an initial feasible set of basic
variables. The coefficients of the slack variables provided the required unit
vectors, embedded in the matrix of coefficients of the linear system of equations.
By ARTIFICIAL VARIABLES, we will see how to obtain an initial basic feasible
solution for problems with more general forms of constraints, and to then use the
Simplex method to solve such problems.
Recall that all right-hand sides bi of constraints must be non-negative. Any
constraint with a negative constant on the right-hand side can be multiplied by -1
in order to satisfy this requirement. For example:
an equality constraint such as −3x1 + 4x2 = −6 can be replaced by the constraint
3x1 − 4x2 = 6
an equality constraint such as 5x1 − 8x2 <= −10 can be replaced by the constraint
−5x1 + 8x2 >= 10
ARTIFICIAL VARIABLES
A typical linear programming problems in standard form contains equality
constraints involving only the original decision variables as well as constraints that
include slack variables and surplus variables. Slack variables can conveniently be
used as basic variables; however, basic variables corresponding to equality
constraints and greater-than-or-equal (⩾) constraints are not always immediately
available. Although it may be possible, by trial-anderror, to obtain a feasible
starting basis for some problems, it is preferred to use an approach that is
straightforward and simple, and that can be used predictably in all cases.
This situation is dealed with by introducing additional variables, called artificial
variables, solely for the purpose of obtaining an initial basis. These variables have
no real meaning in the problem being solved, and will not be a part of the final
solution. They merely provide a mechanism that allows to create a starting basic
solution configuration, and then to apply the Simplex algorithm to the problem.
(Note that it may not be necessary to add an artificial variable to every
constraint; a constraint with a slack variable does not need an artificial variable. )
First tableau
z x1 x2 s1 e2 R2 R3 RHS BV Ratio
1 (2M-3)/3 0 0 (M-3)/3 (3-4M)/3 0 20+3.3M z = 30M
0 5/12 0 1 1/12 -1/12 0 7/3 s1 28/5
0 1/3 1 0 -1/3 1/3 0 20/3 x2 20
0 2/3 0 0 1/3 -1/3 1 10/3 R3 5
Optimal tableau
z x1 x2 s1 e2 R2 R3 RHS BV Ratio
1 0 0 0 -1/2 (1-2M)/2 (3-2M)/2 25 z = 25
0 0 0 1 -1/8 1/8 -5/8 1/4 s1 = 1/4
0 0 1 0 -1/2 1/2 -1/2 5 x2 = 5
0 1 0 0 1/2 -1/3 3/2 5 x1 = 5
Report: After solving this LP model you will see that it is impossible to produce
Oranj under given conditions.
x1 x2 s1 R1 R2 Solution
zR -3 0 -1 2 0 -2
R1 -2 1 -1 1 0 1
R2 3 0 1 -1 1 2
x1 x2 s1 R1 R2 Solution
zR 0 0 0 1 1 0
R1 0 1 -1/3 1/3 2/3 7/3
R2 1 0 1/3 -1/3 1/3 2/3
This is the optimal solution for the Phase 1 problem, and since R1 and R2 are
zero and non-basic, this solution gives us a basic feasible starting solution for the
original problem.
Based on information that appears within the tableau, we can deduce certain
characteristics of the linear programming problem being solved. These include
linear programming problems with:
multiple optimal solutions;
unbounded solutions;
degenerate solutions.
1. Multiple Optimal Solutions
When the line corresponding to the objective function is parallel to one of the
straight lines bounding the feasible region, then the objective function can be
optimized at all points on that edge of the feasible region.
Thus, instead of a unique optimal solution, we have infinitely many optimal solutions
from which to choose, thereby permitting management to select on the basis of
secondary factors that do not appear in the model.
If a zero appears in the objective function row corresponding to a non-basic
variable, then that non-basic variable can enter the basis without changing the
value of the objective function. In other words, there are two distinct adjacent
extreme points that yield .the same value of z.
2. Unbounded Solution
When the feasible region of a linear programming problem is unbounded, then it
is also possible that the objective function value can be increased without bound.
If in any tableau the constraint coefficients corresponding to a non-basic variable
are all either negative or zero, then that non-basic variable can be increased
arbitrarily without violating any constraint. Thus, the feasible region is
unbounded in the direction of that variable.
If that variable is eligible to enter the basis, then increasing this variable’s value
will increase the objective function. And because this variable can be increased
indefinitely, so can the objective function value. Thus, the Simplex algorithm
terminates and we can recognize that the problem has an unbounded solution.
Unbounded Solution: Example-1
maximize z = 5x1 + 6x2
subject to:
(1): −x1 + x2 <= 2
(2): x2 <= 2
x1 , x2 >= 0
z x1 x2 x3 s1 s2 z RHS BV Ratio
1 0 2 -9 0 12 4 100 z = 100
0 0 1 -6 1 6 -1 20 x4 = 20 None
0 1 1 -1 0 1 0 5 x1 = 5 None
A linear programming problem and its dual are related in the sense that both
problems are based on the same problem data, and an optimal solution to either
one of the problems prescribes the optimal solution to the other.
Consider any linear programming formulation that is in the form of a
maximization problem with constraints of the less-than-or-equal type or equality
constraints. (A constraint in which the inequality is a >= type can be multiplied
by -1 to reverse the direction of the inequality sign, resulting possibly in a
negative right-hand-side value.) We will call this the primal problem.
Primal Problem:
Maximize z = c1 x1 + c2 x2 + ... + cn xn ,
s.t. a11 x1 + a12 x2 + ... + a1n xn ≤ b1
.. (10)
.
am1 x1 + am2 x2 + ... + amn xn ≤ bm
xj ≥ 0, ∀j ∈ N.
Dual Problem:
Minimize w = b1 y1 + b2 y2 + ... + bm ym ,
s.t. a11 y1 + a21 y2 + ... + am1 ym ≥ c1
.. (11)
.
a1n y1 + a2n y2 + ... + anm yn ≥ cn
yj ≥ 0, ∀j ∈ N.
Any feasible solution to the dual can be used to develop a bound on the optimal
value of the primal objective function.
If the primal is unbounded, then the dual problem is infeasible.
If the dual is unbounded, then the primal is infeasible.
How to read the optimal dual solution from Row 0 of the optimal tableau if the
primal is a max problem:
‘optimal value of dual variable yi ’
= ‘coefficient of si in optimal Row 0’ (if constraint i is a <= constraint)
= –‘coefficient of ei in optimal Row 0’ (if constraint i is a >= constraint)
= ‘coefficient of ai (artificial variable) in optimal Row 0’ –M (if constraint i is a =
constraint)
How to read the optimal dual solution from Row 0 of the optimal tableau if the
primal is a min problem:
‘optimal value of dual variable xi ’
= ‘coefficient of si in optimal Row 0’ (if constraint i is a <= constraint)
= –‘ coefficient of ei in optimal Row 0’ (if constraint i is a >= constraint)
= ‘coefficient of ai (artificial variable) in optimal Row 0’ +M (if constraint i is a =
constraint)
Use this information to find the optimal solution to the corresponding dual LP.
Answer:
minimize w = 15y1 − 5y2 + 10y3
subject to:
: y1 + 2y3 >= 3
: 3y1 − 2y2 + y3 >= 2
: 2y1 + y2 − 5y3 = 5
y1 , y2 >= 0
y3 unrestricted in sign
Use this information to find the optimal solution to the corresponding dual LP.
Answer:
maximize z = 4x1 − 2x2 + 6x3
subject to:
: x1 + x3 <= 3
: x1 − x2 + x3 <= 2
: x1 + x2 + 2x3 <= 1
y1 , y2 >= 0
y3 unrestricted in sign
z = 6, x1 = 3, x2 = 0, x3 = −1
Take Home Task - 2 will take on methods for solving LP problems (Graphic
Method, Fourier-Motzkin Elimination, and Simplex Method). It will be posted on
and submitted via moodle platform.
Quiz - 1 will take on the Theory of LP. It will be posted on and submitted via
moodle platform.
?
Questions and Comments Are Welcome