Professional Documents
Culture Documents
Solutions Methods in Optimization: Linear Programming
Solutions Methods in Optimization: Linear Programming
Solutions Methods in Optimization: Linear Programming
OPTIMIZATION
LINEAR PROGRAMMING
1 LP problem 5
1.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 General linear programming problem . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 LP Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.5.1 Applications of Linear programming . . . . . . . . . . . . . . . . . . . . 7
1.5.2 Statement of a General form of the LP problem . . . . . . . . . . . . . . 7
1.5.3 A typical Example of an LP problem . . . . . . . . . . . . . . . . . . . . 8
1.5.4 Changing the sense of optimization . . . . . . . . . . . . . . . . . . . . . 8
1.5.5 Changing the sense of an inequality . . . . . . . . . . . . . . . . . . . . . 8
1.5.6 Changing an inequality into equality . . . . . . . . . . . . . . . . . . . . 9
1.5.7 Standard and Canonical forms of Linear Programming problems . . . . . 9
1.5.8 Examples of Linear Programming Problems in words . . . . . . . . . . . 10
3 Simplex Method 35
3.1 Mathematical Background to the simplex method . . . . . . . . . . . . . . . . . 35
3.1.1 Theorems about the Convex sets . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Solution to a LP Problem( Simplex Method) . . . . . . . . . . . . . . . . . . . . 41
3.2.1 Basis presentation of an LP . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2.2 Vector to enter the Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3 Standard Maximization Problem . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.3.1 Simplex Method for Standard Maximization Problem . . . . . . . . . . . 44
3.3.2 Basic Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4 Simplex Method for Minimization Problem . . . . . . . . . . . . . . . . . . . . . 45
3.5 Sample of a simplex tableau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.5.1 A typical example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.5.2 Vector to leave the Basis . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.5.3 Steps for solving an LPP . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.6 LP problem before the primal simplex tableau . . . . . . . . . . . . . . . . . . . 51
3.7 Summary of the Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.8 Degeneracy and Cycling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.9 Worked Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3
CONTENTS
LP problem
1.1 History
Linear programming was a mathematical model developed during the second world war to plan
expenditures and returns such that it reduces costs to the army and increases losses to the
enemy. It was kept secret until 1947. Postwar, many industries found its use in their daily
planning.
The founders of the subject are George B. Dantzig, who published the simplex method
in 1947, John von Neumann, who developed the theory of the duality in the same year, and
Leonid Kantorovich, a Russian mathematician who used similar techniques in economics before
Dantzig and won the Nobel prize in 1975 in economics. A breakthrough came after 1947 when
Fiacco and McCormick introduced the Interior Point Method in 1984.
Dantzig’s original example of finding the best assignment of 70 people to 70 jobs still explains
its success. The computing power required to scan all the permutations to select the best
assignment is vast and impossible. He observed that it takes only a moment to find the optimum
solution using the simplex method, which is effectively noticing that a solution exists in the
corners of the polygon described by the equations formed from the given constraints.
1.2 Uses
Linear programming is an important field of optimization for several reasons. Many practical
problems in operations research can be expressed as linear programming problems. Certain
special cases of linear programming, such as network flow problems and multi commodity flow
problems are considered important enough to have generated much research on specialized al-
gorithms for their solution. A number of algorithms for other types of optimization problems
work by solving LP problems as sub-problems. Historically, ideas from linear programming
have inspired many of the central concepts of optimization theory, such as duality, decompo-
sition, and the importance of convexity and its generalizations. Likewise, linear programming
is heavily used in microeconomics and business management, either to maximize the income
or minimize the costs of a production scheme. Some examples are food blending, inventory
management, portfolio and finance management, resource allocation for human and machine
resources, planning advertisement campaign etc.
1.3 Methodology
A linear programming problem consists of a collection of linear inequalities on a number of real
variables and a given linear functional (on these real variables) which is to be maximized or
5
1.4. GENERAL LINEAR PROGRAMMING PROBLEM
Definition 1.4.1 An optimization problem is one requiring the determination of the optimal
(maximum or minimum) value of a given function, called the objective function, subject to a
set of stated restrictions, or constraints placed on the variables concerned.
A Mathematical optimization problem is one in which some function is either
maximized or minimized relative to a given set of alternatives. The function to be either
minimized or maximized is called the objective f unction and the set of restrictions is called
the feasible ( or constraint) region.
In this course the feasible region will always be taken as a subset of Rn while the objective
function as a real valued function from Rn to R.
Definition 1.4.2 Linear programming is a method of solving an optimization problem when
the objective function is a linear function and the constraints are linear equations or linear
inequalities.
A linear programming problem is an optimization problem over Rn wherein the objective
function is linear.
1.5 LP Description
A linear programming problem is one in which we are to find the maximum or minimum
value of a linear expression
ax + by + cz + ...
(called the objective function), subject to a number of linear constraints of the form Ax +
By + Cz + .. ≥ N
or
Ax + By + Cz + .. ≥ N. The largest or smallest value of the objective function is called the
optimal value, and a collection of values of x, y, z, ... that gives the optimal value constitutes
an optimal solution. The variables x, y, z, ... are called the decision variables.
Definition 1.5.1
A function is said to be linear if it’s of the form,
f (x) = cx = c1 x1 + c2 x2 + . . . + cn xn . for some ci ∈ R, i = 1, 2, . . . , n, x = x1 , x2 , . . . , xn .
The feasible region is the set of solutions to a finite number of linear inequalities/ constraints
and/or equality constraints.
The general linear programming problem can also be re - written in the matrix form as,
min/max z = cx
s.t Ax {<, =, >} b
and x ≥ 0
min w = x1 − x2 + 7x3
s.t − 2x1 + 3x2 − x3 ≥ 7
+x2 + x3 ≥ 1
x1 + 3x3 ≥ 3
x1 , x2 , x3 ≥ 0
or in Matrix form;
x1
minw = (1, −1, 7) x2 subject to
x3
−2 3 −1 x1 7
0 1 1 x2 ≥ 1 . ∀ x1 , x2 , x3 ≥ 0
1 0 3 x3 3
−2 3 −1 7
Where A = 0 1 1 , b = 1 , c = (1, −1, 7).
1 0 3 3
n
X
−aij xj ≥ −bi .
j=1
where si ≥ 0 and
n
X
aij xj ≥ bi
j=1
where ti ≥ 0
Here si &ti are referred to as slack and surplus variables respectively.
Maximise z = cx
s.t Ax ≤ b
and x ≥ 0
Minimise w = cx
s.t Ax ≥ b
and x ≥ 0
Example 1.5.1
Example 1.5.2
Exercise 1.1 Write the following minimization linear programming problems in canonical
minimization form and hence convert them to canonical maximization linear programming
problems;
(i)
(ii)
min w = x1 + 17x2 + x3
subject to − x1 + 2x2 − 6x3 ≤ −10
−x2 − 2x3 ≥ −6
2x1 + 11x3 ≤ 19
x1 , x2 , x3 ≥ 0
Definition 1.5.2
A linear programming problem is said to be in standard form if all the restrictions are only
equalities.
The estimated profits per product are 7, 500 U GX and 13, 500 U GX for x and y respec-
tively. the amounts of time each machine is available for making the products during any
given week are restricted as follows:
Machine A is available for atmost 21 hours,
Machine B is available for atmost 40 hours,
Machine C is available for atmost 30 hours,
The Manufacturer’s objective is to make as much profit as he can, Formulate the problem
as a linear programming problem that can be used to find this profits.
3. A pharmaceutical firm produces two products H and M . Each unit of product H requires
3 hours of operation I and 4 hours of operation II, while each unit of product M requires
4 hours of operation I and 5 hours of operation II. Time available for operation I and
II are 20 hours and 26 hours respectively. Product H sells at a profit of 1, 000 U GX per
unit, while M sells at a profit of 2, 000 U GX. Determine the quantities of H and M to
be produced, so that the profit earned is maximum.
Geometrical/Graphical solution of a
linear programming problems:
Given any two dimensional linear programming problem, we can find the optimal solution to
the problem by the use of the following procedure.
- Plot the objective function on the graph starting with a value of z(w) = 0 and shift the
objective function in order to identify a point that either maximizes or minimizes the LP
objective.
In other words To sketch the region represented by a linear inequality in two variables:
A. Sketch the straight line obtained by replacing the inequality with an equality.
B. Choose a test point not on the line ((0,0) is a good choice if the line does not pass through
the origin, and if the line does pass through the origin a point on one of the axes would be a
good choice).
C. If the test point satisfies the inequality, then the set of solutions is the entire region on the
same side of the line as the test point. Otherwise it is the region on the other side of the line. In
either case, shade out the side that does not contain the solutions, leaving the solution region
showing
13
2.2. GRAPHICAL METHOD
(Step A.) Graph the feasible region (Sketch the constraints and shade the wanted region).
(Step B.) Compute the coordinates of the corner points of the feasible region.
(Step C.) Substitute the coordinates of the corner points into the objective function to see which
gives the optimal value.
(Step D.) If the feasible region is not bounded, this method can be misleading: optimal solutions
always exist when the feasible region is bounded, but may or may not exist when the
feasible region is unbounded. The textbook shows a straightforward way for determining
whether optimal solutions exist in the case of unbounded feasible regions.
max Z = 4x + 5y
subject to 2x + 5y ≤ 25
6x + 5y ≤ 45
x, y ≥ 0
The corner points are thus (0, 0), (0, 5), (15/2, 0) and (5, 3). Check these values.
Objective function
Corner points z = 4x + 5y
(0, 0) 4(0) + 5(0) = 0
(0, 5) 4(0) + 5(5) = 25
( 15
2
, 0) 4( 15
2
) + 5(0) = 30
(5, 3) 4(3) + 5(3) = 35
Look for the maximum (since objective is to maximize) value for z in this list is 35 at (5, 3).
Objective function
Corner points z = x + 5y
(0, 0) (0) + 5(0) = 0
(0, 5) (0) + 5(5) = 25
( 15
2
, 0) ( 15
2
) + 5(0) = 15
2
(5, 3) (3) + 5(3) = 20
max K = x1 + 2x2
subject to − 2x1 + x2 ≤ 2
x1 − 2x2 ≤ 4
x1 + x2 ≤ 5
x1 , x2 ≥ 0
The optimal solution to the linear programming problem is (1, 4) since it’s one that yields
the maximum shift in the objective function and the optimal value is therefore K = K = 9
Example 2.2.4
Objective function
Corner points z = 143x + 60y
(0, 0) 143(0) + 60(0) = 0
(0, 500
7
) 143(0) + 60( 500
7
) = 4286
400 400
( 11 , 0) 143( 11 ) + 60(0) = 5200
(20, 60) 143(20) + 60(60) = 6460
Class 2.2.1 A firm manufactures two categories of Timber, Mahogany and other types. Ma-
hogany timber costs 4, 500/ = to make and each of the others cost 6, 000/ = to make. The
weekly production budget is 540, 000/ =. A Mahogany timber takes 2 man hours to make and
each of the others take 4 man hours. There are 160 man hours available in a week. Given
that each of Mahogany timber give a profit of 20, 000/ = and other timber give a profit of
25, 000/ =.
(ii) Find the number of Mahogany and other timber that can be produced in order to maxi-
mize production in a week (Hint: Take x to be the number of Mahogany timber produced
and y to be the number of other timber produced and Use graphical method to solve the
problem ).
Using graphical method find the optimal solution to the following linear programming prob-
lems.
Exercise 2.1
max z = 2x + 3y
subject to 3x + y ≤ 2
4x + 2y ≤ 44
4x − y ≤ 14
x, y ≥ 0
Exercise 2.2
minimise w = x + y
subject to − x + y ≤ 3
2x + y ≤ 18
y ≥ 6
x, y ≥ 0
Exercise 2.3
maximise z = x1 + x2
subject to 2x1 + 3x2 ≤ 6
x1 + 4x2 ≤ 4
x1 , x2 ≥ 0
2x + 3y ≥ 120, 2x + y ≥ 80
Example 2.2.5 A company makes two products (X and Y ) using two machines (A and B).
Each unit of X that is produced requires 50 minutes processing time on machine A and 30
minutes processing time on machine B. Each unit of Y that is produced requires 24 minutes
processing time on machine A and 33 minutes processing time on machine B.
At the start of the current week there are 30 units of X and 90 units of Y in stock. Available
processing time on machine A is forecast to be 40 hours and on machine B is forecast to be 35
hours.
The demand for X in the current week is forecast to be 75 units and for Y is forecast to be
95 units. Company policy is to maximize the combined sum of the units of X and the units of
Y in stock at the end of the week.
(i) Formulate the problem of deciding how much of each product to make in the current week
as a linear program.
Solution: : Let
i.e. x ≥ 45 so production of X ≥ demand (75) - initial stock (30), which ensures we meet
demand
y ≥ 95 − 90 i.e. y ≥ 5 so production of Y ≥ demand (95) - initial stock (90), which ensures we
meet demand The objective is: maximize (x + 30 − 75) + (y + 90 − 95) = (x + y − 50) i.e. to
maximize the number of units left in stock at the end of the week
It is plain from the diagram below that the maximum occurs at the intersection of x = 45
and 50x + 24y = 2400
Example 2.2.6 A company is involved in the production of two items (X and Y ). The
resources need to produce X and Y are twofold, namely machine time for automatic processing
and craftsman time for hand finishing. The table below gives the number of minutes required
for each item:
The company has 40 hours of machine time available in the next working week but only 35
hours of craftsman time. Machine time is costed at 10 per hour worked and craftsman time
is costed at 2 per hour worked. Both machine and craftsman idle times incur no costs. The
revenue received for each item produced (all production is sold) is 20 for X and 30 for Y . The
company has a specific contract to produce 10 items of X per week for a particular customer.
(i) Formulate the problem of deciding how much to produce per week as a linear program.
(ii) Solve this linear program graphically.
Solution: : Let
x be the number of items of X
y be the number of items of Y
then the LP is:
maximize
20x + 30y − 10 (machine time worked) −2 (craftsman time worked)
subject to:
It is plain from the diagram below that the maximum occurs at the intersection of x = 10 and
20x + 29y ≤ 2100
Solving simultaneously, rather than by reading values off the graph, we have that x = 10
and y = 65.52 with the value of the objective function being 1866.5
Example 2.2.7
A company manufactures two products (A and B) and the profit per unit sold is 3 and 5
respectively. Each product has to be assembled on a particular machine, each unit of product
A taking 12 minutes of assembly time and each unit of product B 25 minutes of assembly time.
The company estimates that the machine used for assembly has an effective working week of
only 30 hours (due to maintenance/breakdown).
Technological constraints mean that for every five units of product A produced at least two
units of product B must be produced.
(i) Formulate the problem of how much of each product to produce as a linear program.
(iii) The company has been offered the chance to hire an extra machine, thereby doubling the
effective assembly time available. What is the maximum amount you would be prepared
to pay (per week) for the hire of this machine and why?
Solution: : Let
xA = number of units of A produced
xA = (1800/22) = 81.8
xB = 0.4xA = 32.7
existing assembly time constraint so that the new optimal solution will lie at the intersection
of 12xA + 25xB = 3600 and xB − 0.4xA = 0
i.e. at xA = ( 3600
22
) = 163.6
xB = 0.4xA = 65.4
with the value of the objective function being 817.8
Hence we have made an additional profit of (817.8−408.9) = 408.9 and this is the maximum
amount we would be prepared to pay for the hire of the machine for doubling the assembly
time.
This is because if we pay more than this amount then we will reduce our maxi-
mum profit below the 408.9 we would have made without the new machine.
Example 2.2.8 minimize 4a + 5b + 6c
subject to
a+b ≥ 11
a−b ≤ 5
c−a−b = 0
7a ≥ 35 − 12b
a, b, c ≥ 0
From the diagram below the minimum occurs at the intersection of a − b = 5 and a + b = 11
i.e. a = 8 and b = 3 with c(= a + b) = 11 and the value of the objective function
10a + 11b = 80 + 33 = 113.
x1 + x2 ≤ 10
x1 − x2 ≥ 3
5x1 + 4x2 ≤ 35
x1 ≥ 0
x2 ≥ 0
Solution: It is plain from the diagram below that the maximum occurs at the intersection of
5x1 + 4x2 = 35 and x1 − x2 = 3
Solving simultaneously, rather than by reading values off the graph, we have that
5(3 + x2 ) + 4x2 = 35
i.e. 15 + 9x2 = 35
i.e. x2 = (20/9) = 2.222 and
x1 = 3 + x2 = (47/9) = 5.222
The maximum value is 5(47/9) + 6(20/9) = (355/9) = 39.444
Example 2.2.10 A carpenter makes tables and chairs. Each table can be sold for a profit
of 30 and each chair for a profit of 10. The carpenter can afford to spend up to 40 hours per
week working and takes six hours to make a table and three hours to make a chair. Customer
demand requires that he makes at least three times as many chairs as tables. Tables take up
four times as much storage space as chairs and there is room for at most four tables each week.
Formulate this problem as a linear programming problem and solve it graphically.
Solution:
Let
Example 2.2.12 Solve using the graphical method, determine the feasible region, corner
points, optimal solution and optimal objective function value. Also graph the objective func-
tion.
max p = 5x1 + 7x2
subject to x1 ≤ 6
2x1 + 3x2 ≤ 19
x1 + x2 ≤ 8
x1 , x2 ≥ 0
Example 2.2.13 Use both the geometric and primal simple algorithm to solve the problem
max π = 5y1 + 8y2
subject to y1 + 2y2 ≤ 1
y1 + y2 ≤ 2
2y1 + 3y2 ≤ 4
y1 , y2 ≥ 0
Example 2.2.14 Consider the linear programming model with two variables and 3 constraints:-
Solve graphically.
x1 20
x2 = 5
z 55
Repeat the problem using a primal-simplex.
Exercise 2.5
max z = 2x1 + 3x2
subject to −x1 + x2 ≤ 5
x1 + 3x2 ≤ 35
x1 ≤ 20
x1 + 15x2 ≥ 10
x1 , x2 ≥ 0
Example 2.2.15 Every Saturday, David irons for the family. he irons three different types of
clothing: dresses, shirts and jackets. David knows that each Saturday:
(b) On a particular Saturday, David irons the same number of jackets as dresses. David’s
aim is to iron the maximum number of items of clothing.
(i) Show that the inequalities found in part (a) above simplify to
x ≥ 2, y ≥ 5, 2x + y ≤ 28, 40 ≤ 5x + 2y ≤ 60
(ii) Draw a suitable diagram to enable the problem to be solved graphically, indicating
the feasible region.
(iii) Use your diagram to find how many of each type of clothing David might iron to
achieve his aim.
(x, y) = (4, 20, 28)
Example 2.2.16 State any two limitations of a graphical approach of solving a LP problem.
Class 2.2.2 Without solving, formulate a linear programming problem to determine the pairs
of each type of shoes should the company make to maximize profits π for the shoe company
that requires the following resources.
Jogging shoes Racing shoes Security shoes Resource available
Labor 2 Hrs 3 Hrs 14 Hrs 35
Machine hour 13 Hrs 4 Hrs 7 Hrs 54
Cotton 24 inches 1 inches 6 inches 71
Rubber 5 inches 9 inches 8 inches 35
Profit 10 5 35
Example 2.2.17 A pension fund manager is considering investing in two shares A and B. It
is estimated that
(a) Share A will earn a dividend of 12% per annum and share B 4% per annum.
(b) Growth in the market value in one year of share A will be 10 praise per Re.1 invested
and in B 40 praise per Re.1 invested.
He wants to invest a minimum total sum which will give dividend income of atleast Rs.600 per
annum and growth in one year of atleast Rs.1000 on the initial investment. You are required
to
(ii) Compute the minimum sum to be invested to meet the manager’s objective by using the
primal simplex method on the dual problem.
min z = x1 + x2
subject to 0.12x1 + 0.04x2 ≥ 600
0.1x1 + 0.4x2 ≤ 1000
x1 , x2 ≥ 0
Example 2.2.18 In order to produce 1000 tones of non-oxidising steel for engine valves,
atleast the following quantities of mangnese (Mn), Chromium (Cr) and Molybdenum (Mb) are
needed:
M n 50kg, Cr 60kg, M b 70kg,
These metals are available in packages A, B and C having different proportions of M n, Cr and
M b and also different in prices as below:
A 10 10 5 45
B 10 15 5 60
C 5 5 25 75
How many packages A, B and C should be purchased to minimize cost? What is the possible
cost?
Example 2.2.19 A company uses small trucks and large trucks to transport its products in
crates. The crates are all of the same size.
On a certain day 10 truck drivers at most are available. Each truck requires one driver only.
Small trucks take 10 minutes each to load and large trucks take 30 minutes each to load. The
total loading time must not be more than 3 hours. Only one truck can be loaded at a time.
(i) if x represents the number of small trucks and y represents the number of large trucks
used, write down two inequalities in x and y. Illustrate these on graph paper.
x + y ≤ 10
10x + 30y ≤ 180
(ii) Each small truck carries 30 crates and each large truck carries 70 crates. How many of
each type of truck should be used to maximize the number of crates to be transported
that day?
The company should have 6 small trucks and 4 large trucks to maximise the number of
crates exported
Example 2.2.20 Two types of machines, type A and type B, can be purchased for a new
factory. Each machine of type A costs $1600. Each machine of type B costs $800. The purchase
of the machines can cost, at most, $27200.
Each machine of type A needs 90m2 of floor space in the factory.
Each machine of type B needs 54m2 of floor space.
The maximum amount of floor space available for the machines is 1620m2 .
(i) If x represents the number of machines of type A and y represents the number of machines
of type B, write down two inequalities in x and y and illustrate these on graph paper.
1600x + 800y ≤ 27, 200
90x + 54y ≤ 1620
(ii) The daily income from the use of each machine of type A is $75. The daily income from
the use of each machine of type B machine is $42. How many of each type of machine
should be purchased so as to maximise daily income?
(i) Taking x to represent the number of bungalows and y to represent the number of semide-
tached houses, write down two inequalities in x and y and illustrate these on graph paper.
(ii) The profit on each bungalow is $10, 000. The profit on each semidetached house is $7, 000.
How many of each type of house should be built so as to maximise profit?
The builder should build no bungalows and 80 semi-detached in order to maximise his profits
of $560, 000.
Example 2.2.22 A new ship is being designed. It can have two types of cabin accommoda-
tion for passengers - type A cabins and type B cabins.
Each type A cabin accommodates 6 passengers and each type B cabin accommodates 3 pas-
sengers. The maximum number of passengers that the ship can accommodate is 330.
Each type A cabin occupies 50m2 of floor space. Each type B cabin occupies 10m2 of floor
space. The total amount of floor space occupied by cabins cannot exceed 2300m2 .
(i) Taking x to represent the number of type Acabins and y to represent the number of type
B cabins, write down two inequalities in x and y and illustrate these on graph paper.
6x + 3y ≤ 330
50x + 10y ≤ 2300
(ii) The income on each voyage from renting the cabins to passengers is $600 for each type A
cabin and $180 for each type B cabin. How many of each type of cabin should the ship
have so as to maximize income, assuming that all cabins are rented?
The income will be $600x + $180y
(iii) What is the maximum possible income on each voyage from renting the cabins?
The maximum possible income will be $29, 400.
Example 2.2.23 A machine tool company conducts a job-training program for machinists.
Trained machinists are used as teachers in the program at a ratio of one for every ten trainees.
The training program lasts for one month. From past experience it has been found that out of
ten trainees hired, only seven complete the program successfully (the unsuccessful trainees are
released).
Trained machinists are also needed for machining and the company’s requirements for the next
three months are as follows:
January 100
February 150
March 200
In addition, the company requires 250 trained machinists by April. There are 130 trained
machinists available at the beginning of the year. Payroll costs per month are:
Each trainee $400
Each trained machinist(machining or teaching) $700
Each trained machinist idle(Union forbids firing them!) $500
Set up the linear programming problem that will produce the minimum cost hiring and training
schedule and meet the company’s requirements.
(ii) teach
The cost of machinists operating is constant and therefore not required in the objective function.
Complete problem:
Example 2.2.24 A company involved in the assembly and distribution of printers in con-
cerned with two types laser and inkjet. Assembly of each laser printer takes two hours, while
each inkjet printer takes one hour to assemble, and the staff can provide a total of 40 person-
hours of assembly time per day. In addition, warehouse space must be available for the assembly
and distribution of the printers, 1 square meter for each laser printer and 3 square meters for
each inkjet printer; the company has a total of 45 square meters of storage space available for
assembled printers each day. Laser printers can be sold for a profit of $30 per unit and inkjet
printers earn a profit of $25 each, but the market in which the company is operating can absorb
a maximum of 12 laser printers per day. (There is no such limitation on the market for inkjet
printers). Formulate this as a linear programming problem and determine, using the simplex
method, the number of each type of printer the company should assemble and distribute in
order to maximise daily profit.
Solution X1? = 12(# of laser printers), X2? = 11(# of inkjet printers).
Total daily profit = $635
Example 2.2.25 The Pasta Basta company wants to evaluate an ecological production versus
a traditional one. One of their products, the Pasta Basta lasagne, has to contain certain
preservatives, R and Q, in order to ensure durability. Artificially produced counterparts R0 and
Q0 are usually used in the production - these are bought from a chemical company PresChem,
but are undesirable from the ecological point of view. R and Q can alternatively be extracted
from fresh fruit, and there are four types of fruit each with their particular content (number of
units) of R and Q in one ton of the fruit. These contents and the cost of buying the fruit are
specified in Table below. Pasta Basta has a market corresponding to daily needs of 7 units of
R and 2 units of
Fruit type F1 F2 F3 F4
Preservative R 2 3 0 5
Preservative Q 3 0 2 4
Example 2.2.26 A company, which owns three farms at the edge of a desert, is planning
agricultural production for the coming year. The agricultural output of each farm is limited by
both the amount of available irrigable land and the quantity of water available. The data are
given below.
Farm Usable Land (Acres) Water Available (Acre Feet)
1 400 600
2 600 800
3 300 375
The crops being considered on these farms include sugar beets, cotton, and corn. These crops
differ primarily in their expected net return per acre and their consumption of water. In
addition, the company has set a maximum quota for the total acreage that can be devoted to
each of these crops. The data is shown below.
Because of the limited water available for irrigation, the company will not be able to use all
its irrigable land for planting crops. To ensure equity between three farms, it has been agreed
that each farm will plant the same proportion of its available irrigable land. For example, if
farm 1 plants 200 of its 400 acres, then farm 2 must plant 300 of its 600 acres, while farm 3
plants 150 of its 300 acres. However, any combination of the crops may be grown at any of the
farms. The job facing the company is to plan how many acres to devote to each crop on these
farms while satisfying the given restrictions. The objective is to maximise the total net return
of the company.
Assignment 2.2.1 The Thompson company manufactures two industrial products: a stan-
dard product ($45 profit per item) and an economy product ($30 profit per item). These two
products are built using machine time and manual labor. The standard product requires 3
hours machine time and 2 hours manual labor. The economy model requires 3 hours machine
time and no manual labor. If the week’s supply of manual labor is limited to 800 hours and
machine time to 1500 hours. Without solving, formulate an LP problem model to find how
much of each type of product should be produced each week in order to maximize the profit?
Assignment 2.2.2
Maximize x+y
subject to 2x + y ≤ 14
−x + 2y ≤ 8
2x − y ≤ 10
x ≥ 0, y ≥ 0
(x, y) = (4, 6)
Assignment 2.2.3
Maximize 5x + 4y
subject to x+y ≤2
−2x − 2y ≤ −9
x ≥ 0, y ≥ 0
infeasible
Assignment 2.2.4
Maximise P = x + 4y
subject to −x + 2y ≤ 6
5x + 4y ≤ 40
x, y ≥ 0
(x, y; P ) = (6, 5; 6)
Assignment 2.2.6 A firm manufactures two types of couplings, A and B, each of which
requires processing time on lathes, grinders and polishers. The machine times needed for each
type of coupling are given in the table.
Coupling Time required (hours)
type Lathe Grinder Polisher
A 2 8 5
B 5 5 2
The total machine time available is 250 hours on lathes, 310 hours on grinders and 160 hours
on polishers. The net profit per coupling of type A is $9 and of type B $10. Determine
(a) the number of each type to be produced to maximize profit. (x, y) = (10, 46)
(b) the maximum profit. Pmax = 550
Assignment 2.2.7 A firm produces three types of pumps, A, B, C, each of which requires
the four processes of turning, drilling, assembling and testing
Pump Process time (hours) per pump profit per
type Turning Drilling Assembling Testing pump
A 2 1 3 4 84
B 1 1 4 3 72
C 2 1 2 2 52
Simplex Method
In mathematical optimization theory, the simplex algorithm, created by the North American
mathematician George Dantzig in 1947, is a popular technique for numerical solution of the
linear programming problem. An unrelated, but similarly named method is the Nelder-Mead
method or downhill simplex method due to Nelder and Mead (1965) and is a numerical method
for optimizing many-dimensional unconstrained problems, belonging to the more general class
of search algorithms.
In both cases, the method uses the concept of a simplex, which is a polytope of N + 1 vertices in
N dimensions: a line segment on a line, a triangle on a plane, a tetrahedron in three-dimensional
space and so forth.
The simplex method has been the standard technique for solving a linear program since the
1940’s. In brief, the simplex method passes from vertex to vertex on the boundary of the
feasible polyhedron, repeatedly increasing the objective function until either an optimal solution
is found, or it is established that no solution exists. In principle, the time required might be
an exponential function of the number of variables, and this can happen in some contrived
cases. In practice, however, the method is highly efficient, typically requiring a number of steps
which is just a small multiple of the number of variables. Linear programs in thousands or
even millions of variables are routinely solved using the simplex method on modern computers.
Efficient, highly sophisticated implementations are available in the form of computer software
packages.
Definition 3.1.3 r
Let x1 , x2 , . . . , xr be points in Rn and µ1 , µ2 , . . . , µr a set of scalars, then
P
µj xj is called
j=1
35
3.1. MATHEMATICAL BACKGROUND TO THE SIMPLEX METHOD
Definition 3.1.4 point x is a boundary point of a set S of vectors if for every number >
0(however small), at least one point within the distance of x is in S, and at least one point
within the distance of x is outside S.
Definition 3.1.5
A subset S of Rn is called a convex set if for any two distinct points x1 , x2 ∈ S, then the
line segment joining x1 and x2 lies in S, that is S is a convex linear combination of x1 and x2
if whenever x1 &x2 ∈ S then x = µx1 + (1 − µ)x2 ∈ S for 0 ≤ µ ≤ 1.
Example 3.1.2
Example 3.1.4
Map of the contiguous 48 states (excluding Alaska and Hawaii) dots show where the extreme
points/towns are
Note 3.1.1 Extreme points of a convex set C are always boundary points but not vice versa.
Figure 3.2: A convex set in light blue, and its extreme points in red
Definition 3.1.7 The convex hull of a set P , denoted by P 0 , is the intersection of all convex
sets Ci which contain P that’s P 0 = ∩i Ci such that Ci is convex and P ⊂ Ci .
The convex hull of a finite set of points is called the convex polytope spanned by these points.
Example 3.1.5 (in class) Note that a convex polytope is spanned by it’s extreme points i.e
any point in the polytope can be written as a linear combination of the extreme points.
Definition 3.1.9 A bounded convex set is one which can be enclosed in a rectangle in Rn
Theorem 3.1.6 A closed bounded convex set in Rn is the convex hull of it’s extreme points.
Theorem 3.1.7 A closed and bounded convex set is a convex polytope iff it has finitely many
extreme points.
Definition 3.1.10 A polyhedron is algebraically defined as the set of solutions to the con-
straint set of the linear programming problem or simply for a system of linear inequalities.
Theorem 3.1.8 A convex polyhedron is the intersection of finitely many closed half spaces.
Theorem 3.1.10 In a convex polytope, every point is a convex combination of extreme points.
Theorem 3.1.11 Suppose that the set(s) of all feasible solutions to a linear programming
problem is bounded, then one of the extreme points is an optimal solution.
Note 3.1.2
(i) An unbounded solution set may give an unbounded optimal value (i.e optimal value may
not exist) or a finite optimal value may exist depending on the objective function of the
LP problem.
(ii) Some LP’s may have more than one finite optimal values.
Solution
Both (6, 0) and (3, 2) are optimal solutions then a line segment
= (3 + 3µ, 2 − 2µ)
for 0 ≤ µ ≤ 1. and on this line segment z = 2x1 + 3x2 = 12. that’s any point on the line
segment is an optimal value.
Consider the LP
max z = cx
subject to Ax = b
and x ≥ 0
1. m ≤ n
2. m columns of A are linearly independent. We let the first m columns of A be the ones
which are linearly independent.
Note 3.1.3 The assumptions are reasonable in the above LP ( in canonical form). Let the
columns of A be denoted by aj j = 1, 2, 3, . . . , n
Theorem 3.1.12 Let S be the set of all feasible solutions to the standard LP above, then the
point X = (x1 , x2 , . . . , xm , 0, 0, . . . , 0) is an extreme point of S where xj for j = 1, 2, . . . , m
Theorem 3.1.14 Atmost m components of extreme points of S can be positive and the rest
must be zero.
Note 3.2.1
(ii) Every m linearly independent columns of A is a basis for the standard LP problem.
n
(iii) There are atmost m bases for the standard LP problem.
(iv) The assumption of rank m for the matrix A implies there is atleast one basis for the
standard LP problem.
Definition 3.2.2 B is a feasible basis for the standard LP problem if B is a basis and B −1 b ≥
0.
Example 3.2.1
In standard form
( In this case the interest here is to identify and create basic variables and the optimal value
be obtained) for example we can make x1 and x2 basic variables and have, x1 − 43 x3 + 12 x4 = 32
and x2 + 45 x3 − 21 x4 = 52
is the basis presentation of the problem. An assumption here is that the first m columns of A
make up the basis.
Let bi be the components of B −1 b i = 1, 2, . . . , m
let aj be components of B −1 R j = m + 1, m + 2, . . . , n
So (i) is equivalent to
Equation (?)
Definition 3.2.3 The vector (xB (0), 0) ∈ Rn is a basic solution of the standard LP problem
relative to B.
Definition 3.2.4 The m components of xB (0) are called Basic variables ( or variables in the
solution), the n − m components of xR are called non basic variables ( or variables not in the
solution).
Definition 3.2.5 (xB (0)0) is called a basic feasible solution of the standard LP problem if
(xB (0)0) ≥ 0.
Note 3.2.2 A feasible basis leads(always) to a basic feasible solution since
(xB (0) = B −1 b ≥ 0.
Theorem 3.2.1 For the standard LP problem, every basic feasible solution is an extreme
point and conversely every extreme point is a basic feasible solution.
METHOD
Note 3.2.3 If (1) is not possible then the problem has no solution ( solution space is
empty).
(2) Get another basis B1 such that cB xB (0) < cB1 xB1 (0) and if (2) is not possible then B
gives the required solution.
Consider the general LP problem as in equation ?, Assuming A is an m × k matrix that
is m equalities in k variables, split the matrix A into a square matrix (B) and another matrix
that does not necessarily need be square (R) as in the case below,
A = [B : R], and also decompose X into XB and XR where XB = X1 , X2 , . . . , Xm and
XR = Xm+1 , . . . , Xn thus
xB + B −1 RxR = B −1 b (3.3)
which implies that xB = B −1 b − B −1 )RxR . using this result in the objective function we get,
z = cB [B −1 b − B −1 RxR ] + cR xR .
= cB B −1 b − cB B −1 RxR + cR xR .
= cB B −1 b + [cR − cB B −1 R]xR
= z + [cR − cB B −1 R]xR
z = z + [cR − cB B −1 R]xR
n−m
X
z = z+ [cj − cBi yj ]xj
j=1
X
xi = xi + yij xj (3.5)
j∈J
3x − 4y ≤ 12
x + 2y + z ≥ 4
4x − 2y + 5z ≤ 20
x, y, z ≥ 0
3x − 4y ≤ 12
x + 2y + z ≥ 4
4x − 2y + 5z ≤ 20
x, y, z ≥ 0
Note 3.4.1 The constraints are not changed, when Max to Min: to multiply by a negative in
the objective.
Note 3.4.2 With the nature of our entry and exit criterion, we can only solve a max problem.
Definition 3.5.1 A variable is said to be basic if it appears in only one of the constraint
equality and has a coefficient equal to 1.
(i) coefficient = 1.
Definition 3.5.2 A solution to the linear system of equations is said to be feasible if all of
it’s components are non - negative.
max Z = 2x + y
subject to x + 2y ≤ 5
3x − y ≤ 1
x, y ≥ 0
Solution
(i) Transform the Lp into standard form by introducing slack variables x1 and x2 into the
constraint set to get,
x2
x
1 2 1 0 y = 5 . ∀ x1 , x2 , x3 ≥ 0
3 −1 0 1 x1 1
x 2
1 2 1 0 5
Where A = ,b = , c = (2, 1, 0, 0).
3 −1 0 1 1
1 2
From where we can decompose A and x into B, R, xB & xR with R = and
3 −1
1 0
B=
0 1
2 1 0 0 0
cBj x y x1 x2 xB
0 x1 1 2 1 0 5
0 x2 3 -1 0 1 1
zj − cj −2 −1 0 0 0
X
xi = xi + yij xj (3.9)
j∈J
Suppose we have chosen xk (k ∈ J) to become a basic variable, isolate the xk term from
equation(8)
X
xi = x i + yij xj + yik xk (3.10)
j∈J−{k}
Let xl be the basic variable to be exchanged with xk . Consider the lth constraint
X
xl = xl + ylk xk + ylk xk (3.11)
j∈J−{k}
xl X ylj xl
+ xj + xk = .
ylk ylk ylk
j∈J−{k}
Note 3.5.1 The new value of x with the condition of non negativity implies that yxlkl ≥ 0 iff
ylk > 0. Push yxlkl into the summation and for simplicity take J 0 = {J − {k} + {l}}. in order to
get one equation.
Eliminate xk from the two constraint equations (9) & (10) by multiplying equation (9) by ylk
and (10) by yik and subtract the two equations.
X
xi ylk = xi ylk + ylk yij xj + ylk yik xk
j∈J−{k}
X
xl yik = xl yik + yik ylk xk + yik ylk xk
j∈J−{k}
xi ylk −xl yik
For feasibility the new solution x0 = ylk
should be non negative that is,
xi ylk − xl yik
≥0
ylk
Which implies that,
xi xl
≥
yik ylk
and therefore the criterion for entry of a variable in the basis set of the tableau is given by,
xl xi
= min ∀ ylk ≥ 0
ylk i∈ I yik
Theorem 3.5.1 For a maximization problem a necessary and sufficient condition for the
solution to be optimal is that zj − cj ≥ 0 for all j = n − m, . . . , n.
we note that zj − cj = 0 for the basis vectors.
cj 2 -3 1 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x4 1 -2 4 1 0 0 5
0 x5 2 2 4 0 1 0 5
0 x6 3? 1 -1 0 0 1 7
zj − cj -2 3 -1 0 0 0 0
7 5 5
, ,
3 2 1
The minimum is the first, thus 3 is our pivot.
Since not all entries of zj − cj are positives, we repeat the tableau.
cj 2 -3 1 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x4 0 - 73 13
3
1 0 - 31 8
3
4 14 ?
0 x5 0 3 3
0 1 - 23 1
3
1
2 x1 1 3
- 13 0 0 1
3
7
3
11
zj − cj 0 3
- 53 0 0 2
3
14
3
1/3 8/3
,
14/3 13/3
14
The minimum is the first, thus 3
is our pivot.
cj 2 -3 1 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
33
0 x4 14
4 3 3
1 x3 0 14
1 0 14
- 14 - 17
33
2 x1 14
29 5 3 67
zj − cj 0 7
0 0 14 7 14
Optimal solution is
33 ? 1 33 67
x?1 = , x2 = 0, x?3 = , x?4 = , x?5 = 0, x?6 = 0, z ? =
14 14 14 14
Example 3.5.1 For the following LP problem,
Find an optimal solution to the LP using the primal simplex method(the simplex method)
(Step: d) Write the LP problem in matrix form where identify B, & R and finally put the infor-
mation in the tableau as follows;
−7 9 3 0 0 0 0
cBj x1 x2 x3 x4 x5 x6 xB
0 x4 5 -4 -1 1 0 0 10
0 x5 1 -1 0 0 1 0 4
0 x6 -3 4? 1 0 0 1 1
zj − cj 7 −9 −3 0 0 0 0
The second tableau
−7 9 3 0 0 0 0
cBj x1 x2 x3 x4 x5 x6 xB
0 x4 2 0 0 1 0 1 11
1 1 1 17
0 x5 4
0 4
0 1 4 4
−3 1? 1 1
9 x2 4
1 4
0 0 4 4
1
zj − cj 4
0 − 34 0 0 9
4
9
4
2. Vector into the basis max |(zj − cj )| or min(zj − cj ) or the most minimum.
n o
3. Vector out of the basis mini∈ I yxiki ∀ ylk ≥ 0
Exercise 3.1 For the following LP problems, find their corresponding optimal solutions using
the primal simplex method(the simplex method),
Exercise 3.2
max z = 2x1 − 3x2 + x3
subject to x1 − 2x2 + 4x3 ≤ 5
2x1 + 2x2 + 4x3 ≤ 5
3x1 + x2 − x3 ≤ 7
x1 , x2 , x3 ≥ 0
Exercise 3.3
max z = 3x1 + x2 + x3
subject to x1 − x2 + 2x3 ≤ 3
2x1 + 3x2 − x3 ≤ 2
−3x1 + x2 − 2x3 ≤ 1
x1 , x2 , x3 ≥ 0
Exercise 3.4
max z = x1 − 2x2 + x3
subject to x1 + 2x2 + x3 ≤ 5
2x1 − x2 + x3 ≤ 3
x1 + x2 − 2x3 ≤ 2
x1 , x2 , x3 ≥ 0
Exercise 3.5
max z = 3x1 + 4x2 + x3 + 5x4
subject to x1 + 4x2 + 5x3 + 2x4 ≤ 8
2x1 + 6x2 + x3 + x4 ≤ 3
8x1 + 3x2 + 4x3 + x4 ≤ 7
x1 , x2 , x3 , x4 ≥ 0
M = x1 + x2 + x3
−x1 + x2 + x4 = 5
x1 + 4x2 + x5 = 45
2x1 + x2 + x6 = 27
3x1 − 4x2 + x7 = 24
x3 + x8 = 4
x1 , x2 , x3 , x4 , x5 , x6 , x7 , x8 ≥ 0
x1 + x2 ≤ 10
x1 + 2x2 ≥ 12
2x1 + x2 ≥ 7
x1 , x2 ≥ 0
Since so far we have seen the Primal simplex, which works on ’maximize’, lets first convert it
to maximize
M ax Z = −2x1 − 3x2
subject to
x1 + x2 ≤ 10
−x1 − 2x2 ≤ −12
−2x1 − x2 ≤ −7
x1 , x2 ≥ 0
Still we cant proceed, because the Basic variables will not have a feasible solution x3 = 10, x4 =
−12, x5 = −7 which is degeneracy. Although we had the Basic variables with coefficients
as 1 and appearing once in the constraints, and their number being equal to the number of
constraints.
Degenerate could also have been caused by one of the Basic values equal to zero eg x5 = 0, this
could have been caused by the RHS = 0, e.g instead of −7.
With such, the Primal simplex fails and we go for another bigger method.
are positive. or we say that a solution to a linear programming problem is degenerate if atleast
one of the basic variables takes on a value zero.
The likely occurences of a degenerate solution is due to the occurences of a tie in calculating
x0
xl xi
θ= = min = l
ylk yik yik yl 0 k
then only one of xl and xl0 can leave the basis, leaving the other variable in the basis with value
zero. since xB ≥ 0, the variable with value zero is the one which leaves the basis.
If xl is the one left in the basis with value xl = 0,(when xl0 leaves the basis), then the next
simplex iteration is,
xl xi
= 0 = min provided ylk > 0.
ylk yik yik
if this is the case then the new value of z after xl has left the basis is,
0 xl
Z = z + (ck − zk ) =z
ylk
thus when there is a degenerate solution there may be no change in the value of z,
If degeneracy persists for several successive iterations, there is a possibility of cycling that is a
set of variables may be introduced in such a sequence that the original solution re - occurs in
a later iteration with no change in z.
Definition 3.8.2 Simply Cycling occurs when previously dropped solutions (variables) by the
simplex algorithm are again picked.
Definition 3.8.4 A cycle is a sequence of pivots that returns to the dictionary from which
the cycle began.
Theorem 3.8.1 Cycling Theorem: If the simplex method fails to terminate, then it must
cycle.
(1) If there is no optimal solution, then the problem is either infeasible or un- bounded.
Example 3.9.1
M ax z = 6x1 + 5x2
subject to
2x1 + 4x2 ≤ 20
3x1 + 2x2 ≤ 18
x1 , x2 ≥ 0
x1 = 4, x2 = 3, z = 39
Class 3.9.1
max z = 4x1 + 5x2
subject to
2x1 + 5x2 ≤ 25
6x1 + 5x2 ≤ 45
x1 , x2 ≥ 0
x1 = 5, x2 = 3, z = 35
Example 3.9.2
max z = 3x1 + 9x2 + 12x3 − 5x4
subject to
x1 + x2 ≤ 40
x3 + x4 ≤ 45
x1 + x3 ≤ 30
x2 + x4 ≤ 35
x1 , x2 , x3 , x4 ≥ 0
cj 10 12 12 0 0 0 0
cBj xB x1 x2 x3 s1 s2 s3 x̄B
0 s1 1 2 2 1 0 0 20
0 s2 2 1 2 0 1 0 20
0 s3 2 (2) 1 0 0 1 20
zj − cj -10 -12 -12 0 0 0 0
0 s1 -1 0 (1) 1 0 -1 0
3 −1
0 s2 1 0 2
0 1 2
10
1 1
12 x2 1 1 2
0 0 2
10
zj − cj 2 0 -6 0 0 6 120
12 x3 -1 0 1 1 0 -1 0
5 −3
0 s2 2
0 0 2
1 1 10
3 −1
12 x2 2
1 0 2
0 1 10
zj − cj -4 0 0 6 0 0 120
12 x3 0 4
−3 2 2
12 x1 1 0 0 5 5 5
4
12 x2 0 4
18 8 8
zj − cj 0 0 0 5 5 5
136
Which gives x1 x2 x3 s1 s2 s3 π = 4 4 4 0 0 0 136 :
minz = −136
Note 3.9.1
(i) The first constraint should be the one entered, and the basic variable in that constraint,
put outside.
(ii) Always the variable in the exit, form an Identity matrix in the tableaus.
Assignment 3.9.1 With a relevant LP problem below
max C = x1 + 7x2
subject to − x1 + x2 ≤ 25
5x1 − 3x2 ≥ −45
x1 , x2 ≥ 0
Differentiate between
(i) slack and basic variables.
(ii) feasible and optimal solutions of an LP problem.
(iii) standard and canonical form of an LP problem.
Class 3.9.3
max z = 6x1 + 5x2
subject to 2x1 + 4x2 ≤ 20
−3x1 − 2x2 ≥ −18
x1 , x2 ≥ 0
(i) Formulate its corresponding LP problem (write its objective function and the correspond-
ing constraints).
max z = 6x1 + 5x2
subject to 2x1 + 4x2 ≤ 20
3x1 + 2x2 ≤ 18
x1 , x2 ≥ 0
cj 6 5 0 0 0
cBj xB x1 x2 x3 x4 x̄B
8?
0 x3 0 3
1 - 23 8
2 1
6 x1 1 3
0 3
6
zj − cj 0 -1 0 2 36
cj 6 5 0 0 0
cBj xB x1 x2 x3 x4 x̄B
3
5 x2 0 1 8
- 14 3
6 x1 1 0 - 14 1
2
4
3 7
zj − cj 0 0 8 4
39
Example 3.9.3
(a) (i) State the dual problem to the linear programming problem
Min Z = c0 X
subject to AX ≥ b
X ≥ 0
(ii) What is the dual problem to the following linear programming problem
Min Z = x1 + 4x2 − x4
subject to − x1 + 2x2 − x3 + x4 ≤ 2
2x1 + x2 + 2x3 − 2x4 = 4
x1 − 3x2 + x4 ≥ 5
x1 , x2 and x4 ≥ 0
x3 unrestricted ?
(iii) State the relationship between feasible solutions of the dual linear programming
problems and prove it.
Example 3.9.4 For the following LP problems
(a) What is the elimination criterion in the primal simplex method, and what would be the
effect of violating it?
(b) Using the 2-phase method, solve the problem in [1(a)ii] with the modification that also
x3 ≥ 0 (i.e xi ≥ 0, i=1,2,3,& 4)
Example 3.9.5 Use the primal-simplex algorithm to
max z = 5x1 + 2x2
subject to −x1 + x2 ≥ −2
2x1 + x2 ≤ 7
x1 , x2 ≥ 0
cj 5 2 0 0 0
cBj xB x1 x2 x3 x4 x̄B
1 1
5 x1 1 0 3 3
3
−2 1
2 x2 0 1 3 3
1
1 7
zj − cj 0 0 3 3
17
x1 3
x2 = 1
z 17
Example 3.9.6 Use the primal-simplex algorithm to
max z = −3x1 + 4x2
subject to 2x1 − x2 ≥ −5
x1 + 3x2 ≤ 22
x1 , x2 ≥ 0
Tableau #1
x1 x2 x3 s 1 s2 s3 x̄B
2 2 0 1 0 0 100
2 1 1 0 1 0 100
1 2 2 0 0 1 100
-22 -30 -25 0 0 0 0
Tableau #2
x1 x 2 x3 s1 s2 s3 x̄B
1 0 -2 1 0 -1 0
1.5 0 0 0 1 -0.5 50
0.5 1 1 0 0 0.5 50
-7 0 5 0 0 15 1500
Tableau #3
x1 x2 x3 s1 s2 s3 x̄B
1 0 -2 1 0 -1 0
0 0 3 -1.5 1 1 50
0 1 2 -0.5 0 1 50
0 0 -9 7 0 8 1500
Tableau #4
x1 x2 x3 s1 s2 s3 x̄B
1 0 0 0 0.666667 -0.333333 33.3333
0 0 1 -0.5 0.333333 0.333333 16.6667
0 1 0 0.5 -0.666667 0.333333 16.6667
0 0 0 2.5 3 11 1650
Example 3.9.8
x1 0
x2
0
x3 =
2
x4 8
Z 0
Exercise 3.7
max p = 2x − 3y + 4z
subject to 4x − 3y + z ≤ 3
x + y + z ≤ 10
2x + y − z ≤ 10
x, y, z ≥ 0
Exercise 3.8
min z = x1 + 5x2 − 2x3
subject to x1 + x2 + x3 ≤ 4
x1 ≤ 2
x3 ≤ 3
3x2 + x3 ≤ 6
x1 , x2 , x3 ≥ 0
x1 2
x2 1
x3 = 4
z 1
3 1
max x4 − 20x5 + x6 − 6x7
4 2
1
subject to x1 + x4 − 8x5 − x6 + 9x7 = 0
4
1 1
x2 + x4 − 12x5 − x6 + 3x7 = 0
2 2
x 3 + x6 = 1
x1 , x2 , x3 , x4 , x5 , x6 , x7 ≥ 0
3 1
max x4 − 20x5 + x6 − 6x7
4 2
1
subject to x1 + x4 − 8x5 − x6 + 9x7 = 0
4
1 1
x2 + x4 − 12x5 − x6 + 3x7 = 0
2 2
x 3 + x6 = 1
x1 , x2 , x3 , x4 , x5 , x6 , x7 ≥ 0
3 1
max x4 − 20x5 + x6 − 6x7
4 2
1
subject to x1 + x4 − 8x5 − x6 + 9x7 = 0
4
1 1
x2 + x4 − 12x5 − x6 + 3x7 = 0
2 2
x 3 + x6 = 1
x1 , x2 , x3 , x4 , x5 , x6 , x7 ≥ 0
3 1
max x4 − 20x5 + x6 − 6x7
4 2
1
subject to x1 + x4 − 8x5 − x6 + 9x7 = 0
4
1 1
x2 + x4 − 12x5 − x6 + 3x7 = 0
2 2
x 3 + x6 = 1
x1 , x2 , x3 , x4 , x5 , x6 , x7 ≥ 0
3 1
cj 0 0 0 4
-20 2
-6 0
cBj xB x1 x2 x3 x4 x5 x6 x7 x̄B
1?
0 x1 1 0 0 4
-8 -1 -9 0
1 −1
0 x2 0 1 0 2
-12 2
3 0
0 x3 0 0 1 0 0 1 0 1
−3 −1
zj − cj 0 0 0 4
20 2
6 0
x4 4 0 0 1 -32 -4 36 0
3
x2 -2 1 0 0 4? 2
-15 0
x3 0 0 1 0 0 1 0 1
−7
zj − cj 3 0 0 0 -4 2
33 0
?
x4 -12 8 0 1 0 8 -84 0
−1 1 3 −15
x5 2 4
0 0 1 8 4
0
x3 0 0 1 0 0 1 0 1
zj − cj 1 1 0 0 0 -2 18 0
−1 1 −21
x6 2
1 0 8
0 1 2
0
1 −1 3 3 ?
x5 6 8
0 64
1 0 16
0
3 −1 21
x3 2
-1 1 8
0 0 2
1
1
zj − cj -2 3 0 4
0 0 -3 0
−5
x6 2? -6 0 2
56 1 0 0
1 −2 −1 16
x7 3 3
0 4 3
0 1 0
5
x3 -2 6 1 2
-56 0 0 1
−1
zj − cj -1 1 0 2
16 0 0 0
5 1
x1 1 -3 0 4
20 2
0 0
1? 1 −1
x7 0 3
0 6
-4 6
1 0
x3 0 0 1 0 0 1 0 1
−7 1
zj − cj 0 -2 0 4
44 2
0 0
−1
0 x1 1 0 0 4
-8 -1 9 0
1 −1
0 x2 0 1 0 2
-12 2
3 0
0 x3 0 0 1 0 0 1 0 1
−3 −1
zj − cj 0 0 0 4
20 2
6 0
The problem is Degenerate (RHS = 0) and Cyclic, since the basis vectors in the initial
and final tableaus are the same, yet problem not yet solved
√
Step(a): canonical form the problem:
√
Step(b): standard form:
√
Step(c): RHS = +ve:
√
Step(d): Basic variables.
cj 1 1 0 0 0
cBj xB x1 x2 x3 x4 x̄B
0 x3 1 3 1 0 9
0 x4 2? 1 0 1 8
zj − cj -1 -1 0 0 0
5? −1
0 x3 0 2
1 2
5
1 1
1 x1 1 2
0 2
4
−1 1
zj − cj 0 2
0 2
4
2 −1
1 x2 0 1 5 5
2
−1 3
1 x1 1 0 5 5
3
1 2
zj − cj 0 0 5 5
5
x1 3
x2 = 2
w 5
cj 2 4 3 0 0 0 0
cBj xB x1 x2 x3 x4 x5 x6 x̄B
0 x4 3 4? 2 1 0 0 60
0 x5 2 1 2 0 1 0 40
0 x6 1 3 2 0 0 1 80
zj − cj -2 -4 -3 0 0 0 0
3 1 1
x2 4
1 2 4
0 0 15
5 3? −1
x5 4
0 2 4
1 0 25
−5 1 −3
x6 4
0 2 4
0 1 35
zj − cj 1 0 -1 1 0 0 60
1 1 −1
x2 3
1 0 3 3
0 6 23
5 −1 2
x3 6
0 1 6 3
0 16 32
−5 −2 1
x6 3
0 0 3 3
1 26 32
11 5 2
zj − cj 6
0 0 6 3
0 76 32
Exercise 3.10
Maximize p = x + 2y − z
subject to 2x + y + z <= 14
2x + y + 3z <= 28
2x + 5y + 5z <= 30
Tableau #1
x y z s1 s2 s3
2 1 1 1 0 0 14
2 1 3 0 1 0 28
2 5 5 0 0 1 30
-1 -2 1 0 0 0 0
Tableau #2
x y z s1 s2 s3
1.6 0 0 1 0 -0.2 8
1.6 0 2 0 1 -0.2 22
0.4 1 1 0 0 0.2 6
-0.2 0 3 0 0 0.4 12
Tableau #3
x y z s1 s2 s3
1 0 0 0.625 0 -0.125 5
0 0 2 -1 1 0 14
0 1 1 -0.25 0 0.25 4
0 0 3 0.125 0 0.375 13
Optimal Solution : p = 13; x = 5, y = 4, z = 0
Example 3.9.15 A company manufactures small and large garden benches in two depart-
ments: the machining department and the polishing department. Small bench requires 2 hours
in the machining department and 3 hours in the polishing department. It takes 4 hours to
machine large bench and 3 hours to polish.
The available time for processing the two models is 100 hours a week in the machining
department and 90 hours a week in the polishing department. The contribution margin expected
is $5 for the small bench and $7 for large bench. Find the optimal mix of products a company
should produce to maximize total contribution margin.
x 10
y = 20
π 190
Example 3.9.16 Solve ClassWork :2.2.2 using the primal simplex method.
196
x1 81
x2 0
x3 = 349
162
16135
π 162
Note 3.9.2 The problem Example : 3.9.16 is not realistic, cant produce fractional items.
Example 3.9.17
x = 2; y = 1; z = 1; P = 70
Use the graphical approach to show that the Corner points are found:
A = (0; 0); B = (0; 6); C = (3; 4) and D = (5; 0)
and P is evaluated at each point:
PA = 0; PB = 36; PC = 36; PD = 20
Because adjacent points have an identical value, there are an infinite number of solutions along
the line segment BC.
Solve again using the simplex method.
Assignment 3.9.2
max z = 5x1 + 4x2 + 3x3
subject to 2x1 + 3x2 + x3 ≤ 5
4x1 + x2 + 2x3 ≤ 11
3x1 + 4x2 + 2x3 ≤ 8
xi ≥ 0 ∀i
Assignment 3.9.4
Maximise P = 4x + 3y
subject to −x + y ≤ 4
x + 2y ≤ 14
2x + y ≤ 16
x, y ≥ 0
Assignment 3.9.5
Maximise P = 2x + 6y + 4z
subject to 2x + 5y + 2z ≤ 38
4x + 2y + 3z ≤ 57
x + 3y + 5z ≤ 57
x, y, z ≥ 0
Assignment 3.9.6
Maximise W = 3x + 4y + 5z
subject to 2x + 4y + 3z ≤ 80
4x + 2y + z ≤ 48
x + y + 2z ≤ 40
x, y, z ≥ 0
Assignment 3.9.7
Minimize D = −4x − 5y
subject to 2x + 5y ≤ 25
6x + 5y ≤ 45
x, y ≥ 0
4.1 Introduction
So far during the finding of an optimal solution to a maximization problem using the primal
simplex method the assumption that there exists m basis vectors has been used. suppose we
have less than m vectors then we introduce another variable to make them m.
Definition 4.1.1 A technique for solving linear programming problems in which artificial
variables are assigned cost coefficients which are a very large number M , say, M = 1035 .
subject to Ax = b
and x ≥ 0
With
(i) Basic variables not feasible (RHS=-ve), which results into
(ii) less than m basic variables in an m constraint problem (since with a negative in a standard
form, not feasible, multiply by a negative-when already have the equal sign- makes what
had been a basic variable no longer, since coefficient 1 will now be −1).
Let the problem be transformed to,
Max z = cx − M S (4.2)
subject to Ax + S ≤ b
and x, S ≥ 0
We add artificial variables si to have more Basic variables, and subtract them from the objective
but all with coefficient −M on each. e.g
Max z = cx − M s1 − M s2 − M s3
73