Linear Programming: by Nagendra Bahadur Amatya Head of Department
Linear Programming: by Nagendra Bahadur Amatya Head of Department
Programming
By
Nagendra Bahadur Amatya
Head of Department
Introduction
Linear programming is a widely used mathematical modeling technique to
determine the optimum allocation of scarce resources among competing
demands. Resources typically include raw materials, manpower, machinery,
time, money and space.
The technique is very powerful and found especially useful because of its
application to many different types of real business problems in areas like
finance, production, sales and distribution, personnel, marketing and many
more areas of management.
As its name implies, the linear programming model consists of linear objectives
and linear constraints, which means that the variables in a model have a
proportionate relationship. For example, an increase in manpower resource will
result in an increase in work output.
ESSENTIALS OF LINEAR PROGRAMMING MODEL
For a given problem situation, there are certain essential
conditions that need to be solved by using linear programming.
1. Limited resources : limited number of labour, material equipment and
finance
The objective of the problem is identified and converted into a suitable objective
function. The objective function represents the aim or goal of the system (i.e.,
decision variables) which has to be determined from the problem. Generally, the
objective in most cases will be either to maximize resources or profits or, to
minimize the cost or time.
Constraints:
When the availability of resources are in surplus, there will be no problem in making
decisions. But in real life, organizations normally have scarce resources within which
the job has to be performed in the most effective way. Therefore, problem situations are
within confined limits in which the optimal solution to the problem must be found.
Non-negativity constraint
Negative values of physical quantities are impossible, like producing negative number of
chairs, tables, etc., so it is necessary to include the element of non-negativity as a
constraint
GENERAL LINEAR PROGRAMMING MODEL
A general representation of LP model is given as follows:
Maximize or Minimize, Z = p1 x1 + p2 x2 ………………pn xn
Subject to constraints,
w11 x1 + w12 x2 + ………………w1n xn ≤ or = or ≥ w1 ……………(i)
w21 x1 + w22 x2 ………………w2n xn ≤ or = or ≥ w2 …………… (ii)
....
....
....
wm1 x1 + wm2 x2 +………………wmn xn ≤ or = ≥ wm …………(iii)
Non-negativity constraint,
xi ≥ o (where i = 1,2,3 …..n)
Example
A company manufactures two types of boxes, corrugated and ordinary
cartons.
The boxes undergo two major processes: cutting and pinning operations.
Each corrugated box requires 2 minutes for cutting and 3 minutes for
pinning operation, whereas each carton box requires 2 minutes for
cutting and 1 minute for pinning.
The available operating time is 120 minutes and 60 minutes for cutting
and pinning machines.
Objective function is the function of the decision variables that the decision maker
wants to maximize (revenue or profit) or minimize (costs). Manager can concentrate on
maximizing the total weekly profit (z).
Here profit equals to (weekly revenues) – (raw material purchase cost) – (other variable costs).
Hence Manager’s objective function is:
Maximize z = 6X2 + 4x2
Constraints show the restrictions on the values of the decision variables. Without
constraints manager could make a large profit by choosing decision variables to be very
large. Here there are three constraints:
Available machine-hours for each machine
Time consumed by each product
Sign restrictions are added if the decision variables can only assume nonnegative values
(Manager can not use negative negative number machine and time never negative number )
All these characteristics explored above give the following Linear
Programming (LP) problem
Step 4: Find the co-ordinates of the objectives function (profit line) and plot it on the graph representing it
with a dotted line.
Step 5: Locate the solution point.
(Note: If the given problem is maximization, zmax then locate the solution point at the far
most point of the feasible zone from the origin and if minimization, Zmin then locate the solution at
the shortest point of the solution zone from the origin).
(a) Slack variables (S1, S2, S3..…Sn): Slack variables refer to the amount
of unused resources like raw materials, labour and money.
(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 Given Table below.
Cont…
Procedure of simplex Method
Step 1: Formulate the LP problem.
Step 4: Establish a simplex table and enter all variable coefficients. If the objective
function is maximization, enter the opposite sign co-efficient and if
minimization, enter without changing the sign.
Step 6: Find the ratio between the solution value and the coefficient of the key
column. Enter the values in the minimum ratio column.
Cont….
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 iteration table by eliminating the leavin variable
and introducing the entering variable.
Step 10: Convert the pivotal element as 1 in the next iteration 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.
Cont….
Step 12: Check the values of objective function. If there are negative
values, the solution is not an optimal one; go to step 5. Else, if all
the values are positive, optimality is reached. Non-negativity for
objective function value is not considered. Write down the values
of x1, x2,……..xi and calculate the objective function for
maximization or minimization.
Note:
(i) If there are no x1, x2 variables in the final iteration table, the
values of x1 and x2 are zero.
(ii) Neglect the sign for objective function value in the final iteration
table.
Example
Previous the packaging product mix problem is solved using
simplex method.
Maximize Z = 6x1 + 4x2
Subject to constraints,
2x1+3x2 ≤120 (Cutting machine) .....................(i)
2x1+ x2 ≤ 60 (Pinning machine) ......................(ii)
where x1, x2 ≥ 0
Considering the constraint for cutting machine,
2x1+ 3x2 ≤ 120
To convert this inequality constraint into an equation,
introduce a slack variable, S3 which represents the unused
resources. Introducing the slack variable, we have the
equation 2x1+ 3x2 + S3 = 120
Find the ratio between the solution value and the key column
coefficient and enter it in the minimum ratio column.
The intersecting coefficients of the key column and key row are called
the pivotal element i.e. 2.
In the next iteration, enter the basic variables by eliminating the leaving variable (i.e.,
key row) and introducing the entering variable (i.e., key column).
Make the pivotal element as 1 and enter the values of other elements in that row accordingly.
In this case, convert the pivotal element value 2 as 1 in the next iteration table.
For this, divide the pivotal element by 2. Similarly divide the other elements in that row by 2.
The equation is S4/2.
The other co-efficients of the key column in iteration Table 5.4 must be made as zero in the
iteration Table 5.5.
For this, a solver, Q, is formed for easy calculation.
Cont…
Solver, Q = SB + (–Kc * Pe)
The equations for the variables in the iteration number 1 of table 8 are,
For S3 Q = SB + (– Kc * Pe)
= S3 + (–2x Pe)
= S3 – 2Pe …………………………(i)
For – Z , Q = SB + (– Kc * Pe)
= – Z + ((– 6) * Pe)
= – Z + 6Pe …………………………(ii)
Using the equations (i) and (ii) the values of S3 and –Z for the values of
Table 1 are found as shown in Table 5.4
Cont….
Using these equations, enter the values of basic variables SB and objective function Z. If
all the values in the objective function are non-negative, the solution is optimal.
Here, we have one negative value – 1. Repeat the steps to find the key row and pivotal
equation values for the iteration 2 and check for optimality.