MABA6-MathematicalProgramming 1
MABA6-MathematicalProgramming 1
Part 6: Mathematical
Programming
1
1 1
Mathematical Programming
• Linear Programming
• Transportation Problem
• Assignment Problem
2
Linear Programming
3
Linear Programming
Assumptions:
•Linearity
•Certainty
•Devisability
4
Examples
5
Examples
6
Examples
7
Examples
8
Examples
Estimated man-hours and income per acre planted in each of the three
crops are:
9
Examples
10
Examples
Relax and Enjoy has provided with an advertising budget of $300,000 for
the first month’s campaign.
In addition, the company has a wish to have at least 10 television
commercials, and atleast 50,000 potential purchasers must be reached
during the month. Formulate the problem of media selection.
11
Standard Form
12
Example
13
Methods for the LPP
14
Solutions for the LPP
15
Solutions
Basic Solution Assume that the standard form of an LPP has ‘m’ equations with
‘n’ variables (m ≤ n) together with Non-negative conditions. The unique solutions
resulting from setting (n m) variables to zero such that the remaining m
columns linearly independent are called basic solutions.
Basic Feasible Solution If a basic solution satisfies the Non-negative
conditions, it is named as basic feasible solution.
Basic Infeasible Solution If a basic solution does not satisfy the Non-negative
conditions, it is named as basic infeasible solution.
Optimum Solution If a basic feasible solution maximizes or minimizes the
objective function of the problem, it is named as an optimum solution.
Unique Optimum Solution It means that the optimum value is attained for
only one feasible solution.
Multiple Optimum Solution It means that the same optimum value is attained
for more than one feasible solution.
Basic and Non-basic Variables The variables set equal to zero are (refer to
basic solution definition) called non-basic variables, the remaining variables are
called basic variables.
Degenerate Solution If one or more basic variables become zero, that solution
is named as degenerate solution.
16
Examples
17
Convex Set
18
Graphical Solutions
19
Examples
1) Max Z 3x1 9x2; st. x1 x2 ≤8; x1 2x2 ≤4, x1, x2 ≥0
2) Min Z 2x1 3x2; s.t. x1 x2 ≤4; 6x1 2x2 ≥8; x1 5x2 ≥4; x1 ≤3; x2 ≤3; x1, x2 ≥0
3) Max Z 4x1 5x2 s.t. x1 x2 ≥ 1; –2x1 x2 ≤1; 4x1 –2x2 ≤1; x1, x2 ≥0
4) Max Z = 6x1 − 2x2 st. 2x1 − x2 ≤ 0; x1 ≤ 4; x1, x2 ≥ 0
5) Max Z x1 x2 st. x1 x2 ≤1; −3x1 x2 ≥3; x1, x2 ≥0
6) Max Z −0.1x1 0.5x2 s.t. x1 x2 ≤20; 2x1 5x2 ≤80; −0.1x1 0.5x2 8; x1, x2
≥0
7) Max Z = 5x+6y st. 4x+2y ≤ 10; 4x+2y ≥ 20; x, y ≥ 0
8) Min. Z = 4x+6y st. 4x+2y = 10; 4x+2y ≥ 20; x, y ≥ 0
9) Min Z = 5x + 7y st. 2x + 3y ≥ 6; 3x − y ≤ 15; −x + y ≤ 4; 2x + 5y ≤ 27; x,y ≥ 0
10) Min Z = 5x+5y, st. 2x+y ≥ 15; x+4y ≥ 25; x+2y ≥ 20; x, y ≥ 0
Given x,y ≥ 0, find Max and Min of:
11) Z = 2x + 3y st. 2x + 3y ≥ 6; 3x−y ≤ 15; −x + y ≤ 4; 2x + 5y ≤ 27
12) Z = 6x + 4y st. −x + y ≤ 12; x + y ≤ 24; 2x + 5y ≤ 80
13) Z = 6x + 5y st. x + y ≥ 6; 2x +y ≥ 9
14) Z = x – y st. x + y ≥ 6; 2x +y ≥ 9
15) Z = 5x + 3y st. 2x + 0.6y ≤ 24; 2x + 1.5y ≤ 80
20
Examples
1) A sick patient has been advised by his doctor that his diet must contain at least 4000 units
of vitamins, 50 units of minerals and 1400 units of calories. Two foods, F1 and F2, are
available at a cost of $4 and $3 per unit, respectively. One unit of food F1 contains 200
units of vitamins, 1 unit of mineral and 40 units of calories. One unit of food F2 contains
100 units of vitamins, 2 units of minerals and 40 units of calories. Formulate the above
problem as an LPP and solve using graphical method.
2) Memory Chip Data for CPUs:
How many of two types of high-speed computer chips should to be manufactured weekly to
maximize their profits?
21
Examples
3) Consider a toy maker that carves wooden soldiers. The company specializes in two
types: Confederate soldiers and Union soldiers. The estimated profit for each is $28 and
$30, respectively. A Confederate soldier requires 2 units of lumber, 4 hours of carpentry,
and 2 hours of finishing in order to complete the soldier. A Union soldier requires 3 units of
lumber, 3.5 hours of carpentry, and 3 hours of finishing to complete. Each week the
company has 100 units of lumber delivered. The workers can provide at most 120 hours of
carpentry and 90 hours of finishing. Determine the number of each type of wooden soldiers
to produce maximize weekly profits.
22
Simplex Methods
23
Ordinary Simplex Method
24
Notations Used
• B — Basis elements
• CB — Cost coefficient of the basic element in Cj row
• Cj — Coefficient of the corresponding variable in the objective function.
(j 1, 2, …, n)
• xj — Variable (for j 1, 2, ...n)
• XB — Solution to the basic elements.
• Zj — CB xj ( j 1, 2, n) (Multiply the corresponding entries and add it)
• Zj –Cj — CB xj Cj ( j 1, 2, n) (called net evaluation)
• PC — Pivotal column
• PR — Pivotal row
• PE — Pivotal element
• q — XB/PC
25
The Structure of a Simplex Table
26
Examples
1) Max Z 400x1 100x2 s.t. 4x1 2x2 ≤1600; 5/2x1 x2 ≤1200; 9/2x1 3/2x2 ≤1600; x1, x2
≥0
2) Max Z 12x1 3x2 x3 s.t. 10x1 2x2 x3 ≤100; 7x1 3x2 2x3 ≤77; 2x1 4x2 x3
≤80; x1, x2, x3 ≥0
3) Max Z 20x1 6x2 8x3 s.t. 8x1 2x2 3x3 ≤250; 4x1 3x2 ≤150; 2x1 3x3 ≤90; x1, x2,
x3 ≥0
4) Max Z 50x1 20x2 30x3 s.t. 5x1 x2 7x3 ≤5; 5x1 x2 6x3 ≤6; 3x1 x2 9x3 ≤3; x1,
x2, x3 ≥0
5) Max Z 2x1 5x2 s.t. x1 4x2 ≤24; 3x1 x2 ≤21; x1 x2 ≤9; x1, x2 ≥0
6) Max Z 4x1 5x2 9x3 11x4 s.t. x1 x2 x3 x4 ≤15; 7x1 5x2 3x3 2x4 ≤120; 3x1
5x2 10x3 15x4 ≤100; x1, x2, x3, x4 ≥0
7) Max Z 3x1 4x2 x3 7x4 s.t. 8x1 3x2 4x3 x4 ≤7; 2x1 6x2 x3 5x4 ≤3; x1 4x2
5x3 2x4 ≤8; xj ≥0 (j 1, , 4)
8) Max Z 4x1 5x2 s.t. x1 3x2 ≤12; 4x13x2 ≤24; x1, x2 ≥0;
9) Max Z x1 2x2 s.t. x1 2x2 ≤8; x1 2x2 ≤12; x1 2x2 ≤3; x1, x2 ≥0;
10) Max Z 50x1 70x2 s.t. 120x1 120x2 ≤8400; x1 2x2 ≤100; 2x1 x2 ≤120; x1, x2 ≥0
11) Max Z 3x1 5x2 s.t. 3x1 2x2 ≤18; x1 ≤4; x2 ≤6; x1, x2 ≥0
12) Max Z x1 x2 3x3 s.t. x1 x2 x3 ≤10; 2x1 x3 ≤2; 2x1 2x2 3x3 ≤6; x1, x2, x3 ≥0
27
Examples
1) Suppose that a small pharmaceutical firm produces three types of drugs, x1, x2, and x3,
using three types of chemicals, A, B, and C, the maximum available quantities of which are
45, 40, and 25 units, respectively. The firm needs to use 1, 0, and 2 units, respectively, of A,
B, and C to produce one unit of x1; 0, 2, and 1 units of A, B, and C, respectively, to produce
one unit of x2; and 3, 2, and 0 units of A, B, and C, respectively, to produce one unit of x3.
The revenue that the firm obtains from one unit of x1, x2, and x3 is $6, $5, and $3,
respectively. Find the quantities of the drugs that the firm must produce to maximize its
revenue.
2) Assume that a company employs three salespeople, A, B, and C, temporarily to sell its
three products, x1, x2, and x3. It was directed that 1, 0, and 2 hours of A, B, and C to be spent
for the sale of 1 unit of x1; 0, 2, and 1 hours of A, B, and C to be spent for the sale of 1 unit of
x2; and 4, 2, and 0 hours of A, B, and C to be spent for the sale of 1 unit of x3. The minimum
number of hours to be spent by A, B, and C must be 40, 45, and 30 hours, respectively. The
cost of sale of one unit of x1, x2, and x3 is $4, $3, and $2, respectively. How many units of the
three goods should be sold so that the company’s total cost will be minimum?
3) An auto company manufactures cars and trucks. Each vehicle must be processed in the
paint shop and body assembly shop. If the paint shop where only painting truck, takes place
40 per day could be painted. If the paint shop where only painting car, 60 per day could be
painted. If the body shop where only producing cars, it could process 50 per day. If the body
shop where only producing trucks, it could process 50 per day. Each truck contributes
$10,000 to profit, and each car contributes $8000 to profit. Use linear programming to
determine a daily production schedule that will maximize the company’s profits.
28
Big-M Method
29
Examples
1) Min Z 12x1 20x2; s.t. 6x1 8x2 ≥ 100; 7x1 12x2 ≥120; x1, x2 ≥0
2) Max Z 3x1 2x2; s.t. 2x1 x2 ≤2; 3x1 4x2 ≥12; x1, x2 ≥0
3) Max Z 8x2; s.t. x1 – x2 ≥0; 2x1 3x2 ≤6; x1, x2 unrestricted.
4) Max Z 6x1 4x2; s.t. 2x1 3x2 ≤30; 3x1 2x2 ≤24; x1 x2 ≥3; x1, x2 ≥0
5) Min C = 8x1 +10x2, st. x1 +3x2 ≥ 30; 4x1 +x2 ≥ 20; x1, x2 ≥ 0;
6) Min C = 5x1 +3x2, st. 6x1 + 3x2 ≥ 30; x1 + 4x2 ≥ 20; x1, x2 ≥ 0;
6) Min C = 4x1 + 3x2 + 2x3, st. x1 + 4x2 + x3 ≥ 40; 5x1 + 4x2 +x3 ≥ 50; 2x1 + x2 + x3 ≥ 60;
x1, x2, x3 ≥ 0;
7) Min C = 8x1 + 5x2 + 3x3, st. 4x2 + x3 ≥ 20; 5x1 + 4x3 ≥ 40; 4x1 + 4x2 ≥ 40; x1, x2, x3 ≥ 0
8) Max Z 2x13x2 s.t. x1 2x2 ≤4; x1 x2 3; x1, x2 ≥0
9) Min Z 5x 6y; s.t. 2x 5y ≥1500; 3x y ≥1200; x, y ≥0
10) Max Z 2x1 x2 x3 s.t. x1 x2 2x3 ≤5; 2x1 3x2 4x3 12; x1, x2, x3 ≥0
11) Max Z 2x1 x2; s.t. x1 x2 ≤10; x1 ≤20; x1, x2 ≥0
12) Max Z x1 2x2 3x3 x4 s.t. x1 2x2 x3 15; 2x1 x2 5x3 20; x1 2x2 x3
x4 10; x1, x2, x3, x4 ≥0
13) Max Z 3x1 2x2 x3 s.t. 2x1 5x2 x3 12; 3x1 4x2 11; x2, x3 ≥0 and x1 is
unrestricted.
30
Examples
31
Two Phases Method
32
Eg. Solve the following problem using two-phase
simplex method:
1) Min. Z x1x2; s.t. 2x1 4x2 ≥4; x1 7x2 ≥7; x1, x2 ≥0
2) Min Z x1 2x2 3x3 subject to 2x1 x2 3x3 2; 2x1 3x2 4x3
1; x1, x2, x3 ≥0
3) Max Z 2x1 x2 x3 s.t. 4x1 6x2 3x3 ≤8; 3x1 6x2 4x3 ≤1; 2x1
3x2 5x3 ≥4;
x1, x2, x3 ≥0
4) Max Z 5x1 4x2 3x3 s.t. 2x1 x2 6x3 20; 6x1 5x2 10x3 ≤76;
8x1 3x2 6x3 ≤50; x1, x2, x3 ≥0
5) Min Z 2x1 x2 3x3 s.t. 5x1 2x2 ≥5; 3x1 2x2 4x3 ≥7; 2x1
5x3 ≤3; x1, x2, x3 ≥0
6) Max Z 5x1 x2 s.t. 2x1 x2 6; x1 x2 ≤4; x1 2x2 ≤5; x1, x2 ≥0
7) Min Z 3x1 x2 s.t. x1 2x2 ≥2; x1 x2 ≥3; x1, x2 ≥0;
33
Example
1) M/s Funschool Toys Ltd. manufactures two models of toys T1 and T2.
Each of these products must go through two manufacturing processes A
and B. Each unit of T1 requires one hour in Process A and 1. hours in
Process B; each unit of T2 requires 2 hours in Process A and 3/4 hour in
process B. The machinery supporting Process A currently has a weekly
machine hour capacity of 100 hours, and the weekly capacity of process
B machinery is 90 machine hours. Per unit profits on T1 and T2 are $100
and $150 respectively. Determine the optimal product mix for Funschool
Ltd.
2) The emergency Ward of M/s. Apollo Hospitals Ltd., schedules Nurses to
come on duty every 3 hours for a 6 hours shift. The shift times and the
minimum number of nurses required during each 3 hours time interval
are given below. Determine the schedule that will minimize the total
number of nurses employed in said Emergency ward.
34
Dual problems
35
Dual problems
36
Relationships between primal and dual LP
problems
• If the primal LP problem is a maximization (minimization) problem, then its dual
is a minimization (maximization) problem. This means that we have to change
the ≤ (≥) sign to ≥ (≤) in the constraints when we set up the dual of a primal
maximization (minimization) problem.
• The matrix of the coefficients of the constraints of the dual problem is the
transpose of the matrix of the coefficients of the constraints of the primal
problem. Therefore, when we set up the dual of a LP problem we need to
transpose the matrix of the coefficients of the constraints.
• The column vector of the constants (the RHS) in the dual problem is the
transpose of the row vector of the coefficients of the objective function in the
primal problem. This implies that when we set up the dual of a LP problem we
need to transpose the coefficients of the objective function in the primal problem
to form the column vector of the constants in the dual problem.
• The row vector of the coefficients of the objective function in the dual problem is
the transpose of the column vector of constants (the RHS) in the primal problem.
Therefore, when we set up the dual of a LP problem we need to transpose the
column vector of constants in the primal problem to obtain the row vector of the
coefficients of the objective function in the dual problem.
• The dual of a dual LP problem is the primal LP problem.
• The variables in both the primal problem and the dual problem are nonnegative.
37
Relationships between primal and dual LP
problems
38
Examples: Find the dual problem
1) Max. z 80x1 90x2 s.t. 3x1 5x2 ≤30; 3x1 2x2 ≤21; x1, x2 ≥0
2) Min. z 10x1 8x2 s.t. x1 2x2 ≥5; 2x1 x2 ≥12; x1 3x2 ≥4; x1 ≥0; x2
unrestricted.
3) Max. z 10x1 20x2; s.t. x1 x2 4; 2x1 3x2 ≤7; x1, x2 ≥0
4) Max Z x1 x2 3x3; s.t. x1 x2 x3 ≤ 10; 2x1 x3 ≤2; 2x1 2x2 3x3 ≤6;
x1, x2, x3 ≥0
5) Min Z 4x1 6x2 18x3; s.t. x1 x2 ≥3; x2 2x3 ≥5; x1, x2, x3 ≥0
6) Max Z x1 2x2 3x3; s.t. 2x1 x2 3x3 2; 2x1 3x2 4x3 1; x1, x2, x3
≥0
7) Min Z x1 x2; s.t. 2x1 x2 ≥4; x1 7x2 ≥7; x1, x2 ≥0
8) Max Z 2x1 5x2 3x3; s.t. 2x1 4x2 x3 ≤8; 2x1 2x2 3x3 ≥7; x1
3x2 5x3 ≥2; 4x1 x2 3x3 ≤4; x1, x2, x3 ≥ 09
9) Max Z 3x1 2x2 4x3 6x4; s.t. x1 x2 x3 x4 25; 2x1 3x2 x3 x4
≤40;
7x1 3x2 4x3 x4 ≤35; 6x1 6x2 x3 3x4 ≥28; x1, x3 ≥0; x2, x4 ≤0;
10) Min Z 4x1 3x2 6x3; s.t. x1 x3 ≥2; x2 x3 ≥5; x1, x2, x3 ≥0
39
Duality Theorems
40
Canonical Form
41
Dual Simplex Method
42
Examples
1) Max Z 3x1 2x2 s.t. 2x1 x2 ≤5; x1 x2 ≤3; x1, x2 ≥0
2) Max Z 2x1 9x2 24x3 8x4 5x5; s.t. x1 x2 2x3 x5 x6 1; 2x1 x3 x4
x5 x7 2; xj ≥0 (for j 1, 2, , 7)
3) Max Z 2x1 x2; s.t. x1 2x2 ≤10; x1 x2 ≤6; x1 x2 ≤2; x1 2x2 ≤1; x1, x2
≥0
4) Min Z 3x1 x2; s.t. x1 x2 ≥1; 2x1 3x2 ≥2; x1, x2 ≥0
5) Min Z x1 2x2 3x3 4x4; s.t. x1 2x2 2x3 3x4 ≥30; 2x1 x2 3x3 2x4
≥20; xj ≥0 (for j 1, 2, 3, 4)
6) Min Z 6x1 7x2 3x3 5x4; s.t. 5x1 6x2 3x3 4x4 ≥12; x2 5x3 6x4 ≥10;
2x1 5x2 x3 x4 ≥8; xj ≥0 (for j 1, 4)
7) Max Z 3x1 2x2; s.t. x1 x2 ≥1; x1 x2 ≤7; x1 2x2 ≥10; x2 ≤3; x1, x2 ≥0
8) Min Z x1 2x2 5x3; s.t. | x1 10x2 3x3| ≤15; 2x1 x2 x3 ≥10; x1, x2, x3
≥0
9) Min Z 2x1 2x2; s.t. 2x1 4x2 ≥1; x1 2x2 ≥1; 2x1 x2 ≥1; x1, x2 ≥0
10) Max Z 3x1 2x2; s.t. x1 x2 ≥1; x1 x2 ≤ 7; x1 2x2 ≥ 10; x2 ≤3; x1, x2 ≥0
11) Max Z 5x1 2x2 3x3; s.t. 2x1 2x2 x3 ≥2; 3x1 4x2 ≤3; x2 3x3 ≤5; x1,
x2, x3 ≥0
43
Transport Problem
44
Linear Programming form
45
Solutions
• Basic and Non-basic Cells. If xij be the allocation to the cell (i, j) and
xij 0 is called positive allocation and the cell (i, j) is called
occupied/basic cell. When xij 0 for any cell (i, j), it is named as non-
basic cell (the value need not be represented in that cell).
• Feasible Solution. In a transportation problem, a solution is called
feasible if the set of xij values (xij 0) satisfies all the supply and
demand requirements.
• Basic Feasible Solution. If a feasible solution containing exactly (m
n − 1) basic/occupied cells then it is called basic feasible solution
(non-degenerate solution).
• Degenerate Basic Feasible Solution. If a feasible solution
containing less than (m n 1) basic cells, then it is called degenerate
basic feasible solution (degenerate solution).
• Optimal Solution. A basic feasible solution that minimizes (or
maximizes the profit) the total transportation cost is called optimal
solution.
46
Solutions
• TP Transportation Problem
• S Supply corresponding to the origin
• TS Total Supply • MODI Modified Distributive
• D Demand corresponding to the column Method
• TD Total Demand • M Number of Origins (rows)
• NWCR North West Corner Rule • N Number of Destinations
• RMM Row Minima Method (columns)
• • A Actual Allocation of Units
CMM Column Minima Method
• • TC Total Transportation Cost
LCM Least Cost Method
• • RS Remaining Supply
VAM Vogel’s Approximation Method
• RD Remaining Demand
• VN Vogel Number
• εThe Least Positive Quantity
(106)
• K Number of Basic Cells
47
Solutions
48
Methods to find the initial basic feasible
solution
1. North West Corner Rule (NWCR)
2. Row/Column Minima Method (RMM)
3. Least Cost Method or Matrix Minima Method
(LCM/MMM)
4. Vogel’s Approximation Method (VAM)
49
North-West conner rule
50
Examples
1) Write down the initial basic feasible solution
to the 1st transportation problem by NWCR 1
2) Convert the unbalanced transportation )
problem (the 2nd one) into a balanced one.
3) Find an initial basic feasible solution of the 3rd
problem using NWCR
2
)
3
)
51
Row/Column minima method
52
Examples
1) Solve the 1st transportation problem using row
minima method.
2) Solve the 2nd transportation problem using
column minima method
53
Least Cost/Matrix Minima Method
54
Examples
Obtain an initial basic feasible
solution to the following 1)
transportation problem using
matrix minima method.
2)
55
Vogel’s Approximation Method
(VAM)
• N Number
• CL Close
• VN Vogel Number (penalty cost)
• Rm mth Row
• RVN Row Vogel Number
• Cn nth Column
• CVN Column Vogel Number
• UG Units Given
• R1 1st Row
• C1 1st Column
• SC Selected Cell
56
Examples
1) Find the initial basic feasible solution
of the following transportation problem 1)
(1st table) by VAM.
2) Solve the transport problem (2nd table)
3) The following table (3rd table)
shows all the information
regarding the available supply at
each warehouse, the
requirements of each market and
the unit transportation cost from
each warehouse to each market.
Find the initial solution using
VAM.
57
Stepping Stone Method/Modified Distributive
Method
• NBC Number of Basic Cells
• I Number of Iterations
• BCs Basic Cells
• VU Vertically Up
• VD Vertically Down
• HR Horizontally
Right
• HL Horizontally Left
• R Row
• C Column
• H Horizontal
• V Vertical
58
Examples
1) Solve the following transport problem:
(a) (b)
59
Examples
1)
2)
60
Assignment Problem
Consider n jobs and n persons. Assume that each job can be done only by one
person and the expense a person required for completing the ith job (i 1, 2, n)
by the jth person (j 1, 2, n) is denoted by a real number Cij. On the whole, this
model deals with the assignment of n candidates to n jobs in such a way that to
minimize the time (cost) for over all completion of the jobs.
61
Hungarian Algorithm
62
Examples
1) 2) 3)
63
Examples
5) Solve the following problem to maximize the profit. Which job is to be
left?
6) Impossible Assignment
64
65