0% found this document useful (0 votes)
136 views

Optimization Google Book

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
136 views

Optimization Google Book

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

Numerical Methods

8. Optimization
Hechninues
and Applications)

Anup goel

Technical Publications
NUMERICAL METHODS & OPTIMIZATION

First Edition : January 2021

© Copyright with Author

All publishing rights (printed and ebook version) reserved with Technical Publications. No part of this book
should be reproduced in any form, Electronic, Mechanical, Photocopy or any information storage and
retrieval system without prior permission in writing, from Technical Publications, Pune.

Published by :
a) TECHNICA ®) Amit Residency, Office No.1, 412, Shaniwar Peth, Pune - 411030, M.S. INDIA
Z Ph.: +91-020-24495496/97, Email : [email protected]
«KK

PUBLICATIONS | Website: www.technicalpublications.org


An Up-Thrustfor Knowledge
E
z

(Nl
O7 89333221788

(i)
SYLLABUS
Unit - I : Roots of Equation and Error Approximations
Roots of Equation

Bisection Method, Newton Raphson method and Successive approximation method.

Error Approximations
Types of Errors: Absolute, Relative, Algorithmic, Truncation, Round off Error, Error Propagation,
Concept of convergence-relevance to numerical methods. (Chapters-2, 3)

Unit - II: Simultaneous Equations


Gauss Elimination Method with Partial pivoting, Gauss-Seidel method and Thomas algorithm for
Tri diagonal Matrix, Jacobi iteration method. (Chapter-4)

Unit - III : Optimization


Introduction to optimization, Classification, Constrained optimization (maximum two constrains):
Graphical and Simplex method, One Dimensional unconstrained optimization: Newton's Method.

Modern Optimization Techniques: Genetic Algorithm (GA), Simulated Annealing (SA). (Chapter-s)

Unit - IV : Numerical Solutions of Differential Equations


Ordinary Differential Equations [ODE]
Taylor series method, Euler Method, Runge-Kutta fourth order, Simultaneous equations using Runge
Kutta 2™ order method.
Partial Differential Equations [PDE] : Finite Difference methods

Introduction to finite difference method, Simple Laplace method, PDEs- Parabolic explicit solution,
Elliptic explicit solution. (Chapters-6, 7)

Unit - V : Curve Fitting and Regression Analysis


Curve Fitting
Least square technique- Straight line, Power equation, Exponential equation and Quadratic equation.

Regression Analysis
Introduction to multi regression analysis, Lagrange’s Interpolation, Newton's Forward interpolation,
Inverse interpolation (Lagrange’s method only). (Chapters-s, 9)

Unit - VI : Numerical Integration


Numerical Integration (1D only)
Trapezoidal rule, Simpson's 1/5 Rule, Simpson’s 3/8 Rule, Gauss Quadrature 2 point and 3 point
method.

Double Integration
Trapezoidal rule, Simpson's 1/3" Rule (Chapter-10)

(iv)
TABLE OF CONTENTS
Chapter-0 Introduction to Numerical 2.1.1 Algebraic and Transcendental Equations. . . 2 - 2
Methods (0 - 1) to (0 - 4)
2.2 Types of Root... 2... eee eee 2-3
0.1 Introduction .. 0.0.0... eee eee 0-2 2.3 Methods to Obtain the Root of Equation ....... 2-3
0.2 Procedure of Numerical Techniques .......... 0-2 2.4 Bisection Method or Half Interval Method ..... 2-4
0.3 Purpose to Study Numerical Methods ......... 0-2 2.5 Solved Examples ...............022-000005 2-6
0.4 Fields of Applications of Numerical Methods... 0-2 2.6 Newton-Raphson Method.................- 2-23
0.5 Types of Numerical Methods................ 0-4 2.6.1 Convergence and Divergence in
Newton-Raphson Method............. 2-23
Chapter-1 Introduction to MATLAB 2.7 Solved Examples 2.2... 00.00.00
cece eee 2-24
(1 - 1) to (1 - 30)
2.8 Successive Approximation Method .......... 2-48
1.1 Introduction to MATLAB .................. 1-2
2.8.1 Convergence and Divergence in Successive
1.2 The MATLAB System......... 000000000008 1-2 Approximation Method. ..............- 2-49

1.3 MATLAB Window. .......0..0.00 00000. e eee 1-3 2.9 Solved Examples ......... 0000.00 eee eee 2-49

1.4 Various Commands used in Command Window. | - 4 2.10 Engineering Applications based Examples ... 2 - 59

1.5 Matrices in MATLAB .................22-- 1-8 2.11 University Questions with Answers......... 2-66

1.6 Flowchart 2.0.0.0...


0.00 e eee eee eee 1-11
Chapter-3 Errors and Approximation
1.7 Programming in MATLAB ................ 1-13 (3 - 1) to (3 - 18)
1.7.1 Basic Operations in MATLAB Programming. . . 3.1 Introduction .........
0.00.0 c eee eee eee 3-2
Lecce eee e eee eee beeen eee 1-13
3.2 EMOrs 2... eeeeen eee 3-2
1.8 Steps in Writing a MATLAB Program. ....... 1-15
3.2.1 Significant Digits... 0.0.0.0...
0. .0000..39 22
1.9 Decision Control Statement (Decision Making) 1 - 19
3.3 Types of Errors... . 0... ce eee eee er eee ote
1.10 Iterative Statements (Loops)............-.. 1-21
3.3.1 Truncation Error... .............02.00.8 3-2
LL] Array... eee ee 1 - 24
3.3.2 Round-off Error... 0.000.
00. 0.0002 cee 3-3
1.11.1 Two Dimensional Array.............. 1-25
3.3.3 Absolute Error... 0.0... cee eee ee 323
1.12 Functions in MATLAB ..........0...000. 1-27 3.3.3.1 Absolute Error in Addition and
1.12.1 Inline Function. ..........0.....0004 1-27 Subtraction... 00.00.0000. 3-3

1.12.2 Linsolve . 0... 00.0. cee eee eee 1-29 3.3.3.2 Absolute Error in Multiplication and
Division ................2..-0000- 3-4

Unit - I: Roots of Equation and 3.3.4 Relative Error... 00. 3-4


ec am Vayiyceabutein
ley its 3.3.5 Percentage Relative Error .............. 3-5

3.3.6 Inherent Error... 2.0...


eee eee eee 3-5
Chapter - 2 Roots of Equation (2 - 1) to (2 - 66)
3.4 Error Propagation. ............
0.0000 0000..39 25
2.1 Introduction ...... 006. 2-2
(vi)

3.4.1 Error Propagation in Arithmetic Operations 5.7.1 Constructing Linear Programming Model . . 5 - 6
5.7.2 Methods to Solve LP Problems .......... 5-6
3.5 Concept of Convergence for Iterative Methods . . 3 - 7
5.8 Graphical Method... 0.2.0.0... 0.000. 5-7
3.6 Solved Examples
5.8.1 Terminology of Graphical Method for LP... 5 - 7
3.7 University Questions with Answers .........3-16
5.9 Steps in Graphical Method of LP............. 5-7

Unit - II : Simultaneous Equations 5.9.1 Advantages and Disadvantages of Graphical


method... eee 8
Chapter-4 Simultaneous Equations 5.10 Solved Examples ........0. 000.00: e eee 5-8
(4 - 1) to (4 - 74)
5.11 Simplex Method ............0
2.000 eae 5 - 20
4.1 Introduction... 02... 0.... 0.0. eee eee eee 4-2
5.11.1 Terminology of Simplex Method for LP . 5 - 20
4.2 Different Types of Solutions of Simultaneous
Equations... 0... 06. c cece eee eee eee 4-3 5.12 Solved Examples
4.3 Matrix and its Types ..... 0.2.00...
cee 4-4 5.13 One-Dimensional Unconstrained Optimization 5 - 54
4.4 Homogeneous and Non-homogeneous Simultaneous 5.13.1 Newton's Method...................5-54
Equations. .... 0... cece eee eee eee 4-5
5.14 Solved Examples ............2..0020005- 5-54
4.5 Different Methods to Solve Simultaneous Equations
eee eee eee eee eee eee e ete e nee es 4-6 5.15 Optimization Techniques ................. 5-59

4.6 Gauss Elimination Method ................-- 4-6 5.15.1 Simulated Annealing (SA)............ 5-59

4.7 Solved Examples............00 000002 eeee 4-7 5.15.2 Genetic Algorithm (GA) ............. 5- 60

4.8 Gauss Elimination with Pivoting............. 4-23


4.9 Solved Examples... 0.0.0...
0.00 cece ee eee 4-24
Unit - IV : Numerical Solutions of
4.10 Thomas Algorithm for Tridiagonal Matrix .... 4-29 hac
ye see lee ager Lacey tes
4.11 Solved Examples...............2.2...0--- 4-31
Chapter-6 Numerical Solution of Ordinary
4.12 Gauss Seidel Method....................- 4-40 Differential Equations
4.13 Solved Examples... ..........00200000005 4-40 (6 - 1) to (6 - 68)
4.14 Jacobi : Iteration Method. ................. 4-61 6.1 Introduction ...... 0.000 ccc
eee eee 6-2

4.15 Solved Examples........0.0.0.000


00000 eee 4-62 6.2 Various Methods to Solve ODE.............. 6-3
4.16 University Questions with Answers ......... 4-7] 6.3 Taylor Series Method................0.0005 6-3

Unit - III : Optimization 6.4 Solved Examples ..........0


0.000 cee eee ee 6-4

6.5 Euler's Method .............002


00000 a ee 6-13
Chapter-5 Optimization (5 - 1) to (5 - 64) 6.6 Solved Examples ...........002.000000
00s 6-14
5.1 Introduction 2.2.0...
ccc cece eee 5-2
6.7 Runge-Kutta (R-K) Method ................ 6-21
5.2 Engineering Applications of Optimization. ..... 5-2
6.8 Runge-Kutta Second Order Method.......... 6-21
5.3 Classification of Optimization Problems ....... 5-2
6.9 Solved Examples .........
0000 eee eee nee 6-23
5.4 Constrained Optimization................... 5-4
6.10 Runge-Kutta Second Order Method for
5.5 Linear Programming. ............. 0.000.000 5-4
Simultaneous Differential Equations. ....... 6-33
5.6 Terminology of Linear Programming. ......... 5-4
5.7 Three Stages ofa Linear Programming Problem . 5 - 5 6.11 Solved Examples ............2..0000000 6 - 34
(vii)

6.12 Runge-Kutta Fourth Order Method ......... 6-40 8.6 Solved Examples 0.0.2.0...
00000 cece eee 8-14

6.13 Solved Examples ............2..00-02005 6-43 8.7 Fitting a Power Equation ................-. 8-21

6.14 University Questions with Answers......... 6-67 8.8 Fitting a Curve of the Form y=ab*.......... 8-21

8.9 Solved Examples .............2-..2000005- 8-2]


Chapter-7 Numerical Solution of Partial
Differential Equations 8.10 Fitting a Curve of the Form y = ax bl. 8 - 26
(7 = 1) to (7 - 40)
8.11 Solved Examples ..... 0.0.0.0
000 e eee nee 8-27
7.1 Introduction to Finite Difference Method...... 7-2
8.12 Fitting an Exponential Equation............ 8 - 40
7.2 Partial Differential Equations (PDE).......... 7-2
8.13 Solved Examples ...........00
00000 eee 8-40
7.2.1 Various Methods to Solve Partial
Differential Equations ............000- 7-2 8.14 University Questions with Answers......... 8-48

7.2.2 Finite Difference Approximations ....... 7-


Chapter-9 Regression Analysis
7.3 Solution of Parabolic Equation .............. 7-4 (9 - 1) to (9 - 34)
7.4 Solved Examples. ..............2-..-2000. 7-5 9.1] Introduction 0.2.6...
0c eee eee eee eee 9-2
7.5 Solution of Elliptic Equation (Laplace Equation) _ is 9.2 Methods of Interpolation ................... 9-2
9.2.1 Polynomial Forms ...............+0005 9-3
7.6 Solved Examples... 0.00.00...
00 ccc eee ee 7-16
9.3 Lagrange's Interpolation...................- 9-3
7.7 Solution of Elliptic Equation (Poisson's Equation)
Senet eee eet e eee 7-29 9.4 Solved Examples ........... 00000000 eee eee 9-4
7.8 Solved Examples .......0.0.00
00000 cee 7-30 9.5 Newton's Forward Difference Interpolation. ...9 - 10
7.9 University Questions with Answers ......... 7-38 9.5.1 Newton's Forward Difference Table ..... 9-11

9.6 Solved Examples .............-..202.00005 9-12


Ophir bal cMe a tae bile me bae|
Regression Analysis 9.7 Inverse Interpolation... ...........
00 eee 9-28

9.8 Solved Examples ...........002.0000


eae 9-29
Chapter-8 Curve Fitting (8 - 1) to (8 - 48) 9.9 University Questions with Answers.......... 9 - 34
8.1. Introduction . 2.6... ccc eee 8-2
Unit - VI : Numerical Integration
8.1.1 Concept of Best Fitted Curve ........... 8-2

8.2 Criterion to Obtain Best Fitted Curve.......... 8-2


Chapter - 10 Numerical Integration
8.2.1 Procedure of Curve Fitting by Least (10 - 1) to (10 - 82)
Square Criteria... 0.0... cee ee 8-3
10.1 Introduction 0... 0.000. c eee
ee eee 10-2
8.3 Fitting a Straight Line..........2......2.-.-- 8-4
10.1.1 Basic Engineering Applications of
8.3.1 Steps to Solve for Straight Line Fit....... 8-4 Integration... 2... 0.0.0.0... cee ee 10-2
8.4 Solved Examples .......0.....000.
000 eae 8-5 10.2 Newton-Cotes Quadrature Formula......... 10-3
8.5 Fitting a Parabola or Quadratic Equation
10.4 Types of Numerical Methods for Numerical
(Polynomial Regression) ..............005- 8-12 Integration... 6.6... eee
cee eee eee 10-4
8.5.1 Steps to Solve for Parabolic
10.3 Trapezoidal Rule............2..22...4.. 10-4
or Quadratic Equation Fit............. 8-13
(viii)
10.5 Solved Examples ...... 0.0... .000 00000 ee 10-6 10.11.1 Solved Examples
[Gauss-Legendre Three Point Formula] 10 - 46
10.6 Simpson's
(1 / 3)" Rule ..... 0... cece 10-17
10.12 Double Integration ..................4. 10-51
10.7 Solved Examples. .............200..05. 10 - 19\ 10.12.1 Trapezoidal Rule .........0 0.00000. 10-51
10.8 Simpson's (3/8)*" Rule..........
000 sees 10 - 29 10.13 Solved Examples .............0
0000 eae 10-52

10.9 Solved Examples ......0... 000000 e eee eee 10-31 10.14 Simpson's (1/3) Rule ............005- 10 - 64
10.10 Gauss-Legendre Quadrature Methods ..... 10-38 10.15 Solved Examples ..............22..04. 10 - 66
10.11 Solved Examples 10.16 University Questions with Answers....... 10 - 80
[Gauss-Legendre Two Point Formula] .... . 10-41

Solved University Question Papers


(S - 1) to (S - 40)
UNIT - III

Optimization
Syllabus Terminology of Linear
: 5-4
5.6
Programming
Introduction to optimization, Classification, Constrained
optimization (maximum two constrains): Graphical and
Simplex method, One Dimensional unconstrained
optimization: Newton's Method. Three Stages of a Linear
5.7 5-5
Programming Problem
Modern Optimization Techniques: Genetic Algorithm
(GA), Simulated Annealing (SA).
5.8 Graphical Method 5-7
May-15, Marks 4
Contents Steps in Graphical Method of LP 5-7
5.1 Introduction 5-2 Solved Examples 5-8
yl G eee
Simplex Method 5 - 20
Engineering Applications of
Solved Examples 5-22
9-2 Optimization 3-2
yay el ese Ele ers One-Dimensional Unconstrained
Optimization 9-54
Classification of Optimization
5.3 5-2 Solved Examples 5-54
Problems

5.4 Constrained Optimization 5-4 Optimization Techniques 5-59


May-15,16, Dec.-15,16, Marks 6

5.5 Linear Programming 5-4 University Questions with


Answers 5-63

(5
- 1)
Numerical Methods and Optimization Optimization

[5.1 | Introduction SPPU : April-16

¢ Optimization is the act to obtain the best result under certain given conditions.
« The ultimate goal of any design, construction or maintenance of any engineering system is to either minimize
the effort required or to maximize the desired benefit.
e This can be expressed as a function of certain decision variables.
¢ Optimization can be defined as the process of finding the conditions that give the maximum or minimum value
of a function.
f(x)
e From Fig. 5.1, it can be seen that if a point x' is
the minimum value of function f(x), then the f(x)
same point also has the maximum value of the
negative of the function, — f(x).
¢ Thus, optimization can be taken to mean
Tx! Minimum of [f(x)]
minimization without the loss of generality, since t x
the maximum of a function can be found by 0 xT
_- 4% Maximum of [= f(x)]
seeking the minimum of negative of the same
function.

e These different types of optimization problems an


E00
be solved by a number of optimization methods.
* These methods are also known as mathematical
Fig. 5.1 Minimum of f(x) is same as maximum of —f(x)
programming techniques and are studied as a part
of operations research.

5.2 Engineering Applications of Optimization SPPU : April-16

Some of the important applications of optimization technique are as follows :

* Aircraft and aerospace structures have to be designed in such a way that the aircraft has minimum weight.
¢ Several civil engineering structures such as frames, bridges, foundations, towers, etc. have to build with
maximum strength and minimum cost.
¢ In metal-cutting processes, several machining conditions have to be selected for minimum production cost.
e Design of pumps, turbines and heat transfer equipment for maximum efficiency.

« Planning, controlling and scheduling for optimal production.

¢ Selection of a site for industry.


« Shortest route taken by a sales person visiting various cities during one tour.

« Planning of maintenance and replacement of equipment to reduce operating costs.

« Optimum design of chemical processing equipment and plants.

¢ Planning the best strategy to obtain maximum profit in the presence of a competitor.

5.3 Classification of Optimization Problems

¢ Optimization problems can be classified on the basis of various criteria such as type of constraints, design
variables, structure of problem, type of equations involved, etc.
Numerical Methods and Optimization Optimization

« These classifications are described as follows :

1) Classification on the basis of type of constraints


i) Constrained Optimization :

