1.1. Formulation of LPP: Chapter One: Linear Programming Problem/LPP
1.1. Formulation of LPP: Chapter One: Linear Programming Problem/LPP
1.1. Formulation of LPP: Chapter One: Linear Programming Problem/LPP
The term linear implies that all the mathematical relations used in the problem are linear
or straight-line relations, while the term programming refers to the method of determining
a particular program or plan of action, i.e., the use of algorithms that is a well-defined
sequence of steps that will lead to an optimal solution. Taken as a whole, the term
linear programming refers to a family of mathematical techniques for determining the
optimum allocation of resources and obtaining a particular objective when there are
alternative uses of the limited or constrained resources.
Formulating LP models: is to define a problem, careful formulation of the model that will be
used to solve the problem is important. Linear programming algorithms (solution techniques)
are widely used and understood and computer packages are readily available for solving LP
problems. Consequently, obtaining solutions is not the real issue, what is very important to
note is failure to check that all constraints have been accounted for and have been correctly
formulated results in ill-structuring of the model that can easily lead to poor decisions.
Example 1
ABC private limited company is engaged in the production of power and traction transformers.
Both of these categories of transformers pass through three basic processes: core preparation,
core to coil assembly, and vapor phase drying. A power transformer yields a contribution
of Birr 50,000 and traction transformer contributes Birr 10,000. The time required in the
production of these two products in terms of hours for each of the processes is as follows.
If the capacities available are 1000, 1500, and 750 machine hours in each processes respectively,
formulate the problem as LP?
Solution
Since the products to be produced are power and traction transformers using the
available resource to attain the objective set, we consider them as decision variables. This is
because the organization is problem here is how many of each product to produce in
order to attain the objective, which requires the management decision.
From the problem above, we understand that the problem is maximization problem. Hence,
This is because, each unit of X1 contributes Birr 50,000 and X2 contributes Birr 10,000 to
objective function.
Here we have two constraints: structural and non-negativity constraints. The structural constraint
is the amount of machine hours available in each process.
160X1 + 30X2 ≤ 1500 hrs - Core to Coil Assembly Machine hour constraint
X1 X2 ≥ 0
Subject to:
X1 X2 ≥ 0
Important Definitions
Solution The set of values of decision variables xj (j = 1, 2, 3… n) which satisfy the constraints
of an LP problem is said to constitute solution to that LP problem.
Feasible solution: The set of values of decision variables xj (j = 1,2,…… n) which satisfy all
the constraints and non- negativity conditions of an LP problems simultaneously is said
to constitute the Feasible solution to that LP problem.
Infeasible solution The set of values of decision variables xj (j = 1,2,Ö, n) which do not satisfy
all the constraints and non- negativity conditions of an LP problems simultaneously is
said to constitute the infeasible solution to that LP problem.
Basic solution For a set of m simultaneous equations in n variables ( n>m), a solution obtained
by setting ( n-m) variables equal to zero and solving for remaining m equations in m
variables is called a basic solution. The (n-m) variables whose value did not appear in this
solution are called non-basic variables and the remaining m variables are called basic
variables.
Basic feasible solution A feasible solution to LP problem which is also the basic
solution is called the basic feasible solution. That is, all basic variables assume non-negative
values. Basic feasible solutions are of two types:
Optimal Basic feasible solution A basic feasible solution which optimizes the objective
function value of the given LP problem is called an optimal basic feasible solution.
Unbounded solution A solution which can increase or decrease the value of the LP
problem indefinitely is called an unbounded solution.
Step 1: Plot each of the constraints- First, treat all constraints as equations. Then draw the line
for each constraint equation, including non-negativity constraint equations. That is, the constraint
boundary equation for any constraint is obtained by replacing its ≤, or ≥, signs by an = sign.
Step 2: Identify the feasible region- When we shade the relevant region for each of the
constraints in the problem, we will find a region that satisfies all the constraints in the problem.
This region is called the feasible region. It is from those points in this region that we can choose
to optimize our objective function. In a passing note that it is possible for a problem to have no
feasible region at all, the feasible region consists of feasible solutions.
Step 3: Determine the optimal point- Finally, we will choose the point in the feasible region
that will give us the optimal value for the objective function. Determination of the optimal point
can be done using the following steps:
1. Solve the simultaneous equations at each corner point to find the solution values at each
corner point.
2. Substitute these values into the objective function to find the set of values those results in
the optimum Z value.
Corner points: The points of intersection of the constraint equations in a LP problem are the
corner-point solutions of the problem.
A corner-point feasible (CPF) solution is a solution that lies at a corner of the feasible region.
It is a point that can’t be determined as a convex combination of two other points in the feasible
region.
Required
1. Develop LP model
2. Solve the model using graphic method
Example 2: Suppose a company produces metal doors and windows using three plants (1, 2, and
3). For a given week the company can operate plant 1 up to 4 hours, plant 2 up to 12 hours, and
plant 3 up to 18 hours. Producing a metal door requires 1 hour of processing in plant 1, 0 hours
in plant 2 and 3 hours in plant 3. Producing a window requires no processing in plant 1, but 2
hours of processing in each of the other plants. The profits per unit of door and window are 3
thousand and 5 thousand birr respectively. Table below shows a summary of the relevant data.
Required
1. Develop LP model
2. Solve the model using graphic method
Example:3
Subject to
3x1 + 2x2 ≥ 60
7x1 + 2x2 ≥ 84
3x1 +6x2 ≥ 72
x1 ≥ 0 , x2 ≥ 0
Solution
3x1 + 2x2 = 60
Put x1 =0, then x2 = 30
Put x2 =0, then x1 = 20
The coordinates are (0, 30) and (20, 0)
7x1 + 2x2 = 84
Put x1 =0, then x2 = 42
Put x2 =0, then x1 = 12
The coordinates are (0, 42) and (12, 0)
The third constraint 3x1 +6x2 ≥ 72, written in a form of equation
3x1 +6x2 = 72
Put x1 =0, then x2 = 12
Put x2 =0, then x1 = 24
The coordinates are (0, 12) and (24, 0) The graphical representation is:
The corner points of feasible region are A, B, C and D. So the coordinates for the
corner points are
A (0, 42)
B (6, 21) (Solve the two equations 7x1 + 2x2 = 84 and 3x1 + 2x2 = 60 to get the
coordinates)
C (18, 3) Solve the two equations 3x1 +6x2 = 72 and 3x1 + 2x2 = 60 to get the
coordinates)
D (24, 0)
We know that Min Z = 10x1 + 4x2
At A (0, 42)
Z = 10(0) + 4(42) = 168
At B (6, 21)
Z = 10(6) + 4(21) = 144
At C (18, 3)
Z = 10(18) + 4(3) = 192
At D (24, 0)
Z = 10(24) + 4(0) = 240
The minimum value is obtained at the point B. Therefore Min Z = 144 and x1 = 6, x2
= 21
In practice, most problems contain more than two variables and are consequently too large to be
tackled by conventional means. Therefore, an algebraic technique is used to solve large problems
using Simplex Method. Simplex method is carried out through different stages systematically
step by step, and finally the maximum or minimum values of the objective function are attained.
The simplex method solves the linear programming problem in different levels to improve the
value of the objective function. The simplex approach not only yields the optimal solution but
also other valuable information to perform economic and 'what if' analysis. To apply simplex
approach there are different conditions
1. The RHS of each of the constraint should be non-negative. If an LPP has a constraint for
which a negative resource value is given, it should be in the first step converted in to
positive value by multiplying both sides of the constraint by -1.
After the solution is obtained, we shall substitute the difference of the values of x4 and x5 as the
value of x3.
Three types of additional variables are used in simplex method such as,
(a) Slack variables (S1, S2, S3..…Sn): Slack variables refer to the amount of unused resources like
raw materials, labor and money.
(b) Surplus variables (-S1, -S2, -S3..…-Sn): Surplus variable is the amount of resources by which
the left hand side of the equation exceeds the minimum limit.
(c) Artificial Variables (a1, a2, a3.. …an): Artificial variables are temporary slack variables which
are used for purposes of calculation, and are removed later.
The above variables are used to convert the inequalities into equality equations, as given in the
Table next slide.
Step 5: Take the largest coefficient in the objective function, Zj to identify the key column (the
corresponding variable is the entering variable of the next table).
Step 6: Find the ratio between the solution value and the coefficient of the key column. Enter
the values in the minimum ratio column.
Step 7: Take the minimum positive value available in the minimum ratio column to identify the
key row. (The corresponding variable is the leaving variable of the table).
Step 8: The intersection element of the key column and key row is the pivotal element.
Step 9: Construct the next table by eliminating the leaving variable and introducing the entering
variable.
Step 10: Convert the pivotal element as 1 in the next table and compute the other elements in
that row accordingly. This is the pivotal equation row (not key row).
Step 11: Other elements in the key column must be made zero. For simplicity, form the
equations as follows: Change the sign of the key column element, multiply with pivotal
equation element and add the corresponding variable.
Step 12: Check the values of objective function. If there are positive values, the solution
is not an optimal one; go to step 5. Else, if all the values are negative, optimality is
reached.
x1, x2 >= 0
2x1 + 3x2 + s1 = 60
4x1 + 3x2 + s2 = 96
The value of S1, depends on the value of 2x1 + 3x2 = 60. It may vary from the rang 0 to 60.
The value of S2 depends on the value of 4x1 + 3x2 = 96 and it may vary from the range 0 to 96.
• The objective function should also modified. Because objective function for the simplex
method should contains every variables in the system including slack or other variables.
2. Obtaining the initial tableau and solution using the standardized form. The initial simplex
tableau is as follow
4x1 + 3x2 + S2 = 96
1.4. Big „m‟ method
The Big-M Method is a technique, which is used in removing artificial variables from the basis.
In this method; we assign coefficients to artificial variables, undesirable from the
objective function point of view. If objective function Z is to be minimized, then a very
large positive price (called penalty) is assigned to each artificial variable. Similarly, if Z
is to be maximized, then a very large negative cost (also called penalty) is assigned to
each of these variables.
The various steps involved in using simplex method for minimization problems are:
Step 1. Formulate the linear programming model, and express the mathematical model of L.P.
problem in the standard form by introducing surplus and artificial variables in the left
hand side of the constraints. Assign a 0 (zero) and +M as coefficient for surplus and
artificial variables respectively in the objective function. M is considered a very large
number so as to finally drive out the artificial variables out of basic solution.
Step 2. Next, an initial solution is set up. Just to initiate the solution procedure, the initial basic
feasible solution is obtained by assigning zero value to decision variables. This solution is
now summarized in the initial simplex table. Complete the initial simplex table by adding two
final rows Z, and Cj - Zj. These two rows help us to know whether the current solution is
optimum or not.
Step 3. Now; we test for optimality of the solution. If all the entries of Cj- Zj, row are positive,
then the solution is optimum. However, this situation may come after a number of iterations.
But if at least one of the Cj- Zj values is less than zero, the current solution can be
further improved by removing one basic variable from the basis and replacing it by some non-
basic one.
Step 4. (i) Determine the variable to enter the basic solution. To do this, we identify the
column with the largest negative value in the Cj- Zj row of the table.
(ii) Next we determine the departing variable from the basic solution. If an artificial variable
goes out of solution, then we discard it totally and even this variable may not form part
of further iterations. Same procedure, as in maximization case, is employed to determine the
departing variable.
Step 5. We update the new solution now. We evaluate the entries for next simplex table in
exactly the same manner as was discussed earlier in the maximization case.
Step 6. Step (3-5) are repeated until an optimum solution is obtained. So the following are the
essential things to observe in solving for minimization problems:
The entering variable is the one with the largest negative value in the Cj-Zj row
while the leaving variable is the one with the smallest non-negative ratio.
The optimal solution is obtained when the Cj-Zj row contains entirely zeros and positive
values.
Example
Min Z = 7X1+9X2
Subject to 3X1+6X2 ≥ 36
8X1+4X2 ≥ 64
X1 X2 ≥ 0
We introduce both surplus and artificial variables into both constraints as follows.
Min Z = 7X1+9X2+0S1+0S2+MA1+MA2
Subject to 3X1+6X2 - S1+A1 = 36
8X1+4X2 -S2+A2 = 64
X1, X2 > = 0
So the subsequent tableaus for this problem are shown below. To remind in these tableaus is in
transforming from one tableau to another, we perform elementary row operations to obtain
the unit vector in the pivot column for the entering variable into the solution.
The third tableau represents a final tableau since it is the optimal solution with entirely
zeros and non-negative values in the Cj-Zj row. Therefore, the optimal solution is X1 = 20/3
and X2 = 8/3 and value of objective function is 212/3.
Chapter two
2. Some Advanced Topics in LPP
Example:
The tie occurs when two or more net evaluation row elements of variables are equal. In
maximization problem, we select the highest positive element to indicate incoming variable and
in minimization we select lowest element to indicate incoming variable (or highest numerical
value with negative sign). When two or more net evaluation row elements are same, to break the
tie, we select any one of them to indicate incoming variable and in the next iteration the problem
of tie will be solved.
To select the outgoing variable, we have to select the lowest ratio or limiting ratio in the
replacement ratio column. Here also, some times during the phases of solution, the ratios may be
equal. This situation in linear programming problem is known as degeneracy. To solve
degeneracy, the following methods are used:
1. Select any one row as you please. If you are lucky, you may get optimal solution, otherwise
the problem cycles. OR
2. Identify the rows, which are having same ratios. Say for example, S1and S3rows having
equal ratio. In such case select the row, which contains the variable with smaller subscript.
That is select row containing S1as the key row. Suppose the rows of variable x and z are
having same ratio, and then select the row-containing x as the key row.
3. (a) Divide the elements of unit matrix by corresponding elements of key column. Verify the
ratios column-wise in unit matrix starting from left to right. Once the ratios are unequal, the
degeneracy is solved. Select the minimum ratio and the row containing that element is the
key row. (This should be done to the rows that are in tie). (b) If the degeneracy is not solved
by 3 (a), then divide the elements of the main matrix by the corresponding element in the key
column, and verify the ratios. Once the ratios are unequal, select the lowest ratios. (This
should be done only to rows that are in tie).
Problem: A company manufactures two products A and B. These are machined on machines X
and Y. A takes one hour on machine X and one hour on Machine Y, Similarly product B takes 4
hours on Machine X and 2 hours on Machine Y. Machine X and Y have 8 hours and 4 hours as
idle capacity. The planning manager wants to avail the idle time to manufacture A and B. The
profit contribution of
A is Rs. 3/– per unit and that of B is Rs.9/– per unit. Find the optimal product mix.
Now to select the outgoing variable, we have to take limiting ratio in the replacement ratio
column. But both the ratios are same i.e. = 2. Hence there exists a tie as an indication of
degeneracy in the problem. To solve degeneracy follow the steps mentioned below:
i. Divide the elements of identity column by column from left to right by the corresponding key
column element. Once the ratios are unequal select the lowest ratio and the row containing
that ratio is the key row. In this problem, for the first column of the identity (i.e. the
S1column) the ratios are: 1/4, and 0/2. The lowest ratio comes in row of S2. Hence S2 is the
outgoing variable. In case ratios are equal go to the second column and try.
• The original formulation of the problem is referred to primal form. The other form is called the
dual.
The following rules which guide the formulation of the dual problem will
give you the summary of the general relationship between primal and dual
LP problems.
If the constraints of the primal are >= that of dual will be <= or vice versa
The primal’s RHS values become the coefficients of the dual’s objective
function.
The coefficients of the first row of the primal’s constraints become the
coefficients of the first column of the duals constraint …
The solution quantities of the dual are equal to shadow prices of the primal
The values of the solution quantities of the primal can be found in the bottom
row of the dual.
A firm, that assembles computers and computer equipment, is about to start
production of two new microcomputers. Each type of microcomputer will
require assembly time inspection time and storage space. The amount of each of
these resources that can be devoted to the production of the micro computers is
limited. The manager of the firm would like to determine the quantity of each of
the microcomputers to produce in order to maximize the profit generated by
sales of these microcomputers. The following additional information is
provided.
Type 1 Type 2
Profit per unit 60 50
Assembly time/unit 4hrs 10hrs
Inspection time/unit 2hrs 1hrs
Storage space/ unit 3 cubic feet 3 cubic feet
Resources available
Assembly time 100hrs
Inspection time 22 hrs
Storage space 39 cubic feet
Required
3.1. Introduction
It can also be defined as to ship goods from various origins to various destinations in
such a manner that the transportation cost is a minimum. The availability as well as the
requirements is finite. It is assumed that the cost of shipping is linear.
The problem of finding the minimum-cost distribution of a given commodity from a group of
supply centers (sources) i=1… m to a group of receiving centers (destinations) j=1… n
Decision Variables
Xij = number of products shipped from factory i to warehouse j
The northwest corner method is a systematic approach for developing an initial feasible
solution. Its chief advantages are that it is simple to use and easy to understand. Its
chief drawback is that it does not take transportation costs into account. Consequently,
such a solution may require much additional effort to obtain the optimal solution.
The northwest corner method gets its name because the starting point for the allocation process is
the upper left-hand (Northwest) corner of the transportation table. For the Harley problem, this
would be the cell that represents the route from Farm A to Project #1. The following set of
principles guides the allocation:
I. Begin with the upper left-hand cell, and allocate as many units as possible to that cell.
This will be the smaller of the row supply and the column demand. Adjust the
row and column quantities to reflect the allocation.
II. Remain in a row or column until its supply or demand is completely
exhausted or satisfied, allocating the maximum number of units to each cell in turn,
until all supply has been allocated (and all demand has been satisfied because we
assume total supply and demand are equal).
Initial Feasible Solution for Harley using Northwest-corner method
The total cost is found by multiplying the quantities in completed (i.e. nonempty) cells by the
Cell’s unit cost and, then, summing those amounts. Thus:
As noted earlier, the main drawback of the northwest-corner method is that it does not consider
cell (route) costs in making the allocation. Consequently, if this allocation is optimal, that can be
attributed to chance rather than the method used.
Step 1: Select the cell with the least cost. Assign to this cell the minimum of its remaining row
supply or remaining column demand.
Step 2: Decrease the row and column availabilities by this amount and remove from
consideration all other cells in the row or column with zero availability/demand.
(If both are simultaneously reduced to 0, assign an allocation of 0 to any other unoccupied cell in
the row or column before deleting both.) GO TO STEP 1.
C. Stepping-stone method
Let consider the following initial tableau from the Min Cost algorithm
Total cost of LCM at the initial solution was birr 8(25) + 10 (125) + 11(175) + 4(200) + 5(75)=
birr 4,550
Introduce a non-basic variable (empty cells) into basic variables (occupied cells)
A1= +6-8+5-4= -1 (there is a cost saving if reshuffling is made on the shipment levels)
A2=+7-11+10-8+5-4=22-23= -1
B2= +11-11+10-8= +2
C3= +12-10+8-5= +5 (reshuffling will bring increases in costs)
There will be cost minimization for A1 and A2. But for B2 and C3 cost will increase if
reshuffling is exercised!
Here, we can select any non-basic variable as an entry and then using the “+ and –” steps
to form a closed loop as follows:
Stepping stone
The above saying that, we add min value of all –ve cells into cell that has “+” sign, and subtracts
the same value to the “-ve” cells. Thus, max –ve is min (200, 25) = 25 and we add 25 to cell A1
and B3, and subtract it from B1 and A3
A2=+7-11+10-8+5-4=22-23= -1
B2= +11-11+10-8=+2
C3= +12-10+8-5= +5
Stepping stone
The above tableau gives min cost = 25*6 + 120*10 + 175*11 175*4 + 100* 5 = birr 4,525
We can repeat this process to all possible non-basic cells in that above tableau until one has the
min cost!
Stepping stone
The above tableau gives min cost = 25*6 + 120*10 + 175*11175*4 + 100* 5 =
birr 4,525
We can repeat this process to all possible non-basic cells in that above tableau until one has the
min cost!
Total cost of LCM at the initial solution was birr 8(25) + 10 (125) + 11(175) + 4(200) +
5(75) = birr 4,550
The optimal tableau gives min cost ==25*6 + 120*10 + 175*11 + 175*4 + 100* 5 = birr
4,525
The total cost of LCM in the optimal solution is= Birr 4,525
Step 1: for each column and row, determine its penalty cost by subtracting their two of their least
cost
Step 2: select row/column that has the highest penalty cost in step 1
Step 3: assign as much as allocation to the selected row/column that has the least cost
Step 5: Repeat above steps until all allocations have been assigned
Step 1
Subtracting their two of their least cost
Step 1
Steps 2 & 3
Step 4
In either case, shipping cost coefficients of zero are assigned to each dummy location
or route as no goods will actually be shipped.
Any units assigned to a dummy destination represent excess capacity.
Any units assigned to a dummy source represent unmet demand.
A company has orders for 80 tons of bricks at three locations as follows: Warehouse1
(25 tons), Warehouse2 (45 tons), and Warehouse3 (10 tons). The company has two factories
that can produce 50 tons per week. The company can use the factories as a source for its
demand for bricks.
How should the week shipments be made to fill the above orders given the following delivery
cost per ton in birr:
F1w3= +14-10+12-15
F2w1= +10-8+10-12= 0 (No improvement but there is alternative route without cost change)
F2w1= +10-8+10-12= 0 (No improvement but there is alternative route without cost change)
F2w3= +15-12+10-14=-1
Optimal solution
Total cost of the second table is birr 865
But is there any improvement in costs?
Optimal solution
Solution to the shipment:
F1 to W1= 25 tons*8= birr 200
F1 to W2= 10 tons*10= Birr 100
F1 to W3= 5 tons*14= Birr 70
F2 to W2= 35 tons*12= Birr 420
F2 to W3= 5 tons*15= Birr 75
Total cost of shipment = Birr 865
3.4.2. Degeneracy
A solution is degenerate if the number of occupied cells is less than the number of rows plus the
number of columns minus one. i.e., there are too few occupied cells to enable all the
empty cells to be evaluated. In the case of the stepping-stone method, this means that
there will be at least one empty cell for which an evaluation path cannot be constructed.
Obviously, some modification has to be made to determine if such a degenerate solution
is optimal. The modification is to treat some of the empty cells as occupied cells. This is
accomplished by placing a delta () in one of the empty cells. The delta represents an extremely
small quantity (e.g., 0.001 unit); it is so small that supply and demand for the row and
column involved will be unaffected even without modifying other quantities in the row or
column, and so small that total cost will not change.
The purpose of the delta is to enable evaluation of the remaining empty cells. The
choice of location for the delta can be somewhat tricky: some empty cells may be
unsuitable if they do not enable evaluations of the remaining empty cells. Moreover, the
delta cannot be placed in a cell which later turns out to be in a negative position of a
cell path involved in reallocation because delta will be the smallest quantity in a negative
position and shifting that minute quantity around the cell path will leave the solution
virtually unchanged. Consequently, a certain amount of trial and error may be necessary
before a satisfactory location can be identified for delta.
The technique can be demonstrated for the degenerate alternate solution of the Harley problem.
Suppose that after some experimentation, cell A-1 has been selected for the location of
delta. The resulting index numbers generated using MODI and the improvement potential
for empty cells based on delta in cell A-1 are shown in the following table. This confirms that
the solution is optimal
The Assignment Problem (AP); It is a special case of TP with m=n and Si = Dj for all i, and
j.
The Hungarian Algorithm e.g. solving the assignment problem of a least cost assignment of m
workers to m jobs
Assumptions:
1. There is a cost assignment matrix for the m “people” to be assigned to m “tasks.” (If
necessary dummy rows or columns consisting of all 0’s are added so that the numbers of
people and tasks are the same.)
2. All costs are nonnegative.
3. The problem is a minimization problem.
Initialization
1. For each row, subtract the minimum number from all numbers in that row.
2. In the resulting matrix, subtract the minimum number in each column from all numbers
in the column.
Iterative Steps
1. Make as many 0 cost assignments as possible. If all workers are assigned, STOP; this is
the minimum cost assignment. Otherwise draw the minimum number of horizontal and
vertical lines necessary to cover all 0’s in the matrix. (A method for making the
maximum number of 0 cost assignments and drawing the minimum number of lines to
cover all 0’s follows.)
2. Find the smallest value not covered by the lines; this number is the reduction value.
3. Subtract the reduction value from all numbers not covered by any lines. Add the
reduction value to any number covered by both a horizontal and vertical line. GO TO
STEP 1.
For small problems, one can usually determine the maximum number of zero cost assignments
by observation. For larger problems, the following procedure can be used: