Unit 1
Unit 1
Introduction
Before we introduce an emerging field, namely soft computing, let us examine the meaning
of the term: hard computing. This chapter defines this term. Another term called hybrid
computing has also been introduced in this chapter.
• The variables related to an engineering problem are identified first and then classified
into two groups, namely input or condition variables (also known as antecedents)
and output or action variables (also called consequents).
• Differential equations are then solved analytically or using numerical methods (if
required).
The procedure stated above is nothing but the principle of hard computing.
• It may be suitable for the problems, which are easy to model mathematically and
whose stability is highly predictable.
1. Stress analysis of a mechanical member (say beam) subjected to some forms of loading
pattern
If the beam is assumed to have constant cross-section along its length, the problem
of stress analysis can be easily formulated mathematically. On the other hand, if the
beam is assumed to have varying cross-sections along its length, the principle of Finite
Element Method (FEM) can be used to determine the developed stress.
It is important to note that hard computing is applicable, if and only if the problem
can be formulated mathematically. Unfortunately, most of the real-world problems are so
complex and ill-defined that they cannot be modelled mathematically or the mathematical
modelling becomes highly non-linear. Moreover, some sort of imprecisions and uncertainties
are inherent to these problems. Thus, it may not always be possible to solve the complex
real-world problems using the principle of hard computing.
GA
GA−FL GA−NN
GA−FL−NN
FL NN
NN−FL
Figure 1.1: A schematic view showing different members of soft computing and their possible interactions.
• It may not be able to yield so much precise solution as that obtained by the hard
computing technique.
• Different members of this family are able to perform various types of tasks. For exam-
ple, Fuzzy Logic (FL) is a powerful tool for dealing with imprecision and uncertainty,
Neural Network (NN) is a potential tool for learning and adaptation and Genetic Al-
gorithm (GA) is an important tool for search and optimization. Each of these tools
has its inherent merits and demerits (which are discussed in detail, in the subsequent
chapters). In combined techniques (such as GA-FL, GA-NN, NN-FL, GA-FL-NN),
either two or three constituent tools are coupled to get the advantages from both of
them and remove their inherent limitations. Thus, in soft computing, the functions
of the constituent members are complementary in nature and there is no competition
among themselves.
1. Design and development of adaptive motion planners for intelligent and autonomous
robots
An intelligent and autonomous robot should be able to plan its collision-free, time-
optimal paths, while navigating in the presence of some moving obstacles in a dynamic
4 SOFT COMPUTING:Fundamentals and Applications
environment. Both FL- and NN-based adaptive motion planners have been designed
and developed for the intelligent and autonomous robots [3].
Most of the real-world problems are too complex to model mathematically. In such cases,
hard computing will fail to provide any solution, and we will have to switch over to soft
computing, in which precision is considered to be secondary and we are primarily interested
in acceptable solutions.
hard computing as well as soft computing have their inherent advantages and disadvantages.
To get the advantages of both these techniques and eliminate their individual limitations,
one may switch over to hybrid computing to solve a problem more efficiently. Thus, a
part of the problem will be solved using hard computing and the remaining part can be
tackled utilizing soft computing, if it so demands. Moreover, these two techniques may be
complementary to each other, while solving some complex real-world problems. However,
the users of hard computing often do not like soft computing people, due to their inertia
and they fight among themselves.
Summary 5
1. Optimal design of machine elements using Finite Element Method (FEM) and soft
computing
Several attempts have been made to design different machine elements using the FEM.
However, the quality of these solutions depends on the selection of the elements, their
size and connectivity. Moreover, material properties of these members may not remain
unchanged during their applications. Thus, there exists fuzziness in both the FEM
analysis as well as material properties. This fuzziness can be modelled using soft
computing, before the FEM analysis is finally carried out to obtain the optimal design
of machine elements [7].
1.4 Summary
This chapter has been summarized as follows:
1. Hard computing works based on the principle of mathematics and it generally yields
precise solutions. However, we can go for hard computing, if the problem is well-
defined and easy to model mathematically.
2. As most of the real-world problems are complex in nature and difficult to model
mathematically, hard computing may not be suitable to solve such problems. One
6 SOFT COMPUTING:Fundamentals and Applications
may switch over to soft computing to solve the above problems involving inherent
imprecisions and uncertainties.
3. Soft computing is a family composed of different members, namely FL, NN, GA and
their different combinations, in which precision is traded for tractability, robustness
and a low cost solution. It can provide some feasible solutions to the complex real-
world problems.
4. The concept of hybrid computing that combines the hard computing with soft com-
puting, has also been emerged to get advantages from both of them and eliminate
their individual limitations.
5. Selection of a suitable computing scheme for solving a problem depends on its nature.
1.5 Exercise
1. Define briefly the terms: soft computing, hard computing and hybrid computing with
some suitable examples.
3. How do you select a suitable scheme of computing (either hard computing or soft
computing or hybrid computing) to solve a particular problem ?
Chapter 2
This chapter introduces the concept of optimization and discusses some of its traditional
methods (also known as conventional or classical methods). Traditional methods of opti-
mization include both gradient-based and direct search techniques. A detailed discussion on
all these traditional methods of optimization is beyond the scope of this book. An attempt
has been made in this chapter to explain the working principles of a few methods only,
namely Exhaustive Search Method, Random Walk Method and Steepest Descent
Method.
A Numerical Example:
x2
Determine the minimum/maximum/inflection point of the function f (x) = 2 + 125
x for the
positive values of x.
Solution:
The function is:
x2 125
f (x) = 2 + x
Fig. 2.1 shows the plot of this function. Its first order derivative is given by f (x) = x − 125
x2 .
65
60
55
f(x)
50
45
40
35
2 3 4 5 6 7 8 9 10
x
x2 125
Figure 2.1: Plot of the function f (x) = 2
+ x
.
By considering f (x) = 0 and solving it, we get x = 5.0.
Therefore, the minimum/maximum/inflection point exists at x = 5.0.
The second order derivative of this function is given by f (x) = 1 + 250
x3 .
At x = 5.0, f (x) = 3.0 = 0.0.
Therefore, n is found to be equal to 2 and it indicates that the local optimum exists at
x = 5.0.
As f (x) is seen to be equal to 3.0 (a positive number), it can be declared that the local
minimum exists at x = 5.0.
The minimum value of f (x) turns out to be equal to 37.5.
Introduction to Optimization 9
known as design or decision variables and the fixed parameter ρ is called pre-assigned
parameter. The design variables have some feasible bounds, which are known as geometric
or side constraints. The aim of this optimization is to search a lighter design, for which its
weight has been expressed with the help of an objective function. Moreover, the pointer
should be able to satisfy a few constraints (in terms of its strength and deflection) during
its usage, which are known as functional or behavior constraints.
The above optimization problem can be expressed mathematically as follows:
πd2 L ρ
Minimize Mass of the pointer M = (2.1)
12
subject to
deflection δ ≤ δallowable ,
strength of the stick s ≥ srequired
and
dmin ≤ d ≤ dmax ,
Lmin ≤ L ≤ Lmax .
Here, equation (2.1) is called the objective function. The constraints related to deflection
and strength of the stick are known as the functional constraints. The lower and upper
limits of d and L are expressed as the geometric or side constraints.
10 SOFT COMPUTING:Fundamentals and Applications
1. Depending on the nature of equations involved in the objective function and con-
straints, they are divided into two groups, namely linear and non-linear optimiza-
tion problems, which are defined below.
2. Based on the existence of any functional constraint, optimization problems are clas-
sified into two groups, such as un-constrained (without any functional constraint)
and constrained (when at least one functional constraint is present) optimization
problems, the examples of which are given below.
where
Introduction to Optimization 11
x1 , x2 ≥ 0.
• Constrained optimization problem
subject to
gi (x1 , x2 ) ≤ ci , i = 1, 2, . . . , n
and
x1 , x2 ≥ 0.
3. Depending on the type of design variables, optimization problems are clustered into
three groups, namely integer programming, real-valued programming and mixed-
integer programming problems, which are briefly discussed below.
subject to
x1 + x2 ≤ 3,
5x1 + 2x2 ≤ 9
and
x1 , x2 ≥ 0,
x1 , x2 are the integers.
• Real-valued programming problem – An optimization problem is known as
a real-valued programming problem, if all the design variables are bound to take
only real values.
Example:
Maximize y = f (x1 , x2 ) = 2x1 + x2 (2.7)
subject to
x1 + x2 ≤ 3.2,
5x1 + 2x2 ≤ 10.0
and
x1 , x2 ≥ 0.0,
x1 , x2 are the real variables.
12 SOFT COMPUTING:Fundamentals and Applications
4. Depending on the nature of design variables, optimization problems are classified into
two groups, such as static and dynamic, as discussed below.
gi (x1 , x2 ) ≤ ci , i = 1, 2, . . . , n
and
x1 ≥ xmin
1 ,
x2 ≥ xmin
2 ,
where a and b are the constants and n indicates the number of functional constraints.
Fig. 2.3 shows the plots of the constraints. Depending on the nature of these constraints, a
feasible zone has been identified. Any point lying in the feasible zone is a probable candidate
Introduction to Optimization 13
x Side constraint
2
Functional constraints
Feasible zone
A Optimal
solution
Functional constraints
Side constraint
(a,b)
x
(0,0) 1
y
1
y
2
y
3
y
4
y
5
Figure 2.3: A schematic view explaining the principle of optimization.
for the optimal solution. The points residing inside the feasible zone are called free points,
whereas the points lying on boundary of the feasible zone are known as bound points.
Thus, an optimal solution can be either a free point or a bound point contained in the feasible
zone. To determine the optimal solution, the following procedure is adopted. For different
fixed values of y (say y1 , y2 , . . . ), we draw contour plots of the objective function. The point
(say A), at which one of the contour plots just touches the feasible zone, is declared as the
optimal point and the corresponding optimized function value is determined. Thus, the
optimal solution of the constrained optimization problem is denoted by A, whereas that of
the corresponding un-constrained optimization problem is represented by the point (a, b),
the center of the contour plots.
subject to
x ≥ 0.0.
14 SOFT COMPUTING:Fundamentals and Applications
Fig. 2.4 shows the plot of the function. Let us also assume that the function reaches its
minimum value, corresponding to a value of x = x∗ . The above minimization problem can
y f(x)
x*
x
−f(x)
Figure 2.4: A function plot used to explain the duality principle of optimization.
subject to
x ≥ 0.0.
A detailed discussion on all these traditional optimization methods is beyond the scope of
this book. Interested readers may refer to the books [9, 10] for the above purpose. Although
the scope is limited, a few traditional methods are explained below, in detail.
subject to
xmin ≤ x ≤ xmax .
x min x x x x x x x max
I1 I2 I3 I4 I5 I(n−1)
x
Figure 2.6: A schematic view used to explain the principle of an exhaustive search method.
Fig. 2.6 shows the plot of the function to be optimized. Depending on the desired accuracy
in the solution, let us suppose that the range of the variable, that is, (xmax −xmin ) is divided
into n equal parts. Thus, the number of equi-spaced intermediate points lying in this range
becomes equal to (n − 1). The small change in x, that is, Δx is given by the expression
(xmax −xmin )
n . The following steps are used to locate the maximum value of the function:
• Step 1: We set
x1 = xmin
x2 = x1 + Δx = xI1
x3 = x2 + Δx = xI2
Traditional Methods of Optimization 17
• Step 2: We calculate the function values, that is, f (x1 ), f (x2 ), f (x3 ) and check for
the maximum point.
If f (x1 ) ≤ f (x2 ) ≥ f (x3 ), the maximum point lies in the range of (x1 , x3 ). We
terminate the program,
Else
x1 = x2 (previous)
x2 = x3 (previous)
x3 = x2 (present) + Δx
A Numerical Example:
Maximize y = f (x) = 2x2 − x3 (2.13)
subject to
0.0 ≤ x ≤ 2.0.
Solution:
Fig. 2.7 shows the plot of this function.
Given: xmin = 0.0 and xmax = 2.0.
1.2
0.8
0.6
y
0.4
0.2
0
0 0.5 1 1.5 2
x 1.333
• Step 1: Let us suppose that the range (xmax − xmin ) is divided into n = 10 equal
parts. We calculate the incremental change in x value, that is, Δx as follows:
18 SOFT COMPUTING:Fundamentals and Applications
We set
x1 = xmin = 0.0
x2 = x1 + Δx = 0.0 + 0.2 = 0.2
x3 = x2 + Δx = 0.2 + 0.2 = 0.4
Therefore,
Thus, the maximum does not lie in the interval (0.0, 0.4).
• Step 3: We set
x1 = x2 (previous) = 0.2
x2 = x3 (previous) = 0.4
x3 = x2 (present) + Δx = 0.4 + 0.2 = 0.6
Therefore,
Thus, the maximum does not lie in the interval (0.2, 0.6).
• Step 5: We set
x1 = x2 (previous) = 0.4
x2 = x3 (previous) = 0.6
x3 = x2 (present) + Δx = 0.6 + 0.2 = 0.8
Traditional Methods of Optimization 19
Therefore,
Thus, the maximum does not lie in the interval (0.4, 0.8).
• Step 7: We set
x1 = x2 (previous) = 0.6
x2 = x3 (previous) = 0.8
x3 = x2 (present) + Δx = 0.8 + 0.2 = 1.0
Therefore,
Thus, the maximum does not lie in the interval (0.6, 1.0).
• Step 9: We set
x1 = x2 (previous) = 0.8
x2 = x3 (previous) = 1.0
x3 = x2 (present) + Δx = 1.0 + 0.2 = 1.2
Therefore,
20 SOFT COMPUTING:Fundamentals and Applications
Thus, the maximum does not lie in the interval (0.8, 1.2).
x1 = x2 (previous) = 1.0
x2 = x3 (previous) = 1.2
x3 = x2 (present) + Δx = 1.2 + 0.2 = 1.4
Therefore,
Thus, the maximum does not lie in the interval (1.0, 1.4).
x1 = x2 (previous) = 1.2
x2 = x3 (previous) = 1.4
x3 = x2 (present) + Δx = 1.4 + 0.2 = 1.6
Therefore,
A coarse interval of x, that is, (1.2, 1.6) is obtained using n = 10. However, a finer interval
can be obtained by setting n to a higher value.
Note: The maximum value of this function is found to be equal to 1.185 analytically and
it occurs at x = 1.333.
Traditional Methods of Optimization 21
• Step 1: We start with an initial solution X1 , created at random. We set initial values
to λ, (permissible minimum value of λ) and maximum number of iterations to be
tried for improvement of the solution (that is, N ). We determine the function value
f1 = f (X1 ).
• Step 2: A set of n random numbers (lying between −1.0 and 1.0) are generated and
we calculate u1 .
• Step 3: We determine the function value using the expression given below.
• Step 5: If a better point Xi+1 is not obtained after running the program for N
iterations, we reduce λ to 0.5λ.
A Numerical Example:
Minimize f (x1 , x2 ) = 4x21 + 3x22 − 6x1 x2 − 4x1 (2.15)
subject to
22 SOFT COMPUTING:Fundamentals and Applications
−10.0 ≤ x1 , x2 ≤ 10.0.
f(x_1,x_2)
1400
1200
1000
800
600
400
200
0
-200
10
-10
0
-5 x_2
0 -5
x_1 5
10 -10
Figure 2.8: Plot of the function f (x1 , x2 ) = 4x21 + 3x22 − 6x1 x2 − 4x1 .
Some of the iterations carried out to solve the above problem using the random walk
method are:
1
We calculate R = (r12 + r22 ) 2 = 0.5385, which is less than 1.0. So, we consider
the above r values for determination of the unit random vector as given below.
1 r1 1 −0.5 −0.9285
u= 1 = 0.5385 =
(r12 +r22 ) 2 r2 0.2 0.3714
– Step 3: We determine the function value f2 as follows:
f2 = f (X2 ) = f (X1 + λu1 ) = f (−1.1142, 0.4457) = 12.9981.
−1.1142
As f2 > f1 , cannot be considered as X2 and we go for the next
0.4457
iteration.
• Iteration 2
0.0
– Step 1: We have X1 = and f1 = f (X1 ) = 0.0.
0.0
– Step 2: Let us consider another set of random numbers lying between −1.0 and
1.0 as follows:
r1 0.001
=
r2 0.1
1
We calculate R = (r12 + r22 ) 2 = 0.1000, which is less than 1.0. So, the above set
of r values can be used to determine the unit random vector like the following.
1 r1 1 0.001 0.01
u= 1 = 0.1 =
(r12 +r22 ) 2 r2 0.1 1.0
– Step 3: We determine the function value f2 as follows:
f2 = f (X2 ) = f (X1 + λu1 ) = f (0.012, 1.2) = 4.1862.
0.012
As f2 > f1 , will not be considered as X2 and we go for the next
1.2
iteration.
If X2 cannot be obtained after running the program for N = 100 iterations, we set λnew =
0.5 × λ. If λnew > , we repeat the iterations as explained above, else we declare optimal
X ∗ = X1 , f ∗ = f1 .
Gradient of a function:
Let us consider a continuous function of m variables as given below.
y = f (X) = f (x1 , x2 , . . . , xm ) (2.16)
Gradient of this function is defined as the collection of its partial derivatives with respect
to each of the m variables and it is denoted as follows:
∂f ∂f ∂f T
f = ( , ,..., ) (2.17)
∂x1 ∂x2 ∂xm
It is important to mention that the rate of change of a function is found to be the maximum
along its gradient direction. Thus, the direction of its gradient is nothing but the direction
of steepest ascent. In a steepest descent method, the search is carried out along a direction
opposite to its gradient. Fig. 2.9 shows the search directions of this algorithm at different
iterations.
x
2
Contour plots
x
1
Figure 2.9: A schematic view showing search directions of a steepest descent method.
where Xi and Xi+1 are the solution vectors at i-th and (i + 1)-th iterations, respectively,
λ∗i represents the optimal step length along the search direction Si = − fi .
Termination Criteria:
Any one of the following two criteria can be considered as the termination criterion of the
algorithm.
1. If the rate of change of function value, that is, f (Xi+1 )−f (Xi )
f (Xi ) becomes less than or
equal to a pre-defined small quantity 1 , the algorithm is terminated.
∂f
2. If the derivatives ∂x j
, j = 1, 2, . . . , m, come out to be less than or equal to a pre-
defined small quantity 2 , the program is terminated.
Traditional Methods of Optimization 25
Advantages:
It is one of the most popular traditional methods of optimization, due to the following
reasons:
1. It has a faster convergence rate.
A Numerical Example:
Minimize f (x1 , x2 ) = 4x21 + 3x22 − 6x1 x2 − 4x1 (2.19)
subject to
−10.0 ≤ x1 , x2 ≤ 10.0.
Fig. 2.8 shows the plot of the function. A few iterations of the steepest descent method
used to solve this problem are:
• Iteration 1:
0.0
Let us assume the initial solution created at random as X1 = .
0.0
The function value at X1 is determined as f1 = 0.0.
Gradient of the function is obtained as follows:
∂f
8x1 − 6x2 − 4
f = ∂x1 =
∂f
∂x2
−6x1 + 6x2
Now, the gradient of the objective function is found to be like the following at X1 .
−4
f1 = f (X1 ) =
0
To determine X2 , we need to know the value of optimal step length, that is, λ∗1 , for
the estimation of which, we minimize
26 SOFT COMPUTING:Fundamentals and Applications
Therefore, X2 is not the desired optimum point and we should go for the next iteration.
• Iteration 2:
The search direction at X2 is determined as follows:
0
S2 = − f 2 =
3
To determine X3 , we need to know the value of optimal step length, that is, λ∗2 , for
the estimation of which, we minimize
We put df
= 0.0 and get the optimal step length, that is, λ∗2 = 16 .
dλ2
1
We calculate X3 = X2 + λ∗2 S2 = 2
1
2
The function value at X3 is determined as f3 = − 74 .
The gradient of the function at X3 is determined as follows:
−3 0
f3 = f (X3 ) = =
0 0
Therefore, X3 is not the desired optimum point. We should go for the next iteration.
In the similar way, some more iterations are to be carried out, until it reaches the optimum
(minimum) point. Finally, the optimal solution of this function is found to be as follows:
2.0
Xopt = , fopt = −4.0.
2.0
Traditional Methods of Optimization 27
1. The final solution of an optimization problem solved using a traditional method de-
pends on the randomly chosen initial solution. If the initial solution lies in the local
basin, the final solution will get stuck at local optimum. Thus, if the user is lucky
enough to choose the initial solution lying in the global basin, the obtained optimal
solution may be global in nature (refer to Fig. 2.10).
f(x)
Local Global
basin
basin
Local minimum
Global minimum
Figure 2.10: A schematic view showing the local and global basins of an objective function.
2. For a discontinuous objective function, the gradient cannot be determined at the point
of discontinuity. Thus, the gradient-based methods cannot be used for such functions.
4. Discrete (integer) variables are difficult to handle using the traditional methods of
optimization, although there exists a separate integer programming method.
5. These methods may not be suitable for parallel computing, in which the total compu-
tation is distributed into a number of computers and they communicate one another
using an MPI (Message Passing Interface) algorithm.
Thus, it is necessary to develop an optimization method, which is not only efficient but also
robust in nature.
28 SOFT COMPUTING:Fundamentals and Applications
2.3 Summary
The content of this chapter may be summarized as follows:
2. Optimization problems have been classified in a number of ways, into different groups,
namely linear optimization problem, non-linear optimization problem, constrained op-
timization problem, un-constrained optimization problem, integer variables problem,
real variables problem, mixed-integer variables problem, static and dynamic optimiza-
tion problems, and others.
3. The principle of optimization has been explained with the help of an example.
5. The drawbacks of the traditional optimization methods are highlighted at the end of
this chapter.
2.4 Exercise
1. Define the following terms related to optimization by taking a suitable example: (i)
decision variables, (ii) objective function, (iii) functional constraints, (iv) geometric
constraints.
5. Why do the solutions of a steepest descent method get stuck at the local minima ?
30.0 ≤ v ≤ 190.0,
0.01 ≤ t ≤ 2.5,
0.5 ≤ d ≤ 4.0.
9. Minimize y = f (x) = x322 + x in the range of 0.0 < x ≤ 10.0. Use (i) analytical
approach based on differential calculus and (ii) exhaustive search method.
(Hints: Let the three values of x, say x1 , x2 and x3 are in ascending order. For a
minimization problem, if f (x1 ) ≥ f (x2 ) ≤ f (x3 ), then the minimum value lies in the
range of (x1 , x3 ).)