¢ The problems that are subjected to one or more constraints known as constrained optimization problems.
For example :

Objective function is to maximize profit Z = 2x, + 5x4

Subjected to constraints x, + 4x, < 24

3x) + X9 < 21

Xj, Xo 20
ii) Unconstrained optimization : Iv

e The problems that do not involve any constraints are known as unconstrained optimization problems.
For example :

Objective function is to minimize cost Z = 2x, + 5x3


2) Classification on the basis of nature of the design variables
i) Parameter or static optimization problems

e It includes the problems in which it is required to find the values of a set of design parameters that make
some prescribed function of these parameters subjected to minimum constraints.
ii) Trajectory or dynamic optimization problem
e It includes the problems in which it is required to find the values of a set of design parameters that are all
continuous functions of other parameter. This minimizes an objective function subjected to set of
constraints.

3) Classification on the basis of physical structure of problem


i) Optimal contral problem
* It is a mathematical programming problem involving a number of stages, where each stage obtain from the
preceding stage in a prescribed manner.
e It is generally described by two variables i.e. control variables (define the system and govern the evolution
of system) and design variables (describes behaviour of system at any stage).
ii) Non-optimal control problem

4) Classification on the basis of nature of equations involved


i) Non-linear programming problem

e If any one of the functions among the objective and constraint functions is non-linear, then the problem is
known as non-linear programming (NLP) problem.
ii) Linear programming problem

elf the objective function and all the constraints are linear functions of the design variables, then the
mathematical programming problem is known as linear programming (LP) problem.
iii) Quadratic programming problem

e It is a non-linear programming problem with quadratic objective function and linear constraints.
Numerical Methods and Optimization 5-4 Optimization

5) Classification on the basis of permissible values of design variables


i) Integer programming problem
e If all the design variables of an optimization problem are restricted to take only integer or discrete values,
then the problem is called as integer programming problem.
ii) Real-valued programming problem

e If all the design variables of an optimization problem are permitted to take any real value, then the problem
is called as real-valued programming problem.

5.4 | Constrained Optimization Cae ee

e It is already discussed that, the problems that are subjected to one or more constraints known as constrained
optimization.
¢ The equation of constraints can be linear or non-linear.
e In this chapter we will mainly concentrate on linear programming (LP) problems or linear constraints.
¢ The linear programming problems can be solved by either graphical method or simplex method.

5.5 | Linear Programming

¢ The resources to run a company are never available in unlimited quantities. There is always a restriction.
« Each resource like money, material, labour, equipment, etc. is available in specific limit.
¢ The main problem faced by the management is to decide the manner in which these limited resources should to
used.
¢ These limited resources are properly used to achieve the desired objective i.e. profit maximization or cost
minimization.
« Linear programming technique helps the management in decision making process.
¢ It is one of the most popular techniques of operation research.
¢ I¢ is mathematical technique for alloting limited resources of a firm in an optimum manner.

« This technique is used in almost every functional area of business production, finance, marketing, etc. type of
industry.

5.6 | Terminology of Linear Programming

« In linear programming the following terms are commonly used :


| (i) Decision variables (ii) Constraints (iii) Objective function

(iv) Linear relationships (v) Feasible solution (vi) Optimal solution

(i) Decision variables


e Decision variables are the unknowns to be found from the solution of the model.
e They represent quantities or product to be manufactured.

e The essential requirements of the variables is that they should be inter-related in terms of consumption of
resources and their relation should be linear.
Numerical Methods and Optimization 5-5 Optimization

e The decision variable must be either zero or positive but never negative. If 'x' and 'y' are the decision
variables then,
x 20 and y =0 or x,y =0

(ii) Constraints
* The word constraint means restriction. It represents mathematical equation as the limitations imposed by the
problem characteristics.

e Most often constraints represent the limits of a resource input.


e For example : A company is manufacturing product 'P' in 'x' numbers and product 'Q' in 'y' numbers and
each unit requires 'm' hours and 'n' hours of machine shop for which 'T' hours are available. Now, its
constraint can be expressed as,

mx+n-y <T

(iii) Objective function


e It represents the mathematical equation of the major goals of the system in terms of decision variables.
eIn linear programming, objective function is of optimization type i.e. it can be either maximizing profit
function or minimizing cost function.

e For the above case, if each unit of product P gives profit of '% a' and each unit of product Q gives profit of
'%. b', then the objective of manufacturer (profit maximization) is,

x-a+y-b = Maximum profit


(iv) Linear relationships
elt deals with problems in which the objective function and constraints can be expressed as linear
mathematical functions.
e It includes two properties namely proportionality and divisibility.
e Proportionality indicates that the relationships are directly proportional and divisibility indicates that the
variables are not restricted to integer values.

(v) Feasible solution


e The word feasible means possible or achievable.
e When a set of values of the decision variables satisfies all the constraints and non-negativity restriction then
the solution is called as feasible solution.
(vi) Optimal solution
e A feasible solution which optimizes the objective function is called as optimal solution.
« It provides the best choice of values of feasible solution.

Three Stages of a Linear Programming Problem

e Every linear programming problem involves following three stages :


(i) Problem identification

di) = Problem formulation

(iii) Problem solving


Numerical Methods and Optimization 5-6 Optimization

(i) Problem identification


e It involves specification of problem, specification of constraints, establishing relationship between variables,
etc.

(ii) Problem formulation


e It is the most critical stage of linear programming problem.
e It involves construction of a mathematical model from the available data.
e It requires identification of decision variables, objective specification, establishing mathematical equations
for the constraints and the objective and presenting them in a comprehensive form.

(iii) Problem solving


e It involves selection of appropriate method, obtaining solution for the problem by a suitable method and
testing the solution for feasibility.

Constructing Linear Programming Model


¢ Construction of linear programming model is very important task.
e¢ For example : An Indian company producing nut in 5 minutes and requires 2 minutes for its painting and
coating. Similarly for producing bolt, it requires 3 minutes and 1.5 minutes for its painting and coating. The
machine shop and painting shop are available for 500 minutes and 300 minutes per week. The profit for each
nut is % 1 and for each bolt is ¥ 1.2. How many quantity of nuts and bolts should company be produce to
maximize the profit ?
Solution :

Let, x = Quantity of nuts produced

y = Quantity of bolts produced

The objective function is to maximize the profit which is given as,

Maximum profit (Z)= Ix + L.2y

The time constraint for production and painting can be given as,

5x + 2y < 500 ...(Production constraint)

3x + 1L.5y $300 ...(Painting constraint)

x2 0, y20 ...(Non-negative constraint)

Methods to Solve LP Problems


¢ The linear programming (LP) problem may be solved by following two methods :
( (i) Graphical method (ii) Simplex method )
_—

(i) Graphical method


e Graphical method makes use of graphical analysis and it is used to solve a problem which involves only
two decision variables but any number of constraints.
¢ Both maximization and minimization problems can be solved by graphical methods.

e It can be used when constraints are of greater than or equal to (2) type and less than or equal to (S) type.
Numerical Methods and Optimization 5-7 Optimization

(ii) Simplex method


e Simplex method is also known as simplex algorithm.

e It is an iterative process where optimum solution is obtained from a series of arithmetical steps.
e It is suitable for complicated programming problems which includes two or more decision variables.

Graphical Method

e Graphical method makes use of graphical analysis and it is used to solve a problem which involves only two
decision variables but any number of constraints.
¢ Both maximization and minimization problems can be solved by graphical methods.

e It can be used when constraints are of greater than or equal to (>) type and less than or equal to (<) type.
e It requires drawing two axes to represent two unknowns, representation of constraints, identification of feasible
region, drawing objective function line and evaluation of co-ordinates of the vertex to obtain the values of
unknowns,
¢ Though graphical method can deal with any number of constraints, each constraint is shown as line on a graph,
too many constraints make the graph complicated.

Terminology of Graphical Method for LP

: Basic terms used in graphical analysis of LP problem are as follows :


(i) — Constraints (ii) Graph of linear equality and inequality

(iii) Feasible region (iv) Corner points

(v) Feasible solution (vi) — Optimal solution

(i) Constraints
e It represents an upper limit on the availability of a resource or a lower limit on necessary level to obtain.
(ii) Graph of linear equality and inequality
« It is important to note that, a graph of two variable linear equation is always a straight line.

(iii) Feasible region


e This region is defined by the constraints and non-negativity restrictions of linear programming problem.

(iv) Corner points


e Corner points or vertices are the intersection points of two or more boundaries of the feasible region.
(v) Feasible solution
e It is a pair of values of (x, y) of decision variables that satisfy the given condition or constraints.
e Each point on the edge or inside the feasible region provides a feasible solution. But, it is not necessary
that this feasible solution is optimal solution.

(vi) Optimal solution


e It is that point in the feasible region which gives the optimal values of the objective function.

Steps in Graphical Method of LP

e While solving LP problem by graphical method use following steps :


(i) Identify decision variables.
Numerical Methods and Optimization 5-8 Optimization

(ii) Set up an equation of objective function and equation of constraints.


(iii) Write the complete LP problem formulation and graph constraints by reducing them to equality.

(iv) Find feasible solution region.

(v) Draw graph for objective function.


(vi) Identify farthest or nearest point (farthest point for maximization of objective function and nearest point for
minimization of objective function) out of all the points in feasible solution region.

(vii) Find co-ordinates of farthest or nearest point (as per the requirement) which represents values of decision
variables.

(viii) Using the values of decision variables find the total profit / cost from the optimal solution.

Advantages and Disadvantages of Graphical method

Advantages
Graphical method used for solving LP problem are having following advantages :

e As compare to simplex method, graphical method is simple to understand and easy to use.
¢ In this method, redundant (useless) constraints are automatically eliminated.
¢ In this method, multiple solutions, unbonded solutions and infeasible solutions get highlighted very clearly.

Disadvantages / Limitations
Graphical method used for solving LP problem are having following disadvantages :
¢ This method is restricted to two variables only. For more than two variables simplex method is used.
¢ Graphical method is suitable for any number of constraints but, since each constraint is shown as a separate line
on a graph, number of lines make the graph difficult to read.

5.10 Solved Examples

Ex. 5.1: Maximize Z = 25x + 20y subjected to condition,

6x + 4y < 3600
and 2x + 4y < 2000
xy eo

Sol. :

Step - 1: Plot the graph for the given four inequalities


e Assume that horizontal axis (x-axis) represents decision variable 'x' and vertical axis (y-axis) represents decision
variable 'y'.
¢ Now we have to plot a line for each of the two constraints and two non-negativity restrictions (x and y).
e It is essential to start the plotting of lines for non-negativity constraints because the graphical method begin with
the first quadrant of the graph (values of x and y must be either zero or positive).
¢ To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following
equations:

6x + 4y = 3600 i)
Numerical Methods and Optimization 5-9 Optimization

2x + dy = 2000 (ii)
e As these constraint represent linear equations, they will represent straight line when plotted on the graph.
¢ All points on the line will satisfy equality and all points below the line will satisfy inequality part of the
constraints.

e We know that, to plot a straight line of any constraint we need to find two points that lie on the line.

Initially we will draw line AB for equation (i) and line CD for equation (ii).

From equation (i), 6x + 4y = 3600

Initially, put x = 0, “dy = 3600 “.y = 900 (Point A)

Now, put y = 0, “6x = 3600 “x = 600 (Point B)

Draw line AB. Refer Fig. 5.2 (a).

(— >)
y axis y axis

1000 1000
900 A
800 800

600 For constraint 600


6x + 4y = 3600 500 - vain
or constrain|
400 400 2x + 4y = 2000
200 200

B D
0 200 400 600 800 1000 x axis 0 200 400 600 800 1000 x axis

(a) (b)

Fig. 5.2
From Fig. 5.2 (a) it is clear that, any point on line AB or below line AB will give feasible solution for the
constraint 6x + 4y < 3600. Shaded area in Fig. 5.2 (a) represents feasible region defined by the inequality
6x + 4y £3600.

Similarly, 2x + 4y = 2000 ...[From equation (ii)]

Initially, put x = 0, “.4y = 2000 “.y = 500 (Point C)

Now, put y = 0, “2x = 2000 “x = 1000 (Point D)

Draw line CD. Refer Fig. 5.2 (b).

From Fig. 5.2 (b) it is clear that, any point on line CD or below line CD will give feasible solution for the
constraint 2x + 4y < 2000. Shaded area in Fig. 5.2 (b) represents feasible region defined by the inequality
2x + 4y < 2000.
Numerical Methods and Optimization 5-10 Optimization

Step - 2 : Identify feasible solution region y axis


e As feasible solution must satisfy both the constraints, the
: ss 1000
particular combination of values of x and y can be found by
superimposing Fig. 5.2 (a) and Fig. 5.2 (b). 800

e¢ The shaded portion OCEB satisfies all the constraints hence . .


600 Feasible solution
it is called as feasible solution region. Refer Fig. 5.2 (c). region

e« Any combination of values of x and y in feasible solution 400


region provides feasible solution. 200
« Find the co-ordinates of each corner point of feasible solution
region. 0 200 400 600 800 1000 x axis

« The calculation of the objective function for the corner points / . ,


. . . . (c) Superimposing all constraints
are given in the following table :
Fig. 5.2

Corner Co-ordinates of Objective function Profit


point corner point Z = 25x + 20y value (Z)

oO (0, 0) Z=25x0+20x0 0

is (500, 0) Z = 25 x 500 + 20 x0 12,500

rE (400, 300) Z = 25 x 400 + 20 x 300 16,000

B (0, 600) Z=25 x0 + 20 x 600 12,000

e As the problem is of maximization, the maximum value of profit occurs at corner point E (400, 300).

x = 400, y = 300 and Z = 16000 + Ans.

Ex. 5.2: Minimize Z = 2x + 3y subjected to condition,


2x + 4y = 80
4x + 2y > 100
x20, y20
Sol. :

Step - 1: Plot the graph for the given inequalities


«To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following
equations:

2x + 4dy = 80 ++ (i)

4x + 2y = 100 .. (ii)
¢ Initially, we will draw line AB for equation (i) and line CD for equation (ii).

From equation (i), 2x + 4y = 80

Initially, put x = 0 “dy = 80 “.y = 20 (Point A)

Now, put y = 0, “2x = 80 “x = 40 (Point B)


Numerical Methods and Optimization 5-11 Optimization

From equation (ii), 4x + 2y = 100

Initially, put x = 0, “2y = 100 “y = 50 (Point C)

Now, put y = 0 “4x = 100 “x = 25 (Point D)

Draw lines AB and CD. Refer Fig. 5.3.


« Fig. 5.3 shows the solution region extending ¥ axis
beyond the corner points C, E and B (for
eo . 60 4x + 2y = 100
minimization purpose) formed by the straight
lines representing the constraints 2x + 4y = 80
and 4x + 2y > 100. 2x + dy = 80

Step - 2 : Obtain the value of decision


variables and minimum cost
¢ To find the value of decision variables x and y
which will optimize the objective, we must
check each of the corner points C, E and B by
substituting its co-ordinates in equation of
X axis
objective function Z.
« Find the co-ordinates of each corner point i.e.
. Lo. Fig. 5.3
C, E and B. The calculation of the objective
function for the corner points are given in the
following table :

Corner Co-ordinates of Objective function Cost value


point corner point Z = 2x + 3y (Z)

Cc (0, 50) Z=2x0+3 x50 150

E (20, 10) Z=2x20+3x10 70

B (40, 0) Z=2x40+3x0 80

e As the objective is minimization, the value of decision variable which gives minimum cost is at point E. The
co-ordinates of point E are (20, 10). It means,

x = 20, y = 10 and corresponding Z = 70 «. Ans.

Ex. 5.3: 4 company manufactures two types of rods R, and R». The respective profits are = 40 and % 30 per rod
respectively, Rod Ry requires twice as much time as required for Ry. If all rods were of Ry type, the company could make
1000 rods per day. The material of both type of rods is same and it is enough to produce 800 rods /day (both R, and R»
type). The outer box of rods are made by two different local suppliers. The supplier of rod R, can deliver 400 boxes / day
whereas supplier of rod Rz can deliver 700 boxes/day. To maximize the profit what quantity of each rod should be
produced ?

Sol. :

Step - 1 : Formulate the equation of constraints and objective function


¢ In this case equation of constraints are directly not specified. So initially we have to formulate the equation of
constraints.
Numerical Methods and Optimization 5-12 Optimization

« Let,

x = Number of rods R; to be produced


y = Number of rods R» to be produced
t = Time required to produce each rod R3
2t = Time required to produce each rod kj
“. Total time required to produce 'x' quantity of rod R; and 'y' quantity of rod R> is,

=Q2Uxt(ty
elt is given that, if all rods were of R2 type then the company could make 1000 rods/day. It means, daily

available time is 1000 t.

e Now, the time constraint can be written as,

(2t)x +(t)y = 10001

or 2x +y <= 1000 .. (1)

e The constraint of row material can be given as,


x+y < 800 we. (il)

¢ The restraint of availability of boxes can be given as,

x = 400 ee. (ili)

y = 700 ws (iv)

e As each rod R; and R> gives a profit of € 40 and & 30 respectively, the objective function can be written as,

Maximum Z = 40x + 30y wy)

Step - 2 : Plot the graph of given inequalities


« To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following equations :

2x +y = 1000 ws (vi)

x+y = 800 ... (vii)

x = 400 and y = 700 we. (vill)

e Initially, we will draw line AB for equation (vi) and line CD for equation (vii).

From equation (vi), 2x +y = 1000

Initially, put x = 0, “y = 1000 (Point A)

Now, put y = 0, “2x = 1000 -.x = 500 (Point B)

From equation (vii), x+y = 800

Initially, put x = 0, “y = 800 (Point C)

Now, put y = 0, “x = 800 (Point D)

Draw lines AB and CD as shown in Fig. 5.4.


Numerical Methods and Optimization 5-13 Optimization

ein this case, we have to draw two more lines for y axis
constraints, 1200
x = 400 (line FG) and y = 700 (line HI). 4000 A x = 400

e To satisfy all the four constraints, the feasible solution G 700


re . 800 © y=
must lie within the common area (shaded area) defined 700 Nk L,
by the corner points O, H, J, E, K and F. 600 Ae E

Step - 3 : Calculate the optimal value of decision 400


variables and maximum profit 2x + y = 1000
ein this case, we have to find the co-ordinates of all 200 K x+y
= 800

corner points O, H, J, E, K and F. Also, calculate the AB D


value of objective function for each corner point. Refer 0 200 400 4 600 800 1000 x axis
following table : 500
Fig. 5.4

Corner Co-ordinates of Objective function Profit value


point corner point Z = 40x + 30y (Z)

oO (0, 0) Z=40x0+30x0 0

H (0, 700) Z = 40 x0 + 30 x 700 21,000


J (100, 700) Z = 40 x 100 + 30 x 700 25,000
E (200, 600) Z = 40 x 200 + 30 x 600 26,000

K (400, 200) Z= 40 x 400 + 30 x 200 22,000

F (400, 0) Z = 40 x 400 + 30 x0 16,000

e As the objective is maximization, the value of decision variable which gives maximum profit is at point E. The
co-ordinates of point E are (200, 600). It means,

x = 200, y = 600 and corresponding Z = % 26,000. ... Ans.

Ex. 5.4: Maximize Z = 2x; + 5x9 subjected to,


Xy + 4x5 =< 24

3x + Xo < 2]

X) +X. = 9
Xj, X22 O SPPU : May-15, Marks 6

Sol. :

Step - 1: Plot the graph of the given inequalities


*To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following
equations:

xy + 4x, = 24 s (i)

3x, + x7 = 21 we» (ii)

X) +X, = 9 we. (ili)


¢ Initially, we will draw line AB for equation (i), line BC for equation (ii) and line DE for equation (iii).
Numerical Methods and Optimization Optimization

From equation (1), Xj + 4x5 = 24

Initially, put x; = 0, “.X) = 6 (Point A)

Now, put x» = 0, “xy = 24 (Point B)

From equation (ii), 3x, +X) = 21

Initially, put x; = “X) = 21 (Point C)


Now, put x. = 0 “3x, = 21 “xX, = 7 (Point D)

From equation (iii), Xj) +X) = 9

Initially, put x; = 0 “X) = 9 (Point E)

Now, put x, = 0 Wk = 9 (Point F)


Draw lines AB, BC and DE as shown in Fig. 5.5.

Step - 2 : Calculate the optimal value of decision variables and maximum profit
~
Xp AXIS

24

B X4 axis

Ne 15 18 21 24 27
/
Fig. 5.5
« Now, we have to find the co-ordinates of all corner points O, A, G, H and D. Also calculate the value of
objective function for each corner point. Refer following table :

Corner Co-ordinates of OUT function Profit value (Z)


point corner point Z= 2x, + 5x2

0 (0, 0) Z=2x0+5%x0 0
(0, 6) Z=2x0+5%x6 30
G (4, 5) Z=2x4+5x5 33
H (6, 3) Z=2x6+5%x3 27
D (7, 9) Z=2x7+5x0 14
Numerical Methods and Optimization 5-15 Optimization

e As the objective is maximization, the value of decision variable which gives maximum profit is at point G. The
co-ordinates of point G are (4, 5). It means,

Xj) = 4, X2 = 5 and corresponding Z = 33 o. Als,

Ex. 5.5: Raj engineering works manufactures two types of springs, helical compression and helical tension. The raw
material of spring is purchased from outside. The time required for manufaciuring of each compression spring is 0.1 hours
and for tension spring is 0.2 hrs. Manufacturing capacity of 500 hours is available per week.
The market for the two types of springs has been surveyed which suggests maximum weekly sale of 1200 compression
springs and 2100 tension springs. Profit for each spring is estimated as = 12 for compression spring and % 16 for tension
spring. Find the optimal product mix (quantity of each spring) by using graphical method of LP.

Sol. :

Step - 1 : Formulate the equation of constraints and objective function


* Let, x = Quantity of helical compression spring
y = Quantity of helical tension spring
¢ LP formulation will be as follows :

O1x+0.2 y < 500 (Manufacturing capacity constraint) ... (i)

x <= 1200 (Compression spring constraint) ... (1)

y = 2100 (Tension spring constraint) ... (ii)

xy 20 (Non-negativity constraint)

Maximum profit equation is,

Z = 12x + loy

Step - 2 : Plot the graph of given inequalities


«To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following
equations:

O.1x + 0.2y = 500 . (iv)

x = 1200 wee (V)

y = 2100 . (Vi)
« Initially, we will draw line AB for equation (iv), line CD for equation (v) and line EF for equation (vi).

From equation (iv), O.Ix + 0.2y = 500

Initially, put x = 0, “0.2y = 500 “.y = 2500 (Point A)

Now, put y = 0, “O.1x = 500 “x = 5000 (Point B)

Draw line AB as shown in Fig. 5.6. Also, we have to draw two more lines for constraints x = 1200 (line CD) and
y = 2100 (line EF).

¢ To satisfy all constraints, the feasible solution must lie within the shaded area defined by the corner points O,
E, G, H and C.
Numerical Methods and Optimization 5-16 Optimization

a y axis
~
4000

3500

3000 x = 1200
D J
2500
F
J

2100 @
2000
0.1x+0.2y=500
1500

1000

500
Cc
x axis
QO 500 1000] 1500 2000 2500 3000 3500 4000 4500 5000
1200
/
Fig. 5.6

Step - 3 : Calculate the optimal value of decision variables and maximum profit
« In this case, we have to find the co-ordinates of all corner points O, E, G, H and C. Also calculate the value of
objective function for each corner point. Refer following table :

Corner Co-ordinates of corner Objective function Profit value


point point Z = 12x + loy (Z)

0 (0, 0) Z=12x0+ 16x0 0

cE (0, 2100) Z=12x0+ 16 x 2100 33,600

G (800, 2100) Z = 12 x 800 + 16 x 2100 43,200

H (1200, 1800) Z = 12 x 1200 + 16 x 1800 43,200

Cc (1200, 0) Z = 12 x 1200+ 16 x0 14,400

e As the objective is maximization, the value of decision variable which gives maximum profit is at point G or at
point H.
e The co-ordinates of point G are (800, 2100). It means,

x = 800, y = 2100 and corresponding Z = 43,200 € .. Ans.

OR
¢ The co-ordinates of point H are (1200, 1800). It means,

x = 1200, y = 1800 and corresponding Z = 43,200 .. Ans.


Numerical Methods and Optimization 5-17 Optimization

Ex. 5.6: Maximize, Z = 80x + 120y


Subjected to constraints : x +y<9
x22
y23
20% + 50 yp < 360
x, vy 20 (Use graphical method). SPPU : Dec.-16, Marks 5, May-17, Marks 6

Sol. :

Step 1 : Plot the graph of given inequalities.

¢ To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following equations :
x+y =9 -» (i)

20x +50 y = 360 .. (ii)


¢ Initially, we will draw line AB for equation (i), Line BC for equation (ii).
From equation (i), x + y =9

Initially, putx = 0, .y=9 (Point A)

Now, puty = 0, «x =9 (Point B)

From equation (ii), 20x + 50y = 360

Initially, put x = 0, s.y = 7.2 (Point C)

Now, put y = 0,..x = 18 (Point D)

Draw Lines AB and BC as shown in Fig. 5.7

r >
,o

“ x+y = 9
Lf
9%

20x+50y = 360
2

F G
y=3
2

D x
XS 0 2 4 6 8B10 12 14 16 18 20 SS

Fig. 5.7
Numerical Methods and Optimization 5-18 Optimization

Step 3 : Calculate the optimal value of descision variables and maximum profit

e Now, find the co-ordinates of all corner points B, E, F, G. Also calculate the objective function for E each
corner point. Refer following table.

Corner point Coordinates of See eee function Profit value


orner point Z = 80x + 120 y Zz

E (2, 6.5) z=80x%2+120x65 940


F (2, 5) z=80x2+ 120*5 760

G (8, 3) z= 80 x8 + 120 x3 1000

H (4, 6) z=80x4+ 120 x6 1040

¢ As objective is maximization, the value of decision variable which gives maximum profit is at point H. The
co-ordinates of point H are (4, 6). It means x = 4, y = 6 and corresponding Z = 1040. .. Ans.

Ex. 5.7: Minimize ; Z = 20x + I0y


Subjected to condition
x + 2y 2 40
sx + y 230
4x + y > 60
x, vyZO0
(Use graphical method only) SPPU : April-17, Marks 6

Sol. :
Step 1: Plot the graph for the given inequalities

¢To plot constraints on graph, temporarily neglect inequalities and consider the constraints as following
equations :

x+2y = 40 @
3x+y = 30 .. (ii)

4x+3y = 60 .. (ili)

e Initially, we will draw line AB for equation (i) and line CD for equation (ii) and EF for equation (iil).

From equation (i), x+2y = 40

Initially, put x = 0 . 2y = 40 “.¥ = 20 (Point A)

Now, put y = 0 “ x = 40 (Point B)

From equation (ii), 3x +y = 30

Initially, put x = 0 “ y = 30 (Point C)

Now, put y = 0 “ 3x = 30 “x = 10 (Point D)

From equation (iii), 4x + 3y = 60


Numerical Methods and Optimization 5-19 Optimization

Initially, put x = 0 “ 3y = 60 “.y = 20 (Point E)

Now, put y = 0 “ 4x = 60 “x = 15 (Point F)

Draw lines AB, CD and EF. Refer Fig. 5.8.

( »
y axis

607

507

407

3049

Ale Yfpsiiss 60
20-+€\ “S PEEP A ELS SE
Lp: 30 yj 40
‘ j
10+ VV
a
1
1
I i]
1 DY NF + + + + X axis
10 20 30 40 50 60

NS /
Fig. 5.8
Fig.5.8 shows the solution region extending beyond the corner points C, G and B (for minimization purpose)
formed by the straight lines representing the constraints x + 2y > 40, 3x+y 230 and 4x+ 3y 260

Step : 2 Calculate the optimal value of decision variables and minimum cost.

Now, we have to find the co-ordinates for all corner points C, G and B. Also calculate the value of objective
function for each corner point.

. Co-ordinates of ie ease at Cost value


Corner point int (Z)
corner poin Z = 20x + 10y

c (0, 30) Z=20 x0+ 10 x30 300

G (5, 18) Z=20x5+ 10x18 280

B (40, 0) Z=20 x40+ 10 x0 800

As the objective is minimizaion, the value of decision variable which gives minimum cost is point G. The
co-ordinates of point G are (5, 18). It means.

x= 5, y =18 and corresponding Z = 280 +» Ans.


Numerical Methods and Optimization 5-20 Optimization

[ 5.11 | Simplex Method

elt is already discussed that, graphical method of linear programming is used when a problem includes two
variables only.
¢ If a linear programming problem includes three or four variables then graphical method is not suitable. In this
condition, simplex method is used.
¢ This method sets up equations of the constraints and of the objective function which are entered in a matrix and
completed by creating an initial feasible solution.
« After this, number of iterations are made to improve the initial feasible solution.
¢ This procedure is continued till the optimum solution is reached.

Terminology of Simplex Method for LP

¢ Basic terms used in simplex method of LP problem are as follows :


(i) Simplex table (i) = Slack variable = (ii) Artificial variable

(iv) Row of C, (v) Row of Z; (vi) Row of (Z;—-C;)

(vil) Key column (vill) Key row (ix) Key element

(x) Remaining element (xi) Degeneracy

(i) Simplex table


« It is a table used to keep track of the calculations made at each iteration of simplex procedure.

(ii) Slack variable (S)


e A slack variable (S) is used to convert a less than or equal to (<) constraint into equality constraint by adding
or subtracting from inequality constraint.
¢ Consider a linear programming problem as follows :
Maximize Z = 25x + 20y subjected to condition

6x + 4y < 3600

and 2x + 4y < 2000

xy 20

Now to convert inequality constraint into equality constraint slack variable is added in the equation 1.e.

6x + 4y + 8; = 3600 ...(Less than or equal to type equations)

and 2x + 4y + S, = 2000

where, S, and S, = Slack variables

It is important to note that, the coefficient of slack variables are considered as zero in the equation of profit (for
maximization) or in the equation of cost (for minimization).

Z = 25x + 20y + 0S,+ 0S,


Numerical Methods and Optimization 5-21 Optimization

¢ If the constraint equations are of greater than or equal to (2) type then the slack variables are subtracted Le.

6x + dy = 3600
and 2x + dy > 2000
Now to convert inequality constraint into equality constraint slack variable is subtracted i.e.

6x + 4y —S, = 3600
and 2x + 4y —S, 2000

(iii) Artificial variable (A)


e It is added in the equation of constraints which are of greater than or equal to (>) type.
¢ To add artificial variable, initially the constraint is converted into equality constraint as discussed above i.e.

Minimize £ = 25x + 20y

6x + 4y = 3600

2x +4y > 2000


Initially convert these inequality constraint into equality constraint i.e.

6x+4y —S,; = 3600

2x+4y -S5 2000

Now, add artificial variable in these equations,

6x+4y —S; +A, = 3600


2x+4y—-S, +A, 2000

The cost minimization equation becomes,

Z = 25x+20y —Os,; —Os3 -MA, -MA>

where, (— M) = Coefficient of artificial variable which do not have any physical meaning
(iv) Row of Cj
e This row in the simplex table contains the coefficients of the variables in the objective function.
e The terms in this row indicates the contribution per unit to the objective function of each of the variables.

(v) Row of Z;
e A row in the simplex table whose elements represent the decrease in the value of objective function
(contribution loss per unit).

(vi) Row of (Z;—C))


* Row of (Z; —Cj) is called as index row. It is a row in the simplex table whose elements represent net

contribution loss per unit.


e It is the difference between value of Z; and the corresponding value of Cj in the same column.
Numerical Methods and Optimization 5-22 Optimization

(vii) Key column


« It is the column with the largest negative index number in the (Z; —C; ) row and it indicates which variable

will enter the solution column,


(viii) Key row
e It is the row with the smallest of the replacement ratios of the constraint rows.

e The value of replacement ratios will be obtained by dividing the elements in solution column by the
elements in key column.

e The row which contains smaller value of replacement ratio is considered as key row.

(ix) Key element


It is the element obtained at the intersection of key row and key column.

(x) Remaining element


e It is the element above or below the key element in a key column.
(xi) Degeneracy
e Degeneracy means declination. It occurs when there is a tie for the values of replacement ratios.
e When values of both ratios is same, it is difficult to identify the key row. This situation is called as
degeneracy.

5.12 | Solved Examples

Ex. 5.8: Maximize Z = 6x; +4x > subjected to condition,


2x, + 3x2 100
lA

4x, + 2x5 < 120

X,. Xo 0
IM

Use simplex method to calculate x,, x. and maximize profit Z. SPPU : May-10, Marks 12, April-16, 17, Marks 10

Sol. :

Step - 1: Convert inequality constraint into equality constraint by adding slack variables

2x; + 3x9 +S, = 100 or 2x, + 3x2 +8, +085 = 100

4x) +2x9 +35 = 120 or 4x) + 2x9 +08; +55 120

The equation of profit will be,

Z = 6x; + 4x, +08, +08,


Numerical Methods and Optimization 5-23 Optimization

Step - 2: Form a simplex table

Solution value of variables i.e.


Variables column 2x, + 3X9 +S, = 100 Coefficient of variables and
initially consider
: as 4x, + 2X5 + 85 = 120 [ variables of profit equation
slack variables S, and Sy; — 1 ane i.e. Z = 6X, + 4x + 0S, + 0S,
------L-- Gd
Objective row|(C)) | 6 4 0 0!
1
1 !

Objective | Variable Solution xy X> S, S, I


column column column ven e eed el |
rr 4 77 gare errerrereereeeeeeeeereeereee
ror | 1S fp 100m) 1 2 3 1 0 lw
i i ! I t \ 1 \
Pt 1 0
t|d ts!
1 S21
| tat
| 120 1
| i 4 2 0 1!
|
Row of Z — 0 0 0 0

Row of (Z.—
Cj) = -6 -4 0 0

“ st nd . .
Coefficient of slack variables in equation of Z Variable of 1” and 2 constraint equations
Z = 6x, + 4x,
+ 0S, +08, i.€. 2X4 + 3X9 +S, + 0S,
= 100
and 4x, + 2x5 + 0S, + Sp = 120

« The row of Z; represents the decrease in value of objective functions. It is called as contribution loss per unit.
It is given as,

Row of Z| = ¥ Element in Xj, X9, 5;, S55 column x Element in objective column)

Row of Z;
(for x}-column)
= 9) (2x0+4x0) = 0 Objective Column | we |X| Xe
0 2 3

RowofZ; = }(3x0+2x0) = 0 0 4 2
(for x9 -column)

Row of Z; = })(1x0+0x0) = 0
(for S; column)

Row of Z; = ¥ (0x 0+1x0) = 0


(for Sy column)

« Row of (Z; -C;) called as index row is the difference between values of Zj and corresponding values of C, in

same column i.e.

Row of (Z; —C;)=0-6=—6 Row of (Z; —Cj)=0-0=0


(for xj column) (for S; column)

Row of (Z; -Cj)=0-4=—-4 Row of (Z; -Cj)=0-0=0


(for x9 —column) (for So column)
Numerical Methods and Optimization 5-24 Optimization

Iteration 1

Step - 3 : Identify the key column and key row from the simplex table
e The maximum negative value from row of (Z; -C; )is (— 6).

e¢ The column which contains maximum negative value is called as key column. In this case, key column is the
column containing x, variable.
¢ To find the key row in the table, calculate the ratio of element in solution column to the element in key column
i.e.

(Ratio); = 100 = 50
2

(Ratio), = ” = 30

The key row is the row which contains the lower value of ratio. As 30 < 50 ie. (Ratio), < (Ratio);, key row is
the 2™ row which contains Sy variable. Refer following table :

a Remaining element

Objective row (C) 6 / 4 0 0 Ratio

Objective Variable | Solution x x s s


column column | column 1 2
af
0 S; 100 :2' 3 1 0 50 | <=> Remaining row

0 an 120 @ 2 0 1 30 | =a Key row


Row of 4 — 0
Row of (Z|— Cj) -6 \s 0 0

Key element
(Intersection of
Key column key column and key row)

¢ The intersection element obtained by key column and key row is known as key element. Here, it is 4.
e The remaining element in a key column except key element is called as remaining element. Here, it is 2.

Step - 4 : Change the key row as well as remaining row elements


e The new key row elements are obtained by dividing all the elements in key row by key element i.e.
120
— = 30, 4
-=1, 2 0 1
=05, —=0, —=0.25
4 4 4 4
e The new remaining row elements are obtained as (we have to make remaining element as zero),

R, => R, —2R>

Applying this equation on all elements of remaining row i.e.

100-—2x 30 = 40
Numerical Methods and Optimization 5-25 Optimization

2-2x1= 0

3-2x0.5 = 2

1-2x0 = 1

0-2x0.25 = — 0.5

e¢ Now replace the objective column element in the key row by the objective row element in key column. It
means, replace 0 by 6.
Also replace variable column element in key row by variable of profit element in key column. It means, replace
5S by xy.
« Now the table will be as follows :

Objective row (C;) 6 4 0

Objective Variable Solution x Xo S>


column column column

0 Ss} 40 0 2 — 0.5

6 x 30 1 0.5 0.25

Row of Z| > 6 3 1.5

Row of (Z; —C)) — 0 -l 1.5

« Again calculate the value of elements in row of Z; and elements in row of (Z; —C; ) by applying the procedure

as in Step - 2.

Note ; If all the elements in row of (Z, — C.) are positive then optimum solution is reached, If any one value in
(Z - C) row is negative (less than zero) then there is scope for improvement.

«In this case, there is one negative term means there is scope for improvement or optimum solution is not yet
reached.

Iteration 2

Step - 5 : Identify the key column and key-row from the new simplex table
¢ The maximum negative value from row of (Z; -C;) is (— 1). Now, this column becomes key column which

contains x7 variable.
« To find the key row calculate the ratio as follows :

(Ratio); = 40 _ 59
2

. — 30 _
(Ratio). = 05 60

As 20 < 60, key row is the first row which contains S, variable.
Numerical Methods and Optimization 5-26 Optimization

Rati
(Ratio); = —=20
5

(Ratio)> = 05
30 60

As 20 < 60, key row is the first row which contains S, variable.
« The intersection element is a key element i.e. 2 and the remaining element in key column Le. remaining
element is 0.5.

[~ Key element

Objective row (C) 6 4 /' 0 0 Ratio

Objective | Variable | Solution x, Xp s s


column | column | column 1 2

0 Sy 40 0 @ 1 -0.5 20 |<= Key row

6 xy 30 1 (os: 0 0.25 60 | <= Remaining row

Row of (C)) — 6 3 0 1.5

Row of (Z)— C)) 0 -1 \e 1.5

ft Remaining element

Key column

Step - 6 : Change the key row as well as remaining row elements

* The new key row elements are obtained by dividing all the elements in key row by key element i.e.

40 _ 50, 96, 2_) Jigs, —9.5 = — 0.25


2 2 2 2 2
+ The new remaining row elements are obtained as (we have to make remaining element as zero),

Ry => Ro -0.5R,

Applying this equation on all elements of remaining row i.e.

30- 0.5 20 = 20

1-05x0 = 1

05-05x1 = 0

0-0.5%* 05 = - 0.25

0.25 — 0.5 x (— 0.25) = 0.375


Now replace the objective column element in key row by the objective row element in key column. It means,
replace 0 by 4. Similarly replace S; by x;. Now the table will be as follows :
Numerical Methods and Optimization 5-27 Optimization

Objective row (C;) 6 4 0 0

Objective | Variable | Solution |= % | Xe S; So


column column column

4 Xo 20 0 1 0.5 — 0.25

6 % 20 1 0 = 0.25 0.375

Row of Z| — 6 4 0.5 P25

Row of (2; -Cj) > 0 0 0.5 ihe)

+ Now again calculate the value of elements in Z| row and (2; —C; ) row, by applying the procedure as in

Step - 2.
« As all the elements in (Z; -C ) row are positive, optimum solution is reached.
*. Final optimum solution is,

Xx = 20 and x, = 20 « Ans.

“The maximum profit (Z) is,

Z 6x, +4X_ = 6X 20+4x


20

Z = 200 . Ans.

Ex. 5.9: 9 Maximize Z = 1600x + 1500p. Constraints are,


5x + 4y $500
15x + l6y < 1800
x20, y20 SPPU : May-08, May-15, Marks 10

Sol. :

Step - 1 : Convert inequality constraint into equality constraint by adding slack variables

5x+4y +8), = 50 or = 5x+4y +5, +085 = 500

15x+1l6y +S5 = 1800 or 15x+16y +08; +S, = 1800

The equation of profit will be,

Z = 1600x+1500y
+ 0S; +0S>
Step - 2 : Form a simplex table

Objective row (Cj) 1600 1500 0 0

Objective | Variable | Solution Xx y Ss So


column column column

0 3 500 5 4 1 0

0 So 1800 15 16 0 1
Numerical Methods and Optimization 5-28 Optimization

Row of Z => 0 0 0 0

Row of (Z;-C;) > —l600 -—1500 | 0 0

* Now calculate the value of elements in row of Zj and (Z; —C;).

Row of Z; _ ¥ (element in x, y, S; ....column Row of (2; -Cj) = 2; -C;

element in objective column)

forx column — Z; = ¥(6x0+15x0) = 0 Z; —C; = 0 — 1600 = — 1600


for
y column — Z = AC! x0+ 16x0)= 0 Z -C =0- 1500 =— 1500

for S; column + Z, = }dx0+0x0)=0 Z,-C; =0-0=0


for Sp column — Z = S(0x0+1x0)=0 Zj-C) =0-0=0

Iteration 1

Step - 3 : Identify the key column and key row from the simplex table
*« The maximum negative value from the row of (Z; ~C)) is (— 1600). So key column is the column containing

x variable.
¢ To find key row, calculate the ratio of element in solution column to the element in key column i.e.,

(Ratio), = == 100

(Ratio),
is
o
l

As 100 < 120, ie. (Ratio); < (Ratio), key row is the 1 row which contains $8, variable. Refer following table :

/- Key element

Objective row (C)) 1600 | / 1500 0 0 Ratio

Objective | Variable | Solution x y Ss s


column | column | column 1 2

0 s, 500 @ 4 1 0 100 | =a Key row

0 So 4800 | $15:
eh
| 16 0 4 420 | <== Remaining row

Row of Z; — 0 \ 0 0 0

Row of (Z)- C;) > — 1600 \ - 1500 0 0

t L Remaining element

Key column

For this case, key element is 5 and remaining element is 15.


Numerical Methods and Optimization 5-29 Optimization

Step - 4: Change the key row as well as remaining row elements


¢ The new key row elements are obtained as,

—_—= 100, 2= 1, = 08,. 2= 02, =0.

tale
5 5 5
e The new remaining row elements are obtained as,
R5 > R> -I5R,

Applying this equation on all elements of remaining row 1.e.

1800— 15 x 100 = 300

15-15x1=0

16-15
x 0.8
ll
&

0-15 02 = -3

1-15x0 = 1

¢ Now replace the objective column element in key row by the objective row element in key column. It means
replace 0 by 1600 and similarly replace S; by x. Now the table will be as follows :

Objective row (C)) 1600 1500 0 0

Objective | Variable Solution Xx y Ss; So


column column column

1600 x 100 l 0.8 0.2 0

0 Sp 300 0 4 3 | 1
Row of Zj => 1600 1280 320 0

Row of (2; -C)) > 0 —220 | 320 0

* Now calculate again the value of elements in row of Zz, and row of (Z; ~C)).

Row of (Z; -C))


Row of Z;

forx column — Z = ¥(1«1600 +0 x0) = 1600 Z; —Cj = 1600 — 1600 = 0

for
y column — Zj = S$ (0.8 1600+ 4x0) = 1280 Z -C = 1280 — 1500 = — 220

for S; column — Z, = ¥)(0.2*1600+ (-3)0) = 320 Z —C, = 320 - 0 = 320


for Sj column — Z; = ¥)(0x1600+
1x0) = 0 Zz -C,=0-0=0
« In this case, there is one negative term means there is scope for improvement or optimum solution is not yet
reached.
Numerical Methods and Optimization 5-30 Optimization

Iteration 2

Step - 5 : Identify the key column and key row from the new simplex table
* The maximum negative value from row of (2; -Cj) is (220). So key column is the column containing

y variable.
« To find key row, calculate the ratio of element in solution column to the element in key column i.e.,

100
Rati
(Ratio); = —=
08 125

(Ratio), = = = 75

As 75 < 125, key row is the second row which contains $4 variable. Refer following table :

Step - 6 : Change the key row as well as remaining row elements

e The new key row elements are obtained as,

300
4
95, 4Ong 425,
4
Be
4
075, 1-005.
4
« The new remaining row elements are obtained as,

R; => R, -0.8 R>

iz Remaining 9 element

Objective row (C;) 1600 | 1500 / 0 0 Ratio

Objective | Variable | Solution ” y 8, S)


column | column | column

1600 x 100 1 oa! 0.2 0 125 | <=> Remaining row

0 Sy 300 0 @ -3 1 75 | <= Key row

Row of (2) —» 1600 | 1280 320 0

Row of (Z;— C)) 0 —220 |\ 320 i)

i \_ Key element
Key column

100 —0.8x 75 = 40

1-08x0 = 1

08-08x1= 0

0.2 — 0.8
x (— 0.75) = 0.8

0-08 0.25 = — 0.2

« Now replace the objective column element in key row by objective row element in key column.
It means replace 0 by 1500 and similarly replace Sj by y.
Numerical Methods and Optimization 5-31 Optimization

Now the table will be as follows :

Objective row (Cj) 1600 1500 0 0

Objective Variable | Solution x y S; So


column column column

1600 x 40 1 0 0.8 - 0.2

1500 y 75 0 1 = 0.75 1

Row of Z) > 1600 1500 155 1180

Row of (Z; -Cj) > 0 0 135 1180

Now again calculate the value of elements in row of Z; and row of (2; ~C)).

Row of Z; Row of (Z;


— Cj)

for x column — Z; = ¥1(1x1600


+0 x1500) = 1600 (Z; -C)) = 1600 — 1600 = 0
for y column — Z; = ¥}(0x1600+1x1500) = 1500 (Z;-C;) = 1500 - 1500 = 0
for Sj column — Z; = })(0.8x1600+ (-0.75) x1500) = 155 (2) -Cj) = 155 — 0 = 155
for S, column — Z; = ¥(-0.2x1600+1x1500)= 1180 (Z, -C,) = 1180 - 0 = 1180

+ As all the elements in (2; —Cj) row are positive, optimum solution is reached.

Final optimum solution is,

x = 40 and
y = 75 +. Ans,
The maximum profit (2) is,

Z 1600x + 1500y = 1600 x 40 + 1500 x 75

Zz 1,76,500 a Ans.

Ex. 5.10: Maximize the function Z = 3x + 2y, subjected to following three conditions using simplex method.
xtys4, x-ysS2, x20, y20 SPPU : May-02, Marks 10

Sol. :

Step - 1 : Convert inequality constraint into equality constraint by adding slack variable
xtyt+tS,; =4 or xt+ty+5,+0S9=4

x-y+S85=2 or x-y+08) +8, =2

The equation of profit will be,

Z = 3x+2y+0S, +08,
Step - 2 : Form a simplex table

Objective row (C > 3 2 0 0

Objective Variable Solution x y S; So


column column column

0 S 4 1 1 1 0
Numerical Methods and Optimization 5-32 Optimization

0 S> 2 1 -l 0 I
Row of (Z)) > 0 0 0 0

Row of (2; -Cj)> -3 -2 0 0

Now calculate the value of elements in row of 7 j and row of (7 jo Cc j ).

Row of Z; Row of (Zj— Cj)

for x column
> Zj)=E (1x0+ 1x0)=0 (2, - Cj)=0-3=-3

for y column > Zj = XU x0 +(-1) x0) = 0 (Z - G))=0-2=-2

for$; column
+ Z; = (1x 0+ 0x0)=0 (2; - Cj)=0-0=0

for Sz column + 2; =2 (Ox0+ 1x 0)=0 (Z; -Cj))=0-0=0

Iteration 1

Step - 3 : Identify the key column and key row from the simplex table
¢ The maximum negative value from the row of (Z; — C; ) is (-3). So key column is the column containing

x variable.

¢ To find key row, calculate the ratio of element in solution column to the element in key column i.e.

(Ratio), 4
me
|

(Ratio)> =2
lr

As2 <4, the key row is the second row which contains $, variable. Refer following table :

[ Remaining element

Objective row (C)) 3 2 0 0 Ratio

Objective | Variable | Solution x y Ss s


column | column | column u a
ft
0 Sy 4 v4} 1 1 0 4 <= Remaining row

0 So 2 @) -1 0 1 2 <= Key row

Row of (Z)) 0 \ 0 0 0

Row of (Z)\— C) -3 =f 0 0

tt LL Key element
Key column

For this case key element is 1 and remaining element is 1.

Step - 4 : Change the key row as well as remaining row elements


Numerical Methods and Optimization 5-33 Optimization

The new key row elements are obtained as,


2 1 -l
7 eq7h 7 ot
The new remaining row elements are obtained as,

R, > R, -R>
Applying this equation on all elements of remaining row i.e.

4-2 =2
1-1 = 0
1-(-1) = 2
1-0 = 1
0-1=-1
¢ Now replace objective column element in key row by the objective row element in key column.
It means, replace 0 by 3 and similarly replace S, by x.

Now, the table will be as follows :

Objective row (C)) 2 0 0

Objective Variable Solution y Ss, So


column column column

0 Sy 2 2 l -1

3 x 2 cal 0 1

Row of (Z;) > al 0 3

Row of (2; — C;)> ae 0 3

e Now calculate again the values of elements in row of Zz and row of (Zj - Cj).

Row of Z; Row of (Z;~ Cj)


forx column+ Z) =E (Ox0+ 1x3)=3 (Z,- C))=3-3=0
for y column — 2) =¥ (2x 0+ (-1)x3)=-3 (Z, - C))=-3- 2=-5
forS$, column> Z) = (1x0+ 0x3)=0 (Z,-C))=0-0=0
for Sp column
> 2) = ¥ (- 1x0+ 1x3)=3 (Z) - C))=3-0=3
e In this case, there is one negative term. It means there is scope for improvement or optimum solution is not yet
reached.

Iteration 2

Step - 5 : Identify the key column and key row from the new simplex table
« The maximum negative value from row of (Z| — Cj) is (-5). So key column is the column containing

y variable.
Numerical Methods and Optimization 5-34

To find key row, calculate the ratio of element in solution column to the element in key column i.e.
(Ratio); =

(Ratio), =

As | <2, key row is the first row which contains $, variable. Refer following table :
a Key element

Objective row (C)) 3 2 / 0 0 Ratio

Objective | Variable | Solution 2 y S, S,


column | column | column

0 S, 2 0 @) 1 a 1 <= Key row

3 x 2 1 ct 0 1 -2 |< Remaining row

Row of (Z)) > 3 -3 0 3

Row of (4 -C)) 0 -5 0 3

tt \ Remaining element
Key column

For this case key element is 2 and remaining element is —1

Step - 6 : Change the key row as well as remaining row elements


« The new key row elements are obtained as,

; =1 5-0 SH 5-05 > =-0.5


¢ The new remaining row elements are obtained as,
R, > R,+R,
2+1=3
[+0= 1
-l+1=0
0+0.5 = 0.5
1+(-0.5) = 0.5
« Now, replace the objective column element in key row by objective row element in key column.
It means, replace 0 by 2 and similarly replace S, by y.
Now the table will be as follows :

Objective row (Cj) >

Objective ¢ | Variable Solution x y S| S,


olumn column column

2 y 1 0 1 0.5 ti
Numerical Methods and Optimization 5-35 Optimization

3 x 3 I 0 0.5 0.5

Row of (Z)) — B 2 2.5 0.5

Row of (Zj - Cj) > 0 0 2.5 0.5

* Now again calculate the value of elements in row of (Z) and row of (Zj —Cj).

Row of Zj Row of (Z; - C})

for x column > Zj == (Ox2+ 1x3)=3 (2; - C))=3-3=0

fory column
> Z)=¥ (1x2+ 0x3)=2 (Z;-C))=2-2=0

for S; column > Z, =¥ (0.5x2+ 0.5x 3)=2.5 (2) — Cj )=2.5-0=2.5

for Sz column + Z = 2 (- 0.5x2+ 0.5x3)= 0.5 (Zj — Cj )=0.5-0=0.5

e As all the elements in (Z; -C , ) tow are positive, optimum solution is reached.

Final optimum solution is,

x = 3andy=1 . Ams.
The maximum profit (Z) is,

Z = 3x + 2y = 3x 34+2x1

Z= il Ans.

Ex. 5.11: Mavimize, Z = 3X) + 2x5, subjected to,


2x +X <= 40, 2x) + 3x9 = 60 and Xx, +XxX9 < 24

X11 xX, 20
Sol. :

Step - 1 : Convert inequality constraint into equality constraint by adding slack variables.

2x) +X9+S8, = 40 or 2x) + Xo +S; + 0S, + 0S3 = 40

2x,
+ 3x2+S = 60 or 2x; + 3x9 + 0S; +5. +0S3= 60

Xy+Xo+S83; = 24° or X; + X2 + 0S, +08, +83 = 24


The equation of profit will be,

Ze 3x) + 2X9 +08, + 0S>5 + OS;

Step - 2 : Form a simplex table

Objective row (Cj) = 3 2 0 0 0

Objective c | Variable Solution 4 Xo S So S3


olumn column column

0 S| 40) 2 l 1 0 0

0 S3 60 ‘4 3 0 1 0
Numerical Methods and Optimization 5 - 36 Optimization

0 S3 24 1 l 0 0 1

Row of (Z)) > 0 0 0 0 0

Row of (2; -Cj) > -3 —2 0 0 0

* Now calculate the values of elements in row of Zj and row of (Z; - Cj ).

Row of Zj Row of (Zj— Cj)

for xy column > Zj=E(2x0+ 2x0+ 1x0)=0 (Z - C; )=0-3=-3

for x, column 9 Z)=E0x0+ 3x0+1x0)=0 (Zj - C)=0-2=-2

for S; column 3 Zj=L(Lx0+ Ox0+ 0x0)=0 (Z - C))=0-0=0

for S$ column = Z)=T(0x0+1x0+ 0x0)=0 (Zj - C))=0-0=0

for $3 column > Z)=¥(0x0+ 00+ 1x0)=0 (Zj — C))=0-0=0

Iteration - 1

Step - 3 : Identify the key column and key row from the simplex table
e The maximum negative value from the row of (Z;- C, )is (-3).

So key column is the column containing x, variable.

« To find key row, calculate the ratio of elements in solution column to element in key column.
: 40 : 60 : 24
(Ratio), = = 20, (Ratio) = =30. (Ratio); =T =24

As 20 < 24 < 30,


Key row is the first row which contains 5, variable. Refer following table :

[ Key element

Objective row (C)) 3 2 ) 0 0 Ratio

Objective | Variable | Solution x x Ss, S, S3


column | column | column

0 S, 40 @) 1 1 0 0 20 |= Key row

0 SS 60 i2) 3 0 1 0 30 |< Remaining


, row 1

0 82 24 ca 1 0 0 1 24 |= Remaining
b row2

Row of (2) —» 0 \ 0 i) 0 0

Row of (Z;-C)) -3 -2 0 0 0

t LL Remaining elements
Key column

For this case, key element is 2 and remaining elements are 2 and 1.
Numerical Methods and Optimization 5-37 Optimization

Step - 4: Change the key row as well as remaining row elements

The new key row elements are obtained as,

—40 = 20, 2
==1, 1
==0.5, 1
==0.5, 0
==0, 0
—=
2 0, 2° 2 ° 2 o> 2 0 2 0

« The new remaining row | and remaining row 2 elements are obtained as,

R5 > R, —2R, and R3=> R3- R;

Applying this equation on all elements of remaining row 1 and 2 as,

60-2x20= 20 24-20=4
2-2x1=2 1-1=0
3-2x05=2 1-0.5=0.5
0-2x05=-1 0-0.5=-0.5
1-2x0=1 0-0-0
0-2x0=0 1-0-1
e Now replace objective column element in key row by objective row element in key column.
It means, replace 0 by 3 and similarly 5, by x,.
Now the table will be as follows :

Objective row (Cj) > 3 2 0 0 0

Objective | Variable Solution x} X 3 S$) $3


column column column
3 x 20 I 35 0.5 0 0
0 S5 20 2 2 -l | 0
0 S; 4 0 0.5 | -0.5 0 1
Row of (2)) > 3 15 1.5 0 0

Row of (Z;-C;) 0 -0.5 15 0 0

« Now calculate the values of elements in row of Zj and row of (Z jn Cj)

Row of Z; Row of 2;-C;

for x; column Zi =3 (1x34 2x04 0Ox0)=3 (Zj —Cj)=3-3=0

for xX, column > Zj = (0.534 2x04 0.5x0)=1.5 (Z; —C; j=1.5-2=-0.5

for S, column > Zj =2(0.5x3+4 (-1)x0+ 1+ (- 0,.5)x0)=L5 (2 -C) )=1.5-0=1.5

for S column 32 = (0x3+ 1x0+ 0x0)=0 (Z; —Cj)=0-0=0

for S; column 3Z = (0x3+ 0x04 1x0)=0 (Z —C;)=0-0=0

e In this case there is a negative term. It means, there is scope for improvement or optimum solution is not yet
reached.
Iteration - 2

Step - 5: Identify the key column and key row from the new simplex table
Numerical Methods and Optimization 5-38 Optimization

«The maximum negative value from row of (Z;—C;) is -0.5. So key column is the column containing

X2 variable.
¢ To find key row, calculate the ratio of element in solution column to element in key column.

(Ratio), = =40, (Ratio) = =10, (Ratio); =—-=8


0.5
As 8 < 10 < 40, key row is the third row containing 8, variable. Refer following table :
[ Remaining elements

Objective row (C)) 3 2 / 0 0 0 Ratio

Objective Variable | Solution 1 rT s s s.


column | column | column 1 2 1 2 3
Remaining
3 xy 20 1 0.5 0 0 0 <= tow 4

Remaining
0 Sp 20 2 -1 -1 0 10 |= ow?

0 So 4 0 -0.5 0 1 8 |= Key row

Row of (2) —= 3 18\ 1.5 i) ft)

Row of (Z)— C)) 0 -05 \ 15 0 0

tt \ Key element

Key column

For this case, key element is 0.5 and remaining elements are 0.5 and 2.

Step - 6 : Change the key row as well as remaining row elements

« The new key row elements are obtained as,

4g
0.5
09
0.5
05.) 05) 09
0.5 0.5 0.5
04 0.5

« The new remaining row | and remaining row 2 elements are obtained as,
R, = R,;-O5R; and R, = R,-2R;

20-0.5x8=16 20-2x8=4

1-0.5x0=1 2-2x0=2
0.5—0.5x1=0 2-2x1=0
0.5-0.5x1=0 —1-2xl=—
0 —0.5x0=0 —1-2x0=-1
0 —0.5x0=0 0-2x0=0

e Now, replace the objective column element in key row by the objective row element in key column.
It means replace 0 by 2 and similarly replace 5, by x,.
Numerical Methods and Optimization 5-39 Optimization

* Now the table will be as follows :

Objective row (Cj) > 3 2 0 0 0

Objective | Variable | Solution xy X Ss; S3 $3


column column column

3 x 16 I 0 0 0 0

0 S> 4 2 0 3 aT 0
2 X> 8 0 1 | 0 0

Row of (Z) > 3 2 2 0 0

Row of (2) — Cj) 0 0 2 0 0

« Now again calculate the value of elements in row of Zj and row of (Z; - Cj ).

Row of Zj Row of (Zj -C;)

for x, column > Z) = ¥(1x3+2x040 x 2) = 3 (2) -C)=3-3=0


for x2 column > Z; = M(Ox3+0x0+1 x 2)=2 (Zj-Cj) =2-2=0
forS; column — Z; = S\Ox3+(-)x0 + 1 x 2)=2 (Z;-C;) =2-0=2
for Sy column —> Z; = SMiOx3+(-1)x0 + 0 x 2)=0 (Z;-C))
= 0-0-0
for S3 column — Zi = S(0x3+0x0 +0x2)=0 (Z)-Cj) =0-0=0

« All the elements in (2; — Cj ) row are positive, hence optimum solution is reached.

Final optimum solution is,

x, = 16 and
x, =8 «. Ans,

The maximum profit (Z) is,

Z = 3x, + 2xp =3x 16+2x8


Z= 64 «. Ans

Ex. 5.12 : 4A company is manufacturing two different types of products A and B. Each product has to be processed on two
machines MI and M2. Product A requires 2 hours on machine MI and ! hour on machine M2, product B requires I hour
on machine MI and 2 hours on machine M2. The available capacity of machine MI is 104 hours and that of machine M2
is 76 hours. Profit per unit for product A is = 6 and that for product B is & 11.
i) Formulate the problem. ii) Find the optimal solution by simplex method. SPPU : May-09, Marks 10, May-16, 17, Marks 8

Sol. :

Step - 1: Formulate the problem statement

Let, x = Number of components of product A

y = Number of components of product B

Maximize Z = 6x + lly
Numerical Methods and Optimization 5-40 Optimization

Subjected to, 2x +y = 104 [Machine M, capacity constraint]

x + 2y < 76[Machine M> capacity constraint]

x,y 2 0 [Non-negativity constraint]

Step - 2 : Convert inequality constraint to equality constraint by adding slack variables

2x+yt+S,; = 104 or 2xt+y+S),+0S = 104

X+2y+5. = 76 or x+2y+05) +S. = 76

The equation of profit will be,

Z = 6x+lly +0S, +0S>


Step - 3 : Form a simplex table

Objective row (Cj) > 6 11 0 0

Objective | Variable Solution x y S| S>


column column column

0 S| 104 2 1 1 0
0 S) 16 1 2 0 |
Row of (Zj) > 0 0 0 0

Row of (Z;
— Cj) > -6 | -ll 0 0

¢ Now calculate the values of elements in row of Zj and row of (Z; - Cj).

Row of Zj Row of (Z; — Cj)

for
x column — Z; = }}(2x0+1x0) = 0 (Z| - C))=0-6=-6
for
y column —> Z; = Siax0+ 2x0)= 0 (2 - Cj) =0-11=-11
for S; column > Z) = ¥ (1x04 0x0) = 0 (2) - C))= 0-0-0
for Sp column —> Z; = ¥(Ox0+ 1x0) = 0 (Z; - C))=0-0=0

Iteration - 1

Step - 4: Identify the key row and key column from the simplex table,
« The maximum negative value from the row of (Z, —C; ) is (-11). So the key column is the column containing
y variable.

¢ To find key row, calculate the ratio of elements in the solution column to the elements in the key column.

(Ratio); = = = 104, (Ratio), = £ = 38.

As 38 < 104, the key row is the second row containing 82 variable.
Refer following table :
Numerical Methods and Optimization 5-41 Optimization

For this case, key element is 2 and remaining element is 1.


[ Remaining element

Objective row (C)) 6 11 / 0 0 Ratio

Objective | Variable | Solution x y cy S>


column | column | column

0 S, 104 2 | 04 : 1 0 | 104 <= Remaining row

0 S> 76 1 @ 0 1 38 <= Key row

Row of (Z) _ 0 0 0 0

Row of (Z)— C;) —» -6 -11 0 0

tt LL Key element

Key column

Step - 5 : Change the key row as well as remaining row element

« The new key row elements are obtained as,


76 I 2 0 1
— = 38,-=05,—= =
2 2 2 2 2
¢ The new remaining row elements are obtained as,

R, > Ry -R

Applying this equation on all elements of remaining row,

104
— 38 = 66

2-05 = 105

I-1l1=0

1-0 =1

0-05 = -0.5

* Now replace objective column element in key row by the objective row element in key column.
It means replace 0 by 11 and similarly replace S by y.
Now the table will be as follows :

Objective row (Cj) > 6 11 0 0

Objective | Variable Solution x y S) S;


column column column

0 S 66 1.5 0 1 -0.5
11 y 38 0.5 1 0 05
Numerical Methods and Optimization 5-42 Optimization

Row of (Z)) > 55 | 1 0 55


Row of (Zj - Cj) > any 0 0 3.5

e Now calculate the values of elements in row of Zj and row of (Z; —Cj).

Row of Zj Row of (Z;


- Cj)

for x column —» Zj = ¥}(1.5x0+ 05x11) = 5.5 (Z -C)) = 5.5 -6 =-0.5


for y column — Zj = ¥ (0x04 bd) = 11 (Z -Cj) =11-11=0

for S, column — Z, = Mdx0+ 0x1) =0 (Z,-Cj)) =0-0=0


for Sp column — 2 = ¥(-05x0+ 05x11) = 5.5 (Z -Cj) =§5-0=5.5

e In this case, there is one negative term. It means there is still scope for improvement or optimum solution is not
yet reached.

Iteration - 2

Step - 6 : Identify the key column and key row from new simplex table
e The maximum negative value from the row of (Zj - Cj ) is (-0.5).

So the key column is the column containing x variable.


* To find key row, calculate the ratio of elements of the solution column to the elements of the key column.
66 38
( Ratio); M1 = —Ls = 44, ( (Ratio), 2 = —
05 = 76.

As 44 < 76, the key row is the first row containing S; variable.

Refer following table :

For this case key element is 1.5 and remaining element is 0.5.
f Key element

Objective row (C)) 6 / 1 ) 0 Ratio

Objective | Variable | Solution


X y Sy So
column | column | column

0 S; 66 @ 0 1 -0.5 44 |< Key row

11 y 38 (0s: 1 0 0.5 76 | <= Remaining row

Row of (2) —- 5.5 1 0 5.5

Row of (Z|— C) -0.5 \ 0 0 55

t L Remaining element
Key column

Step - 7: Change the key row as well as remaining row elements


* The new key row elements are obtained as,
Numerical Methods and Optimization 5-43 Optimization

| _ 0.6667, a =~ 0.3334

malin

lo
Ig
ll

Il
z
in
« The new remaining row elements are obtained as,

Ry => Ry -0.5 R;

Applying this equation on all elements of remaining row,

38 — 0.5 x 44 16

0.5 -0.5 x 1 0

1-05x0 = 1

0 — 0.5 x 0.6667 = 0.3333

0.5 — 0.5 x (— 0.3334) = 0.6667


« Now replace the objective column element in the key row by the objective row element in the key column,
It means, replace 0 by 6 and similarly replace S, by x.
Now the table will be as follows :

Objective row (Cj) > 6 11 0 0

Objective | Variable | Solution = x y S) S3


column column column

6 x 44 1 0 0.6667 — 0,3334

ll y 16 0 1 0.3333 0.6667

Row of (Z)) > 6 1 7.6605 5.3333

Row of (Zj - C)) > 0 0 7.6665 3.3333

e Now again calculate the values of elements in the row of Zj and row of (Zj - Cc; ).

Row of Z; Row of (Z;


— Cj)

for x column—» Z = }}(1x6+0x11)


=6 (Z)-Cj)=6-6=0
for y column — Z; = ¥ (0x64 1x11)= 11 (2; -C))= 11-11 =0

for S, column — Z; = }) 0.6667


x6 + 0.3333 x11) = 7.6665 (Zj —Cj) = 7.6665 — 0 = 7.665
for Sj; column > 2) = © (0.3334 6 + 0.6667 x11) = $.3333 (2; Cj) = 5.3333 — 0 = 5.3333

* As all elements in the (Z jo Cc 5 ) tow are positive, optimum solution is reached,

Final optimum solution is,

x = 44 and
y = 16 ++» Ans.

The maximum profit (Z) is,

Z = 6x tlly = 6x 44+ 11x 16 = 440 Rs. «+ Ans,


Numerical Methods and Optimization 5-44 Optimization

Ex. 5.13: The Sun Industry Ltd. produces two products A and B. Product A is sold at % 50,000/- and Product B at
& 12,000/ per piece. Each product passes through three processes. The table below presents the time required for each
product and total time available for each process per month. Determine the quantity of products to be produced so as to
maximize sale.

Hrs. Required
Process Available hrs/month
Product A Product B

Process - | 75 15 1000

Process = IT 100 30 1500

Process - III 45 10 750

SPPU : May-06, Marks 10

Sol. :

Step - 1: Formulate the problem statement

Let, x = Number of components of product A

y = Number of components of product B.

Maximize Z = 50,000x + 12,000y

Subjected to, 75x + I5y < 1000 [Process - I capacity constraint]

100x + 30y < 1500 [Process - II capacity constraint]

45x + l0y < 750 [Process - IL capacity constraint]

x,y 2 0 [Non-negativity constraint]

Step - 2 : Convert inequality constraint into equality constraint by adding slack variables

75x+15y +S; = 1000 or 75x+15y


+S) +08, +083 = 1000

100x+30y+S5 = 1500 or 100x+30y +08, +S, +083 = 1500

45x+10y +53 750 or 45x+10y +08, +08, +83 = 750

The equation of profit (2) will be,

Z = 50,000x+12,000y +08; +083 +0S;


Step - 3: Form a simplex table

Objective row (C))> 50,000 12,000 0 0 0

Objective | Variable Solution x y S| S | 3;


column column column

0 S| 1000 75 15 l 0 0

0 $2 1500 100 30 0 1 0

0 S; 750 45 10 o|o/]41
Numerical Methods and Optimization 5-45 Optimization

Row of (Z)) => 0 0 0 0 0

Row of (2 -C))> —50,000 —12,000 0 0 0

Now, calculate the value of elements in row of Zj and row of (Z, - Cj).

Row of Z; Row of (Z;—C;)

forx column — Z; = S75 x04+100x0+45 x 0)=0 (Z| -C;) = 0 — 50,000 = —50,000

for
y column — Zj = Sasx0+ 30x04+10 x 0)=0 (Zj -C)) = 0 — 12,000 = —12,000

forS; column > Z; = }dx0+0x0 + 0 x 0)=0 (Z,-C)) =0-0=0


for Sz column > Z; = SOx0+ Ix0+0x0O0)=0 (Zj)-Cj)=0-0=0

for S3 column — Z; = ¥(0x0+0x0 + 1 x 0)=0 (Z;)-C)) =0-0=0

Iteration - 1

Step - 4: Identify the key row and key column from the simplex table
* The maximum negative value from the row of (Z; — Cj ) is (-50,000).
So the key column is the column containing x variable.
¢ To find key row, calculate the ratio of elements in solution column to the elements in the key column.

(Ratio); = = = 13.333, (Ratio); = = = 15, (Ratio); = ~ = 16.6667

As 13.3334 < 15 < 16.6667, the key row is the first row containing 8; variable. Refer following table :

[ Key element

Objective row (C;) 50,000 | 12,000 0 O 0 Ratio

Son | oom fea | */|» | | & | 5


0 Sy 1000 ®) 15 1 0 0 | 13.3334 |< Key row
0 Sp 1500 400: 30 0 1 0 15 |<== Remaining
oy row 1

0 os 750 | “45: \ 10 0 0 1 | 16.6667 |= Remaining


oR row 2

Row of (Z)) —» 0 0 0 0 0

Row owof(Z-—C)—»
of (Z,—C, » \\0
| 50,000 — 12,000 0 0

t NS Remaining element

Key column

For this case, 75 is the key element and remaining elements are 100 and 45.

Step - 5 : Change the key row as well as remaining row element


Numerical Methods and Optimization 5 - 46 Optimization

The new key row elements are obtained as,


1000 75 15 1 0 0
—— = 13.3334, = = 1, = = 0.2, — = 0.0133, — = 0, — = 0
75 75 75 775 75
e The new remaining row elements are obtained as,
R, = R,-100R, and R; => R3 -45R,

1500 — 100 x 13.3334 = 166.66 750 — 45 x 13.3334 = 149.997

100-100 x1 = 0 45-45 x1=0

30-100 0.2 = 10 10-45 x0.2=1

0 — 100 x 0.0133 = -1.33 0 — 45 x 0.0133 = — 0.5985

1-100x0 = I 0-45 x0=0

0-100 x0 = 0 1-45 x0=1

¢ Now replace the objective column element in key row by the objective row element in the key column.
It means, replace 0 by 50,000 and similarly replace S, by x.
Now the table will be as follows :

Objective row (Cj) > 50,000 12,000 0 0 0

Objective Variable Solution x y Ss; S, | 83


column column column

50,000 X 13.3334 1 0.2 0.0133 0 0

0 S2 166.66 0 10 -1.33 1 0

0 8; 149.997 0 1 — 0.5985 | 1 0

Row of (Z)) > 50,000 10,000 665 0 0

Row of (Z;-Cj)> 0 2,000 665 0 | 0

* Now calculate the value of elements in row of Z; and row of (Z; —C; ).

Row of Z; Row of (Z;


- Cj)

for x column —> 2; = ¥(1x50000+4 0 x04+0 x 0) = 50,000 (Zj —Cj) = 50,000— 50,000= 0

fory column — Z; = ¥' 0.250000 + 10x0+1 x 0)= 10,000 (Z, —C;) = 10,000 - 12,000 = -2,000

for S; column = Zj =¥ (00133 * 50000+ (—1.33) x0 (2; -Cj) = 665 — 0 = 665


+ ( — 0.5985 x0) = 665

for Sp column —> Z; = ¥(0x50000+ 1x0+ 1x0) = 0 (Z -C)) =0-0=0

for S3 column — Z; = ¥@x50000+ 0x0+ 0x0) =0 (2, -Gj)) =0-0=0


Numerical Methods and Optimization 5-47 Optimization

e In this case there is one negative value in row of (Z; -C}). It means there is still scope for improvement or
optimum solution is not yet reached.

Iteration - 2

Step - 6 : Identify the key column and key row from new simplex table
¢ The maximum negative value from row of (2; -C)j) is (-2000). So the key column is the column containing
y variable.
¢ To find the key row, calculate the ratio of elements in solution column to the elements in key column.

(Ratio); = 13 — = 66.6667, (Ratio) = °°


10
~ 16,666,

(Ratio); = 149.997 _ 149.997


As 16.6667 < 66.6667 < 149.997, the key row is the second row containing Sz variable.

Refer following table :

Remaining element
[- Key element

Objective row (C)) 50,000 | 12,000 o/ 0 ) Ratio

Objective | Variable | Solution m y Ss. s. s


column | column | column : 2 iE
ad
50,000 x 13.3334 1 10.2: / 0.0133 0 0 | 66.6667|<== Remaining
- Sy row 1

0 S. | 166.66 | 0 -133 | 1 0 | 16.6667 |< Key row

0 S3 | 149.997} 0 “1: |-0.5985) 0 1 | 149,997 <= Remaining


—“) row 2

Row of (2) —» 50,000 | 10,000\) 665 0 0

Row of (Z)— C))> 0 | -2,000 \ cee 0 )

tf a Remaining element

Key column

e For this case, key element is 10 and remaining elements are 0.2 and 1.

Step - 7 : Change the key row as well as remaining row elements


¢ The new key row elements are obtained as,
166.66 _ 0 10. -1.33_ 33 LL O_
Tp > 16.666. 55 = 0 55 =), 0 7 7 8133: 10 0.1, 10 0.

« The new remaining row elements are obtained as,


R, > Ry —0.2R5 and R3 > R3 -R>
Numerical Methods and Optimization 5-48 Optimization

Applying this equation on all elements of remaining row,

13.3334 — 0.2 x 16.666 = 10.0002 149.997 — 16.666 = 133.331


1-02x0= 1 0-0-0
0.2-0.2x 1 = 0 1-1=0

0.0133 — 0.2 x (0.133) = 0.0399 — 0.5985 — (0.133) = — 0.4655


0-0.2 x 0.1 = — 0.02 0-0.1=-01
0-0.2x0 = 0 1-0-1
e Now replace the objective column element in key row by the objective row element in key column.
It means replace 0 by 12,000 and similarly replace S, by y.
Now the table will be as follows :

Objective row (Cj)> 50,000 12,000 0 0 0

Objective | Variable | Solution x y 3, $3 $3


column column column

50,000 x 10.0002 1 0 0.0399 | +).02| 0

12,000 y 16.666 0 1 0,133 0.1 0

0 S3 133.331 0 0 — 0.4655 | -0.1 I

Row of (Z)) = 50,000 12,000 399 200 0

Row of (Z) -Cj)> 0 0 399 200 0

* Now again calculate the value of elements in the row of Zj and (Z; - Cj ).

Row of Z; Row of (Z;


— Cj)

for x column — 2) = ¥(1x50,000 + 0 x12,000+0 x 0) = 50,000 (2; — Gj)= 50,000 — 50,000 = 0

for y column — Zj = 3 (0x 50,000 + 112,000+ 0 « 0) = 12,000 Gj -Cj) = 12,000 — 12,000 = 0

for S, column — Z; = ¥,(0.0399 x50,000+ (0.133) (Z; -Cj) = 399 — 0 = 399


x12,000+(—0.4655) x 0) = 399

for Sp column — Zi = > 0.02 «50,000+ 0.1%12 000 (Zj —C)) = 200 — 0 = 200
+ (—0.1)x0) = 200

for S; column — Z = ¥ (0x 50,000 + 112,000 +1xO0)=0 (2; -Cj) =0-0=0

e As all elements in the row of (Z j -C ;) are positive, optimum solution is reached.


Numerical Methods and Optimization 5-49 Optimization

Final optimum solution is,

x = 10 and y= 16 «» Ans.
Maximum profit (7) is,

Z = 50,000x 10 + 12,000x 16

Z = 6,92,000 = + Ans,
The value of y = 16.666 = 16 because if we consider it as 17, then it will not satisfy the given equation of
constraints. So the final value of y is 16.

Ex. 5.14: Minimize, Z = 2x + 3y subjected to condition,


x + 2y > 40
2x +y
> 50
xX y 0
IV

Sol. :

Step - 1 : Convert inequality constraint into equality constraint


« To convert the inequality constraint into equality constraint we subtract slack wariable and add artificial variable.

x+2y-S,;+A,; = 40 or x+2y-S)—-08; +A, +0A> = 40

2x+y-So+A>q = 50 or 2x+y—O0S; -S,+0A;) +A, = 50


The equation for minimum cost will be,

Z = 2x+3y +08, + 0S; +MA; +MA,


e In this case, as the objective is minimization, it needs to be converted into equivalent maximization objective.
Due to this, we can use same simplex method as used for maximization objective.
¢ To convert a minimization objective into equivalent maximization objective, multiply both sides of equation of
objective function by (—1) as follows :

—1XZ min = (2X4


3y +08) +05. +MA, +MA, )x(-1)

(Zmax Jeg. = —2x—3y —08, -08> -MA, —-MA,

Step - 2 : Form a simplex table

Objective row (C)) > -2 -3 0 0 -M | -M

Objective Variable Solution x y Ss; S> Ay Ag


column column column

-M Ay 40 1 2 -1 0 1 0

—M Ao 50 2 1 0 | -1 0 -I
Row of (Zj) > -3M -3M M M |-M | -M

Row of (Z;—-C))> —3M+2/-3M+3| M | M 0 0

* Now calculate the value of elements in row of Zj and row of (Z; -Cj ).
Numerical Methods and Optimization 5-50 Optimization

Row of Z, Row of (Z; Cj)

for x column — Z; = SUx(-M) + [2 x(-M)] =-3 M (Z; -Cj)=-3 M—- (2)


=3M+2
for
y column — 2) = S[2x(-M)+(1 x(4M)]=-3 M (2; -Cj) = -3 M—(-3)=-3 M+ 3

for Sy column — Z) = S(-1)x(-M)+(0x-M)] = M (Z;-C)) =M-0=M


for Sp column — Z; = S)[(0 x-M)+ (-1x-M)] = M (Z;-Cj)) = M-0=M
for Ay column > Z) = }[1x(-M)+0 x(-M)]=-M (2; -Cj) =-M-(-M)=0
for Ay column — Z; = ¥01x(-M)+(-1)x(M_) =— M (Z; -Cj) =- M-(- M) =90

Iteration - 1

Step - 3 : Identify the key row and key column from simplex table
+ The maximum negative value in the row of (Z| — Cj) is (- 3M+2). So the key column is column containing
x variable.

« To find the key row, calculate the ratio of element in solution column to element in key column.

(Ratio); = “ = 40, (Ratio), = 50 = 25.


2
As 25 < 40, the key row is the second row containing Az variable. Refer following table :
Va Remaining element

Objective row (¢) = f 3 0 0 -M —-M Ratio

Objecti
yective Variabl
anable Soluti
olution x y $4 Ss Ay Ap
column | column | column

-M Ay 40 fat 2 -4 0 1 0 40. | <= Remaining


a row
-M Ag 50 @ 1 0 -1 0 1 25 | <a Key
row

of (Z))
Row —= -3M\\ -3M M M -M —M

Row of (Z)\— C)) —3M+2 \ M+3) M 0 0

} \ Key element
Key column

* For this case key element is 2 and remaining element is 1.

Step - 4 : Change the key row as well as remaining row elements


* The new key row elements are obtained as,

F50 = 46 2-, L_pe 05,5-05--03,5=0,


25-155 Og -1_ ge OL

¢ The new remaining row elements are obtained as,

R; => Ry -R3
Numerical Methods and Optimization -51 Optimization

Applying this equation on all elements of remaining row,

40 — 25 15

I-1

2-05
-1-0
0 - (0.5)
1-0
0-05 — 0.5

* Now replace the objective column element in key row by the objective row element in key column.
It means replace (— M) by (— 2) and similarly replace A, by x.
Now the table will be as follows :

Objective row (Cj) > 2 3 0 0 —M —M

Objective Variable | Solution = x y Ss; $2 Ay Ag


column column column

2 x 25 1 0.5 0 0.5 0 0.5

—M So 15 0 1.5 -l 0.5 1 - 0.5

Row of (Z)) > —2 | -1-1.5M | M | 105M | -M | -1+0.5M

Row of Z —))> 0 2-1.5 M M 1- 0.5 M 0 141.5 M

¢ Now calculate the value of elements in row of Z; and row of (Z; - Cj).

Row of Z; Row of (Z; - Cj)

for x column —> Zj = ¥[1x(-2)+ 0x(4v)] = 2 (Z| -Cj)) = - 2-(-2)=0

for y column — Z, = [0.5 x(-2)+1.5 x(-M)]=-1-1.5M (Z)-C)) =-1- 1.5 M-(3)=2-15M


for S, column — Z, = ¥[0x(-2)+ (-1)x(-M] = M (Z;-C)) =M-0=M

for Sp column + Z) = })[(-0.5) x(-2)+ 0.5 x(-V)] (Zj -Cj) =1 -0.5M-0=1-0.5M


=1-0.5M

forAy column — Z; = }[0x(-2)+1 x(-M)]=-M (Z,-C;) =-M-( M)=0


for Ay column — Z; = ¥[0.5x(-2)+ (-0.5)x(-M)| (Z; -C;) = -1+ 0.5M - (-M)
=-1+05M =-1+1.5M

+ In this case, there is one negative value in row of (Z;—Cj). It means there is still scope for improvement or

optimum solution is not yet reached.


Numerical Methods and Optimization 5-52 Optimization

Iteration - 2

Step - 5 : Identify the key column and key row from new simplex table
e The maximum negative value from the row of (Z: - Cc) is 2— 1.5 M. So the key column is column containing
y term.
e To find the key row, calculate the ratio of element in the solution column to the element in the key column.
. 25 : 15
(Ratio); = 06> 50, (Ratio), = Ls 10

As 10 < 50, the key row is the second row containingS variable. Refer following table :
Remaining element
ia Key ey element
e

Objective row (C;) =2 -3 / o/ 0 -M —M Ratio

Objective Variable | Solution x y 5, So A, Ay


column | column | column
at
-2 Ay 25 1 :0.5; ) -0.5 0 0.5 50 <=> Remaining
aa row

-M Ag 15 0 B -1 0.5 1 -05 10 <= Key


row

Row of (Z)) —» -2 |-1-1.5M) M = |1-0.5M| -M |-140.5M

Row of (Z)\— C;) 0 21.5M) M |1-05M| 0O- |-1+0.5M

Key column

« For this case, key clement is 1.5 and remaining clement is 0.5.

Step - 6 : Change the key row as well as remaining row element


e The new key row element is obtained as,

$5
LS <9, LS8 9, 3-1,
OLS =hLS ~ 0.6667, 2215 = 0.3334, |L5 = 0.6667, 255 = - 0.3334
* The new remaining row element is obtained as,
R, => R, -0.5 R>

Applying this equation on all elements of remaining row,


25 -0.5x 10 = 20

1-05x0 = |

05-05x1= 0

0 - 0.5 x (— 0.6667) = 0.3333

— 0.5 — 0.5 x 0.3334 = — 0.6667

0 —0.5 x 0.6667 = — 0.3333

0.5 — 0.5 x (— 0.3334) = 0.6667


Numerical Methods and Optimization 5-53 Optimization

« Now replace the objective column element in key row by the objective row element in key column.
It means, replace (— M) by (— 3) and similarly replace S by y.
Now the table will be as follows :

Objective row (Cj) > 2) 3 0 0 -M -M

Objective | Variable Solution x y S| S> Ay Ao


column column column

2 x 20 l 0 0.3333 —0).6667 —0.3333 0.6667

-3 ¥ 10 0 l —0).6667 0.3334 0.6667 0.3334

Row of (Zj) > 2 | 3 1.3335 0.3332 —1.3335 0.3332

Row of (Z)-C))> 0 0 1.3335 0.3332 M — 1.3335 M - 0.3332

« Now again calculate the value of elements in row of Zj and row of (Z; -C;).

Row of Z; Row of (Z;—C))

for x column — Z; = S[1x(-2)+ 0x(-3)]= -2 (2, -C;)=-2-(2)=0


fory column —> Z; = S[Ox(-2)+1 x(-3)]= -3 (Z) -Cj))=-3 - (3) =0
for S; column — Z = ¥10.3333 %(—2)+ (-0.6667) x(—3)] = 1.3335 (Z -C)) = 1.3335 -—0= 1.3335

for Sp column — Z; = ¥[(-0.6667)x(-2)+ 0.3334 x(-3)] = 0.3332 (Z; -C;) = 0.3332 —0 = 0.3332
for Ay column —> Z) = }\[(-0.3333) x(-2)+0.6667 x(-3)] = -1.3335 (Zj ~Cj) = -1.3335 - (-M) = M~ 1.3335
for Ay column > Z; = }\[0.6667 x(—2)+ (-0.3334) x(-3)] = 0.3332. (Z; ~C)) = -0.3332 - (-M) = M-0.3332
* As all the elements in row of (Z; —C; ) are positive, optimum solution is reached.

Final solution is,

x = 20 and y= 10 ... Ans,


Minimum cost is,

Zmin = 2= 2x + 3y =2x 20+3x


10

Z = 70 Rs. ... Ans,

Ex. 5.15: Two products P; and Py are to be manufactured hy a firm. Profits on P, and Py are & 30 and 20 respectively.
The products are to be processed on two machines, ie. first on milling machine and other on surface grinder. The
capacities and the time required to produce a unit are as follows :

PR P, Capacity

Milling Machine | 3 hours 1 hour 1500 man hrs./month


Surface Grinder 1 hour 1 hour 1000 man hrs./month

How many products of type P, and Py should he manufactured to get maximum profit ? (use Simplex Method)

SPPU : Dec.-16, Marks 8


Numerical Methods and Optimization 5-54 Optimization

Sol. :

Let, x Number of components of product P;

y = Number of components of product P,

Maximize Z = 30x + 20y

Subjected to, 3.x + ly < 1500

Ix + ly = 1000

x,y 20

Now refer similar Example 5.8.

The answers of the above example are,

x = 250, y = 750 and Z = 22500

5.13 | One-Dimensional Unconstrained Optimization

elt is already discussed that, if the optimization problems do not have any constraints then they are called as
unconstrained optimization problems.
« In one-dimensional optimization, the function depends on a single dependent variable.
¢ Now we will discuss the techniques to find optimum (maximum or minimum) of a function for single variable.

e Such techniques are known as one-dimensional unconstrained optimization techniques.


«These techniques are similar to root location techniques like Bisection method, Regula-Falsi method,
Newton-Raphson method, etc.
« These optimization techniques are divided in two categories namely bracketing methods (Golden section search
and quadratic interpolation) and open method (Newton's method).

Newton's Method

¢ This method of one-dimensional unconstrained optimization is similar to Newton-Raphson method of roots of


equation.
e As per Newton-Raphson method,

fix) oy ... [From chapter (2)]


X27 = X 1 ~ Xp
£'(x;) Yi
e Here, similar approach is used to find maximum or minimum (optimum) value.

« As per Newton's method of optimization,


_ f'(x)) =x al
X27 = X] OD
£"(x)) YI

Solved Examples

Ex. 5.16: Using Newton's method calculate the maximum value of the equation 2 sinx—0.1 x2. Take initial guess as 2.5
and do 3 iterations.
Numerical Methods and Optimization 5-55 Optimization

Sol. : Given data :

P(X) = 2sinx-0.1x?, x =2.5,n=3


To find : Maximum value of the root of equation

Step - 1: Calculate the value of f(x) and f"(x)

f (x) = 2sinx-0.1 x?

Differentiating w. r. t. x,

f’ (x) = 2cosx-—0.1
x 2x =2 cos x —0.2x

Differentiating w. r. t. X again,

P(x) —2 sin x — 0.2

Iteration - 1
Xy = 2.5

Step (i) : Calculate the new value of root

f'(x;) = 2cos x; —0.2 x; = 2 cos (2.5) — 0.2 x 2.5 = -2.1022


"(x ) = -2 sin x, —0.2 = -2 sin (2.5) — 0.2 = -1.3969

- £"(x)) = 2.5 a8)


(—2.1022) = 9.9951
“FF ) (1.3969)
xo =

Iteration - 2
Replace x; by x> x; = 0.9951
Step (i) : Calculate new value of root

F(x) ) = 2 cos x; —0.2 x; = 2 cos (0.9951) — 0.2 x 0.9951 = 0.8897


and £"(x)) = 2 sin x; —0.2 = -2 sin (0.9951) — 0.2 = -1.8776
X2 = x, EOD
P(x; ) & 99951-03897
1.8776 = | 469
Iteration - 3
Replace x; by x xy = 1.4689
Step (i) : Calculate the new value of root

F(x)) = 2cos x; —0.2 x, = 2 cos (1.4689) — 0.2 x 1.4689

= — 0.0903

and £"(x;) = -2 sin x; —0.2 = —2 sin (1.4689) — 0.2 = —2.1896

- ECL) — 5 gogq 0.0903) _


1.4276
FO) (2.1896)
Numerical Methods and Optimization 5-56 Optimization

Iteration xX) f'(x,) f"(x,) Xx

| ae —2.1022 —1.3969 0.995]

2 0.9951 0.8897 -1.8776 1.4689

3 1.4689 —0.0903 2.1896 1.4276

The maximum value for root of given equation is xz = 1.4276.

Ex. §.17 : Using Newton's method find the maximum value for the equation x? —5x? + 3x. Take initial guess as zero upto
accuracy 0.001, SPPU : May-15, Marks 5

Sol. : Given data :

f(x) = x° ~5x? 43x, a = 0.001, x; = 0.


To find : Maximum value of root of given equation.

Step - 1 : Calculate the value of f'(x,) and f" (x,)

f (x) = x3 —5x? 43x


Differentiating w. r. t. x,

f(x) = 3x? -10x4+3

Differentiating w. r. t. x again,

r"\(x) = 6x — 10

Iteration - 1

xy = 0

Step (i) : Calculate the new value of root

£'(%,) = 3x? -10x, +3 = 3x0? -10x04+3=3

and £"(x)) = 6x; -10=6x 0-10=-10

=
f(x; )
—-———
= J-—__ = 03
3
2 FG) 10)
Step (ii) : Check for the accuracy

Xa —x,| < Accuracy or not

| 0.3—-0| = 0.3 > 0.001

Iteration - 2

Replace x, by x; .. x) = 0.3,

Step (i) : Calculate the new value of root

f(x) 3x7 =10xy +3 = 3x 0.37 -10x0.3+3 = 0.27

and f"(x,) 6x; -10= 6x 0.3 - 10 =-8.2


Numerical Methods and Optimization 5-57 Optimization

f(x; ) 0.27
= 03-—=_ = 0.3329
f"(x)) (-8.2)
Step (ii) : Check for the accuracy

|x; — X,| < Accuracy or not

|0.3329 — 0.3] = 0.0329 > 0.001

Iteration - 3

Replace x, by x, 1. Xx, = 0.3329

Step (i) : Calculate the new value of root

i 3x,7 —10x,; +3 = 3x 0.33297 10x 0,3329+3 = 0.003467

and £"x,) = 6x, -10= 6 x 0.3329 — 10 = = 8.0026


= x) £'(x1) = 0.3329-—
0.003467 "= 0.3333
82 LF) 8.0026 ~
Step (ii) : Check for the accuracy

\x2 —x,| < Accuracy or not

». |03333-03329| = 0.0004 < 0.001


Iteration - 4

Replace x; by x, 2. x, = 0.3333

Iteration X f' (x) £"(x) X> Accuracy

1 0 3 -10 0.3 0.3


2 0.3 0.27 — 8.2 0.3329 0.0329
3 0.3329 0.003467 — 8.0026 0.3333 0.0004

The maximum root of given equation is 0.3333.

Ex. 5.18 : Determine the maximum value of root of equation 0.5/x — sin x by Newton's method. Take initial guess as 2
and do 4 iterations. SPPU : May-16, Marks 5

Sol. : Given data :

f(x) = 0.51x
- sin x, x} =2,n=4

To find : The maximum value of root of the equation.

Step - 1: Calculate the value of f'(x) and f” (x)

f(x) = 0.51x - sin x

Differentiate w. r. t. x,

f'(x) = 0.51 - cosx

Differentiate w. r. t. x again,
Numerical Methods and Optimization 5-58 Optimization

f "(x) Q — (-sin x) = sin x

Iteration - 1

x, = 2

Step (i) : Calculate the new value of root

f(x) = 0.51 — cos x; = 0.51 - cos (2) = 0.9261

f"(x,) = sin x; = sin (2) = 0.9092,

=x - FG) _ 0.9261 _
0.9814
2 Fray 0.9092
Iteration - 2

Replace x; by x2 -. x, = 0.9814

Step (i) : Calculate the new value of root

f'(x,) = 0.51 — cos x; = 0.51 - cos (0.9814) = -0,0458

and £"(x,) = sin x, = sin (0.9814) = 0.8312

f'(x,) — 0.0458
= - = 0.9814— = 1.0365
*2 LEHR) 0. 8312
Iteration - 3

Replace x, by x2“. x, =1.0365


Step (i) : Calculate the new value of root

f'(x,) = 0.51 — cos x; = 0.51 — cos (1.0365) = 0.00076

and f"(x,) = sin x; = sin (1.0365) = 0.8606

f'(x) ) 0.00076
= xX - = 1.0365-— = 1.0356
*2 MFG) 0.8606
Iteration - 4
Replace x; by x ..x; = 1.0356
Step (i) : Calculate the new value of root

f'(x,) = 0.51 — cos x; = 0.51 - cos (1.0356) = 4.60x 10-6

and f"(x,) = sin x; = sin (1.0356) = 0.8601

_
f(x; ) 4.60% 106
= 1.0356-———__- = 1.0355
£"(x, ) 0.8601
X27 = Kj
Numerical Methods and Optimization 5-59 Optimization

Iteration X) f' (x) f"(x) Xz

1 2 0.9261 0.9092 0.9814


2 0.9814 0.0458 0.8312 1.0365
3 1.0365 0.00076 0.8606 1.0356
4 1.0356 | 4.60x10° | 0.8601 1.0355

The maximum root of the given equation is x2 = 1.0355.

5.15 | Optimization Techniques

e There are various techniques available to solve the different types of optimization problems.
« These are given under the heading of classical methods and modern methods as shown in Fig. 5.9.

Optimization techniques

U
uy U
Classical methods Modern methods

1. Single variable optimization 1. Simulated annealing (SA)


2. Multi variable optimization 2. Genetic algorithms (GA)
3. Multi variable optimization 3. Neural network
with equality constraints
4. Multi variable optimization
with inequality constraints
5. Convex programming
problem

/
Fig. 5.9 : Optimization techniques

e The desire to optimize the objectives and goals of any engineering system while satisfying the physical
limitations led to the development of new class of mathematical programming techniques.
e These new modern techniques have came into existence since the last decade.
e In this chapter, we shall learn only about two modern techniques i.e. simulated annealing (SA) and genetic
algorithms (GA).

Simulated Annealing (SA) SPPU : May-15, Dec.-15, 16

¢ The method of the simulated annealing comes under the modern optimization technique and based on the
assumptions of critically heated solids.
¢ We know that annealing in metallurgy is done to remove residual stresses, improve grain structure and to
minimize defects in the material.
¢ The concept of slow cooling from annealing to remove defects in metallurgy is implemented in the simulated
annealing algorithms.
Numerical Methods and Optimization 5-60 Optimization

¢ It is implemented as a slow decrease in the probability of accepting worse solutions as it explores the solution
space.
«In simulated annealing, the system is expected to explore initially towards broad region of the search space
containing good solutions and then drift towards narrower regions.

e For example, if the objective is to minimize the function f (x). The simulated annealing algorithm starts with
the initial vector x, and then successively generates improved points x7 ,X3.,.... moving towards the global
minimum solution.
e At each iteration of the simulated annealing algorithm, a new point is randomly generated.
¢ The distance of the new point from current point depends upon the probability distribution.
e The SA algorithm accepts all new points that minimize the objective to explore globally for better solution.

« Also, it accepts the points that maximize the objective to avoid being trapped in local solutions in early
iterations.

Advantages of Simulated Annealing


e It is one of the most flexible technique for solving complex combinatorial problems.

e Simulated annealing is easy to code for any type of problems.


« It statistically guarantees finding an optimal solution.
¢ It can deal with the arbitrary systems and cost functions.
¢ No vector calculations are needed.
« Easy to implement and provides good solution.

Disadvantages of Simulated Annealing


¢ If the cost function is expensive to compute, the annealing schedule is very slow.
¢ It requires about ten times more iterations than normal method.
¢ The parameters should be carefully chosen.

Genetic Algorithm (GA) SPPU : May-15, 16, Dec.-15

¢ Genetic algorithm is also a modern optimization technique that is based on some biological molecular
phenomena.
e This concept uses the principle of natural genetics and natural selection that includes reproduction, crossover,
mutation for genetic search.
e The genetic algorithm repeatedly modifies a population of individual solution.
« At each step, the GA randomly selects the individuals from the current population and uses them as a parents to
produce children for next generation.
« Over so many successive generation, the population evolves towards an optimal solution.
¢ Before starting genetic algorithm, user have to define the objective function, genetic representation and genetic
operators.
e These are the most important aspects of using genetic algorithm.
Numerical Methods and Optimization 5-61 Optimization

* Following are the basic steps in working of genetic algorithm :

1) Initialization of an algorithm
2) Creation of new population
3) Termination of algorithm

1) Initialization of an algorithm :
e It takes place by creating a random initial population.

e The member in this population are randomly selected.

2) Creation of new population :


e The fitness value of each member in the population is calculated.

e According to the fitness value, parent members are selected. Thus, member (designs) with higher fitness
values have greater chance of being selected.

e These parent members are used to produce children by mutation and cross-over.
e Hence, the current population is replaced with new population.
For example : Consider two individual members (designs) of length 10. Binary digits along the length of
the member are swapped to produce new generation.
Parent
lay ={0 01 0111011}

Parent 2x7 ={100 101110 0}

The result of cross-over is

Child 1 x; ={00 1 101110 0}

Child 2x4={100 O11 1011}


e At each iteration, genetic algorithms generates population of points and hence the best point in the
population approaches an optimal solution.

3) Termination of Algorithm :
e The algorithm stops when any one of the following condition is achieved :
© Specified number of generations are achieved.
° Time limit is achieved.

© Fitness limit is achieved.

° There is no improvement in the objective function in the given time interval, ete.

Advantages of Genetic Algorithm

¢ Genetic algorithm produces number of solutions after each iteration instead of only one solution.
¢ It can solve any optimization problem which can be described with the chromosome encoding.
e Genetic algorithm can solve problems with discontinuous, non-differential and non-linear objective function.
e These algorithms are easily transferred to simulations and models.

Disadvantages of Genetic Algorithm

¢ Time required for simulation of complex problems is more. Hence it cannot assure constant response time.

¢ Genetic algorithms do not scales well with complexity.


¢ The better solution obtained is only in comparison with the other solutions.

You might also like