Soft Computing: Lecture Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 100

SOFT COMPUTING

LECTURE NOTES

INTRODUCTION TO SOFT COMPUTING


1. Concepts of Computing
2. Hard Computing
3. Soft Computing
4. How soft computing works?
5. Hard computing Vs soft computing
6. Hybrid computing
Concepts of computing:

Figure: Basic of computing


Computation is basically a mapping of some inputs to provide the desired output. 𝑦 = 𝑓(𝑥),
here f is a mapping function. f is also called a formal method or an algorithm to solve a
problem.
Important characteristics of computing

 Should provide precise solution.


 Control action should be unambiguous and accurate.
 Suitable for problem which is easy to model mathematically.
Hard computing

 In 1996, Lotfi Aliasker Zadeh (LAZ) introduced the term hard computing.
 According to LAZ: we term a computing as Hard computing, if
o Precise result is guaranteed.
o Control action is unambiguous.
o Control action is formally defined (i.e., with mathematical model or algorithm).
Examples of hard computing

 Solving numerical problems (e.g., roots of a polynomial, integration, etc)


 Searching and sorting techniques.
 Solving computational geometry problems (e.g., shortest tour in a graph, finding closet
pair of points given a set of points, etc.).

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Many more…
Soft computing
The term soft computing was proposed by the inventor of fuzzy logic, Lotfi A. Zadeh. He
describes it as follows:
Definition: Soft computing is a collection of methodologies that aim to exploit, the tolerance
for imprecision and uncertainty to achieve tractability, robustness, and low solution cost. Its
principal constituents are fuzzy logic, neuro-computing and probabilistic reasoning. The role
model for soft computing is human mind.
Characteristics of Soft Computing

 Is does not require any mathematical modeling of problem solving.


 It may not yield the precise solution.
 Algorithms are adaptive (i.e., it can adjust to the change of dynamic environment).
 Use some biological inspired methodologies such as genetics, evolution, Ant’s behaviors,
particles swarming, human nervous system, etc.).
Examples of Soft computing

Example: Hand written character recognition (Artificial Neural Networks)

Example: Money allocation problem (Evolutionary Computing)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example: Robot Movement (Fuzzy Logic)


How soft computing work
How a student learns from his teacher?
Here students is a system that the teacher is to develop.
o Teacher asks question and tell the answers to them.
o Teacher puts questions and hints answers and asks whether the answers are
correct or not.
o Students thus learn a topic and store in this memory.
o Based on the knowledge he solves new problems.
 This is the way how human brains works.
 Based on this concept Artificial neural network is used to solve problems.
How world selects the best?
o It starts with a population (random)
o Reproduces another population (next generation).
o Rank the population and selects the superior individuals.
 Genetic algorithm is based on this natural phenomena.
o Population is synonymous to solutions.
o Selection of superior solution is synonymous to exploring the optimal solution.
How a doctor treats his patients?
o Doctor asks the patient about suffering.
o Doctor find the symptoms of diseases.
o Doctor prescribed tests and medicines.
 This is exactly the way fuzzy logic works.
o Symptoms are correlated with diseases with uncertainty.
o Doctor prescribes tests/medicines fuzzily.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Hard computing Vs. Soft computing

Hard computing Soft Computing


1. It requires a precisely stated analytical 1. It is tolerant to imprecision, uncertainty,
model and often a lot of computation partial truth, and approximation.
time.
2. It is based on binary logic, crisp systems, 2. It is based on fuzzy logic, neural nets and
numerical analysis and crisp software. probabilistic reasoning.
3. It has the characteristics of precision and 3. It has the characteristic of approximation
categoricity. and dispositionality.
4. It is deterministic. 4. It incorporates stochastic.
5. It requires exact input data 5. It can deal with ambiguous and noisy data.
6. Is is strictly sequential. 6. It allows parallel computations.
7. It produces precise answers 7. It can yield approximate answers.

Hybrid computing

 It is a combination of the conventional hard computing and emerging soft computing.

Figure: Concept of Hybrid Computing


Course outline

 Basic concepts of fuzzy algebra and then how to solve problems using Fuzzy logic.
 The framework of Genetic algorithm and solving varieties of optimization problems.
 How to build an artificial neural network and train it with input data to solve a number
of problems, which are not possible to solve with hard computing.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

INTRODUCTION TO FUZZY LOGIC


What is Fuzzy Logic?

 Fuzzy logic is a mathematical language to express something.


o This means it has grammar, syntax, semantic like a language for communication.
 There are some other mathematical languages also known
o Relational algebra: operations on sets
o Boolean algebra: operations on Boolean variables
o Predicate algebra: operations on well formed formulae (WFF), also called
predicate propositions
 Fuzzy logic deals with fuzzy set of fuzzy algebra.
What is fuzzy?

 Dictionary meaning of fuzzy is not clear, noisy, etc.


o Example: Is the picture on this wall is fuzzy?
 Antonym of fuzzy is crisp
o Example: Are the chips crisp?

Crisp Logic
In the world of crisp logic the answer to any question is bi-valued i.e. Yes/No or True/False.

In the example below let us choose any liquid from milk, water, coke, and sprite and ask a
question that “Is the liquid colorless?”. The answer will be very obvious one of the two values
i.e. Yes/No.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Logic
On the contrary in fuzzy logic the answer to any question are multi-valued i.e. May be/May not
be/Absolutely/Partially/etc.. These represent real world scenarios where is quite difficult to
crisp answer like Yes/No.

In the example below let us select a person from the list given and ask “whether the person is
honest?”. The answer to this question can be Extremely honest/Very honest/Honest at
times/Extremely dishonest. A score can be assigned (on the right most side of the figure) to
each of these answers that measures the honesty of that person quantatively. The score
decides the honesty in a person, the more is the score the more honest the person is likely to
be and vice-versa.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

World is Fuzzy

In real world nothing can be answered with certainty and no value can as precisely calculated
for a given problem. The reason for this being the uncertainty and vagueness of data that is
available to us. Taking these vague data into consideration we cannot precisely answer any
question with certainty.

Concept of Fuzzy system

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Concept of Fuzzy Set


To understand the concept of fuzzy set it is better, if we first clear our idea of crisp set.
S = The entire population of the Class of soft computing.
G = All Girls students in the class ={𝑔 , 𝑔 , 𝑔 , … , 𝑔 }
B = All Boys students in the class = {𝑏 , 𝑏 , 𝑏 , … , 𝑏 }

Here, All are the sets of finite numbers of individuals. Such a set is called crisp set. The
traditional sets are called as crisp sets. These sets are bounded by a well defined boundary,
either the elements are in the set or outside.
Example of fuzzy set
Let us discuss about fuzzy set.
S = The entire population of the Class of soft computing.
G = All Good Students.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

G= 𝑔, 𝑓(𝑔) 𝑔 ∈ 𝑆} and 𝑓(𝑔) is a measurement of goodness of the student g.

Example:
𝐺 = {(𝐴𝑎𝑟𝑦𝑎, 0.8), (𝑅𝑎𝑔𝑖𝑛𝑖, 0.7), (𝑅𝑎𝑣𝑖𝑠ℎ, 0.1), (𝑆𝑢𝑛𝑖𝑡𝑎, 0.9)}
Crisp Set Fuzzy Set
1. 𝑆 = {𝑠|𝑠 ∈ 𝑋} 1. 𝑆 = {(𝑠, 𝜇(𝑠))|𝑠 ∈
𝑋 𝑎𝑛𝑑 𝜇(𝑠) 𝑖𝑠 𝑡ℎ𝑒 𝑑𝑒𝑔𝑟𝑒𝑒 𝑜𝑓𝑚𝑒𝑚𝑏𝑒𝑟𝑠ℎ𝑖𝑝}
2. It is a collection of elements 2. It is a collection of ordered pairs.
3. Inclusion of an element 𝑠 ∈ 𝑋 into S is 3. Inclusion of an element 𝑠 ∈ 𝑋 in S is fzzy,
crisp, that is, has strict boundary yes or no. that is, if present, then with a degree of
membership.

Note: A crisp set is a fuzzy set, but, a fuzzy set is not necessarily a crisp set.
Example:
𝐻 = {(ℎ , 1), (ℎ , 1), (ℎ , 1), … , (ℎ , 1)} is a non empty set with n elements.
𝑁 = {(𝑛 , 0), (𝑛 , 0), (𝑛 , 0), … , (𝑛 , 0)} is null set with no elements in it.
In case of a crisp set, the elements are with extreme values of degree of membership values
namely 1 or 0. So a crisp set can always be converted to a fuzzy set but the reverse in never
true.
Degree of membership
How to decide the degree of memberships of elements in a fuzzy set?

Cities Bangalore Bombay Hyderabad Kharagpur Madras Delhi


𝜇 0.95 0.90 0.80 0.01 0.65 0.75

How the cites of comfort can be judged?


By normalizing the feedback of persons residing in those cities.
Example: Course evaluation in a crisp way

𝐸𝑋 ∶ 𝑀𝑎𝑟𝑘𝑠 ≥ 90
𝐴 ∶ 80 ≤ 𝑀𝑎𝑟𝑘𝑠 < 90
𝐵 ∶ 70 ≤ 𝑀𝑎𝑟𝑘𝑠 < 80
𝐶 ∶ 60 ≤ 𝑀𝑎𝑟𝑘𝑠 < 70

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

𝐷 ∶ 70 ≤ 𝑀𝑎𝑟𝑘𝑠 < 60
𝑃 ∶ 35 ≤ 𝑀𝑎𝑟𝑘𝑠 < 50
𝐹 ∶ 𝑀𝑎𝑟𝑘𝑠 < 35

Course evaluation in a fuzzy way

Few examples of fuzzy set

 High Temperature
 Low Pressure
 Color of Apple
 Sweetness of Orange
 Weight of Mango
Note: Degree of membership values lie in the range[0,1].
Some basic terminologies and notations
Definition of Membership function and fuzzy set
“if X is a universe of discourse and 𝑥 ∈ 𝑋, then a fuzzy set A in X is defined as a set of ordered
pairs, that is 𝐴 = {(𝑥, 𝜇 (𝑥))|𝑥 ∈ 𝑋 } where 𝜇 (𝑥) is called the membership function for the
fuzzy set A”

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Note: 𝜇 (𝑥)map each element of X onto a membership grade/ value between 0 and 1 (both
inclusive).
Question: How and who decides 𝜇 (𝑥) for a fuzzy set A in X?
Example:
X = All cities in India
A = City of comfort

𝐴
= {(𝐷𝑒𝑙ℎ𝑖, 0.7), (𝐵𝑎𝑛𝑔𝑎𝑙𝑜𝑟𝑒, 0.9), (𝐶ℎ𝑒𝑛𝑛𝑎𝑖, 0.8), (𝐻𝑦𝑑𝑒𝑟𝑎𝑏𝑎𝑑, 0.6), (𝐾𝑜𝑙𝑘𝑎𝑡𝑎, 0.3), (𝐾ℎ𝑎𝑟𝑎𝑔𝑝𝑢𝑟, 0.0)}
Membership function with discrete membership values

Either elements or their membership values or both also may be discrete values

Membership function with continuous membership values

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Support : The support of a fuzzy set A is the set of all points 𝑥 ∈ 𝑋 such that 𝜇 (𝑥) > 0.

Core: The core of a fuzzy set A is the set of all points x in X such that 𝜇 (𝑋) = 1

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Normality: A fuzzy set A is a normal if its core is non-empty. In other words, we can always find
a point 𝑥 ∈ 𝑋 such that 𝜇 (𝑋) = 1

Crossover point : A crossover point of a fuzzy set A is a point 𝑥 ∈ 𝑋 at which 𝜇 (𝑋) = 0.5. That
is Crossover (A) = {𝑥|𝜇 (𝑥) = 0.5}.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Singleton: A fuzzy set whose support is a single point in X with 𝜇 (𝑥) = 1 is called a fuzzy
singleton. That is |𝐴| = {𝑥|𝜇 (𝑥) = 1}

𝜶-cut and strong 𝜶-cut:


The 𝛼-cut of a fuzzy set A is a crisp set defined by 𝐴 = {𝑥|𝜇 (𝑥) ≥ 𝛼}
The strong 𝛼-cut is defined similarly as 𝐴 = {𝑥|𝜇 (𝑥) > 𝛼}
Note: Support (A) = 𝐴 and Core (A) = 𝐴 .
Bandwidth:
For a fuzzy set, the bandwidth or width is defined as the distance between the two unique
crossover points:
𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ (𝐴) = |𝑥 − 𝑥 |
where 𝜇 (𝑥 ) = 𝜇 (𝑥 ) = 0.5
Symmetry:
A fuzzy set A is symmetric if its membership function around a certain point 𝑥 = 𝑐 , namely
𝜇 (𝑥 + 𝑐) = 𝜇 (𝑥 − 𝑐) for all 𝑥 ∈ 𝑋.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Open and closed Fuzzy set:


A fuzzy set A is
Open left: If lim 𝑥 → −∞ then 𝜋 (𝑥) = 1 and lim 𝑥 → +∞ then 𝜋 (𝑥) = 0
Open right: If lim 𝑥 → −∞ then 𝜋 (𝑥) = 0 and lim 𝑥 → +∞ then 𝜋 (𝑥) = 1
Closed: If lim 𝑥 → −∞ then 𝜋 (𝑥) = 0 and lim 𝑥 → +∞ then 𝜋 (𝑥) = 0

Fuzzy Vs. Probability:


Fuzzy: When we say about certainty of a thing
Example: A patient came to the doctor and he has tp diagnose sp that medicine can be
prescribed.
Doctor prescribed a medicine with certainty 60% that the patient is suffering from flue.
So, the disease will be cured with certainty of 60% and uncertainty 40%. Here, in stead
of flue, other diseases with some other certainties may be.
Probability: When we say about the chance of an event to occur.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example: India will win the T20 tournament with a chance 60% means that our of 100 matches,
India own 60 matches.
Prediction Vs. Forecasting
The fuzzy vs. probability is analogical to prediction vs. forecasting
Prediction: When you start guessing about things
Forecasting: When you take the information from the past job and apply it to new job.
The main difference:
Prediction is based on the best guess from experiences.
Forecasting is based on data you have actually recorded and packed from previous job.
Fuzzy membership functions
A fuzzy set is completely characterized by its membership function (sometimes abbreviated as
MF and denoted by 𝜇). So, it would be important to learn how a membership function can be
expressed (mathematically or otherwise).
Note: A membership function can be on
a. A discrete universe of discourse and
b. A continuous universe of discourse.

So, membership function on a discrete universe of course is trivial. However, a membership


function on a continuous universe of discourse needs a special attention. Following figures
show some typical examples of membership functions.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy membership: formulation and parameterization


In the following, we try to parameterize the different MFs on a continuous universe of
discourse.
Triangular MFs: A triangular MF is specified by three parameters {a,b,c} and can be formulated
as follow.
0 𝑖𝑓 𝑥 ≤ 𝑎
⎧𝑥 − 𝑎 ⎫
⎪ 𝑖𝑓 𝑎 ≤ 𝑥 ≤ 𝑏⎪
𝑡𝑟𝑖𝑎𝑛𝑔𝑢𝑙𝑒(𝑥; 𝑎, 𝑏, 𝑐) = 𝑏𝑐 −
−𝑥
𝑎
⎨ 𝑖𝑓 𝑏 ≤ 𝑥 ≤ 𝑐 ⎬
⎪𝑐 − 𝑏 ⎪
⎩ 0 𝑖𝑓 𝑐 ≤ 𝑥 ⎭

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Trapezoidal MF: It is specified by four parameters {a,b,c,d} and can be defined as follows:
0 𝑖𝑓 𝑥 ≤ 𝑎
⎧𝑥 − 𝑎 ⎫
⎪ 𝑖𝑓 𝑎 ≤ 𝑥 ≤ 𝑏⎪
⎪𝑏 − 𝑎 ⎪
𝑡𝑟𝑎𝑝𝑒𝑧𝑜𝑖𝑑(𝑥; 𝑎, 𝑏, 𝑐, 𝑑) = 1 𝑖𝑓 𝑏 ≤ 𝑥 ≤ 𝑐
⎨𝑑 − 𝑥 ⎬
⎪ 𝑖𝑓 𝑐 ≤ 𝑥 ≤ 𝑑 ⎪
⎪𝑑 − 𝑐 ⎪
⎩ 0 𝑖𝑓 𝑑 ≤ 𝑥 ⎭

Gaussian MF: It is specified by two parameters {𝑐, 𝜎} and can be defined as below:
( )
𝑔𝑎𝑢𝑠𝑠𝑖𝑎𝑛 (𝑥; 𝑐, 𝜎) = 𝑒

where c is the centroid

Generalized Bell: It is also called Cauchy MF. It is a generalized bell MF is specified by three
parameters {a,b,c} and is defined as:

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

1
𝑏𝑒𝑙𝑙(𝑥; 𝑎, 𝑏, 𝑐) =
𝑥−𝑐
1+
𝑎

Example of generalized with a=b=1 and c=0:


1
𝜇(𝑥) =
1 + |𝑥|

Generalized Bell MFs: Different shapes.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Sigmoidal MFs:
Parameter: {a,c}; where c = crossover point and a = slope at c;

1
𝑆𝑖𝑔𝑚𝑜𝑖𝑑(𝑥; 𝑎, 𝑐) =
1+𝑒

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Grading System
A fuzzy implementation will look like the following.

𝐸𝑥𝑐𝑒𝑙𝑙𝑒𝑛𝑡 ∶ 𝑀𝑎𝑟𝑘𝑠 ≥ 90
𝑉𝑒𝑟𝑦 𝐺𝑜𝑜𝑑 ∶ 75 ≤ 𝑀𝑎𝑟𝑘𝑠 < 90
𝐺𝑜𝑜𝑑 ∶ 60 ≤ 𝑀𝑎𝑟𝑘𝑠 < 75
𝐴𝑣𝑒𝑟𝑎𝑔𝑒 ∶ 50 ≤ 𝑀𝑎𝑟𝑘𝑠 < 60
𝑃𝑜𝑜𝑟 ∶ 35 ≤ 𝑀𝑎𝑟𝑘𝑠 < 50
𝐵𝑎𝑑 ∶ 𝑀𝑎𝑟𝑘𝑠 < 35
You can decide a standard fuzzy MF for each of the fuzzy grade.

Generation of MFs
Given a membership function of a fuzzy set representing a linguistic hedge, we can derive many
more MFs representing several other linguistic hedges using the concept of Concentration and
Dilation.

1. Concentration: 𝐴 = [𝜇 (𝑥)] ; 𝑘 > 1


2. Dilation: 𝐴 = [𝜇 (𝑥)] ; 𝑘 < 1
Example: Age = {Young, Middle-aged, Old}
Thus, corresponding to Young, we have: Not young, Very Young, Not very young and so on.
Similarly, with Old we can have: Not old, very old, very very old, extremely old, etc.
Thus 𝜇 (𝑥) = (((𝜇 (𝑥) ) ) ) and so on

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Or 𝜇 (𝑥) = 𝐴 .
= (𝜇 (𝑥)) .

Linguistic variables and values

𝜇 (𝑥) = 𝑏𝑒𝑙𝑙(𝑥, 20,2,0) =

𝜇 (𝑥) = 𝑏𝑒𝑙𝑙(𝑥, 30,3,100) =

𝜇 (𝑥) = 𝑏𝑒𝑙𝑙(𝑥, 30,6,50) =

𝑁𝑜𝑡 𝑦𝑜𝑢𝑛𝑔 = 𝜇 (𝑥) = 1 − 𝜇 (𝑥)

𝑌𝑜𝑢𝑛𝑔 𝑏𝑢𝑡 𝑛𝑜𝑡 𝑡𝑜𝑜 𝑦𝑜𝑢𝑛𝑔 = 𝜇 (𝑥) ∩ 𝜇 (𝑥)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Basic Fuzzy set operations: Union


𝑈𝑛𝑖𝑜𝑛 (𝐴 ∪ 𝐵): 𝜇 ∪ = max (𝜇 (𝑥), 𝜇 (𝑥))
Example:
𝐴 = {(𝑥 , 0.5), (𝑥 , 0.1), (𝑥 , 0.4)}and
𝐵 = {(𝑥 , 0.2), (𝑥 , 0.3), (𝑥 , 0.5)}
𝐶 = 𝐴 ∪ 𝐵 = {(𝑥 , 0.5), (𝑥 , 0.3), (𝑥 , 0.5)}
Graphically 𝐴 ∪ 𝐵 can be represented as below:

Basic Fuzzy set operations: Intersection


𝐼𝑛𝑡𝑒𝑟𝑠𝑒𝑐𝑡𝑖𝑜𝑛 (𝐴 ∩ 𝐵): 𝜇 ∩ = min (𝜇 (𝑥), 𝜇 (𝑥))
Example:

𝐴 = {(𝑥 , 0.5), (𝑥 , 0.1), (𝑥 , 0.4)}and


𝐵 = {(𝑥 , 0.2), (𝑥 , 0.3), (𝑥 , 0.5)}
𝐶 = 𝐴 ∩ 𝐵 = {(𝑥 , 0.2), (𝑥 , 0.1), (𝑥 , 0.4)}
Graphically 𝐴 ∩ 𝐵 can be represented as below:

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Basic Fuzzy set operations: Complement


𝐶𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡 (𝐴 ): 𝜇 = 1 − 𝜇 (𝑥)
Example:
𝐴 = {(𝑥 , 0.5), (𝑥 , 0.1), (𝑥 , 0.4)}and
𝐶 = 𝐴 = {(𝑥 , 0.5), (𝑥 , 0.9), (𝑥 , 0.6)}
Graphically 𝐴 can be represented as below:

Basic Fuzzy set operations: Product


Algebric product or Vector product (A.B):
𝜇 . (𝑥) = 𝜇 (𝑥). 𝜇 (𝑥)
Example:

𝐴 = {(𝑥 , 0.5), (𝑥 , 0.1), (𝑥 , 0.4)}and


𝐵 = {(𝑥 , 0.2), (𝑥 , 0.3), (𝑥 , 0.5)}
𝐶 = 𝐴. 𝐵 = {(𝑥 , 0.1), (𝑥 , 0.03), (𝑥 , 0.2)}

Scalar product (𝛼 x A):


𝜇 (𝑥) = 𝛼 x 𝜇 (𝑥)
Example:

𝐴 = {(𝑥 , 0.5), (𝑥 , 0.1), (𝑥 , 0.4)}and α = 2


𝐶 = 𝛼𝐴 = {(𝑥 , 1), (𝑥 , 0.2), (𝑥 , 0.8)}
Basic Fuzzy set operations: Sum and Difference
Sum (A+B): 𝜇 (𝑥) = 𝜇 (𝑥) + (𝑥) − 𝜇 (𝑥). 𝜇 (𝑥)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Difference (𝑨 – 𝑩 = 𝑨 ∩ 𝑩𝑪 ) : 𝜇 (𝑥) = 𝜇 ∩ (𝑥)

Disjunctive Sum: 𝑨⨁𝑩 = (𝑨𝑪 ∩ 𝑩) ∪ (𝑨 ∩ 𝑩𝑪 )

Bounded Sum : |𝑨(𝒙)⨁𝑩(𝒙)| = 𝝁|𝑨(𝒙)⨁𝑩(𝒙)| = 𝒎𝒊𝒏 𝟏, 𝝁𝑨(𝒙) + 𝝁𝑩(𝒙)

Bounded Difference : |𝑨(𝒙) ⊖ 𝑩(𝒙)| = 𝝁|𝑨(𝒙)⊝𝑩(𝒙)| = 𝒎𝒂𝒙{𝟎, , 𝝁𝑨(𝒙) + 𝝁𝑩(𝒙) − 𝟏}

Basic Fuzzy set operations: Equality and Power


𝑬𝒒𝒖𝒂𝒍𝒊𝒕𝒚 (𝑨 = 𝑩): 𝜇 (𝑥) = 𝜇 (𝑥)
𝑷𝒐𝒘𝒆𝒓 𝒐𝒇 𝒂 𝒇𝒖𝒛𝒛𝒚 𝒔𝒆𝒕 𝑨𝜶 : 𝜇 (𝑥) = (𝜇 (𝑥))
 If 𝛼 < 1, then it is called as dilation
 If 𝛼 > 1, then it is called as concentration

Basic Fuzzy set operations: Cartesian Product


Cartesian Product (A x B): 𝜇 (𝑥, 𝑦) = min (𝜇 (𝑥), 𝜇 (𝑦))

Example:
𝐴(𝑥) = {(𝑥 , 0.2), (𝑥 , 0.3), (𝑥 , 0.5), (𝑥 , 0.6)}
𝐵(𝑦) = {(𝑦 , 0.8), (𝑦 , 0.6), (𝑦 , 0.3)}
𝑦 𝑦 𝑦
𝑥 0.2 0.2 0.2
(A x B): 𝜇 (𝑥, 𝑦) = min 𝜇 (𝑥), 𝜇 (𝑦) = 𝑥 0.3 0.3 0.3
𝑥 0.5 0.5 0.3
𝑥 0.6 0.6 0.3

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Properties of Fuzzy sets


Commutative:

𝐴∪𝐵 =𝐵∪𝐴
𝐴∩𝐵 =𝐵∩𝐴
Associative:
(𝐴 ∪ 𝐵) ∪ 𝐶 = 𝐴 ∪ (𝐵 ∪ 𝐶)
(𝐴 ∩ 𝐵) ∩ 𝐶 = 𝐴 ∩ (𝐵 ∩ 𝐶)
Distributive:
𝐴 ∪ (𝐵 ∩ 𝐶) = (𝐴 ∪ 𝐵) ∩ (𝐴 ∪ 𝐶)
𝐴 ∩ (𝐵 ∪ 𝐶) = (𝐴 ∩ 𝐵) ∪ (𝐴 ∩ 𝐶)
Idempotence:
𝐴∪𝐴 =𝐴
𝐴∩𝐴 =𝐴
𝐴∪∅=𝐴
𝐴∩∅=∅
Transitivity:
If 𝐴 ⊆ 𝐵; 𝐵 ⊆ 𝐶 then A ⊆ C
Involution:

(𝐴 ) = 𝐴
De Morgan’s Law:
(𝐴 ∪ 𝐵) = 𝐴 ∩ 𝐵
(𝐴 ∩ 𝐵) = 𝐴 ∪ 𝐵
Example of Fuzzy Set Operations
Let A and B are two fuzzy sets defined over a universe of discourse X with membership function
𝜇 (𝑥) and 𝜇 (𝑥) respectively. Two MFs 𝜇 (𝑥) and 𝜇 (𝑥) are shown graphically.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Let’s plot the two membership functions on the same graph.

The Plots of union 𝐴 ∪ 𝐵 and intersection 𝐴 ∩ 𝐵 are shown in the figure below.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example : Complementation
The plots of complement 𝜋 (𝑥) of the fuzzy set A is shown in the figure below.

Fuzzy set operations: Practice


Consider the following two fuzzy sets A and B defined over a universe of discourse [0,5] of real
numbers with their membership functions.
𝑥
𝜇 (𝑥) = and μ (x) = 2
1+𝑥
Determine the membership functions if the following and draw then graphically.

1. 𝐴 , 𝐵
𝑥 1
𝐴 = 1 − 𝜇 (𝑥) = 1 − =
1+𝑥 1+𝑥
1 (2 − 1)
𝐵 = 1 − μ (x) = 1 − 2 = 1− =
2 2
2. 𝐴 ∪ 𝐵
3. 𝐴 ∩ 𝐵

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

4. (𝐴 ∪ 𝐵)

1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐴 𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐵

1 1

0.9 0.9

0.8 0.8

0.7 0.7

0.6 0.6

0.5 0.5

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐴 𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐵

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

1 0.5

0.95 0.45

0.9 0.4

0.85 0.35

0.8 0.3

0.75 0.25

0.7 0.2

0.65 0.15

0.6 0.1

0.55 0.05

0.5 0
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10

𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐴 ∪ 𝐵 𝐹𝑢𝑧𝑧𝑦 𝑠𝑒𝑡 𝐴 ∩ 𝐵

0.5 1

0.45 0.95

0.4 0.9

0.35 0.85

0.3 0.8

0.25 0.75

0.2 0.7

0.15 0.65

0.6
0.1

0.55
0.05

0.5
0 0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9 10

𝐹𝑢𝑧𝑧𝑦 𝑆𝑒𝑡 (𝐴 ∪ 𝐵) 𝐹𝑢𝑧𝑧𝑦 𝑆𝑒𝑡 (𝐴 ∩ 𝐵)

Example: A real-life example


Two fuzzy sets A and B with membership functions 𝜇 (𝑥) and 𝜇 (𝑥), respectively defined as
below.
A = Cold Climate with 𝜇 (𝑥) as the MF.
B = Hot Climate with 𝜇 (𝑥) as the MF.
X = Universe of discourse representing entire range of temperature.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

What are the fuzzy sets representing the following?


1. Not cold climate
2. Not hot climate
3. Extreme climate
4. Pleasant climate
Note: “Not cold climate” ≠ “Hot climate” and vice-versa.
Answer would be the following.
1. Not cold climate
𝐴 𝑤𝑖𝑡ℎ 1 − 𝜇 (𝑥) as the MF
2. Not hot climate
𝐵 𝑤𝑖𝑡ℎ 1 − 𝜇 (𝑥) as the MF
3. Extreme climate
𝐴 ∪ 𝐵 𝑤𝑖𝑡ℎ 𝜇 ∪ (𝑥) = max (𝜇 (𝑥), 𝜇 (𝑥)) as the MF
4. Pleasant climate
𝐴 ∩ 𝐵 𝑤𝑖𝑡ℎ 𝜇 ∩ (𝑥) = min (𝜇 (𝑥), 𝜇 (𝑥)) as the MF

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Relations

 Crisp Relations
 Operation on crisp relations
 Example on crisp relations
 Fuzzy relations
 Operations on Fuzzy relations
 Examples on fuzzy relations
Crisp relations

 Order pair:
Suppose, A and B are two crisp sets. Then Cartesian product denoted as A x B is a
collection of order pairs, such that
𝐴 x 𝐵 = {(𝑎, 𝑏)|𝑎 ∈ 𝐴 𝑎𝑛𝑑 𝑏 ∈ 𝐵}
Nore:
1. 𝐴 𝑥 𝐵 ≠ 𝐵 𝑥 𝐴
2. |𝐴 𝑥 𝐵| = |𝐴|𝑥 |𝐵|
3. 𝐴 𝑥 𝐵 provides a mapping from 𝑎 ∈ 𝐴 𝑡𝑜 𝑏 ∈ 𝐵
A particular mapping so mentioned is called a relation.
Example:
Consider the two crisp set A and B as given below. A={1,2,3,4} and B={3,5,7}
Then A x B ={(1,3), (1,5), (1,7), (2,3), (2,5), (2,7), (3,3), (3,5), (3,7), (4,3), (4,5), (4,7)}
Let us define a relation as 𝑅 = {(𝑎, 𝑏)|𝑏 = 𝑎 + 1, (𝑎, 𝑏) ∈ 𝐴 𝑥 𝐵}
Then R={(2,3),(4,5)} in this case.
We can represent the relation R in a matrix form as follows.
1 0 0 0
𝑅=2 1 0 0
3 0 0 0
4 0 1 0
Operations on crisp relations
Suppose, R(x,y) and S(x,y) are the two relations defined over two crisp set 𝑥 ∈ 𝐴 𝑎𝑛𝑑 𝑦 ∈ 𝐵

 Union: 𝑅(𝑥, 𝑦) ∪ 𝑆(𝑥, 𝑦) = max 𝑅(𝑥, 𝑦), 𝑆(𝑥, 𝑦) ;


 Intersection: 𝑅(𝑥, 𝑦) ∩ 𝑆(𝑥, 𝑦) = min 𝑅(𝑥, 𝑦), 𝑆(𝑥, 𝑦) ;
 Complement: 𝑅(𝑥, 𝑦) = 1 − 𝑅(𝑥, 𝑦)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example: Operations on crisp relation


0 1 0 0 1 0 0 0
𝑅= 0 0 1 0 𝑎𝑛𝑑 𝑆 = 0 1 0 0
0 0 0 1 0 0 1 0
0 0 0 0 0 0 0 1
1 1 0 0 0 0 0 0
𝑅∪𝑆 = 0 1 1 0 𝑎𝑛𝑑 𝑅 ∩ 𝑆 = 0 0 0 0
0 0 1 1 0 0 0 0
0 0 0 1 0 0 0 0
1 0 1 1 0 1 1 1
𝑅= 1 1 0 1 𝑎𝑛𝑑 𝑆̅ = 1 0 1 1
1 1 1 0 1 1 0 1
1 1 1 1 1 1 1 0
Composition of two crisp relations
Given R is a relation on X, Y and S is another relation on Y,Z. Then, RoS is called a compostion of
relation on X and Z which is defined as follows.
𝑅 ∘ 𝑆 = {(𝑥, 𝑧)|(𝑥, 𝑦) ∈ 𝑅 𝑎𝑛𝑑 (𝑦, 𝑧) ∈ 𝑆 𝑎𝑛𝑑 ∀𝑦 ∈ 𝑌}
Max-Min Composition
Given the two relation matrices R and S, the max-min composition defined as 𝑇 = 𝑅 ∘ 𝑆;
𝑇(𝑥, 𝑧) = max {min {𝑅(𝑥, 𝑦), 𝑆(𝑦, 𝑧)𝑎𝑛𝑑 ∀𝑦 ∈ 𝑌}}
Example: Given X={1,3,5}; Y={1,3,5} and Z={1,3,5}, R={(x,y)|y=x+2}; and S={(y,z)|y<z}.
Here, R and S is on XxY and YxZ respectively.
Thus we have R={(1,3),(3,5)}, and S={(1,3),(1,5),(3,5)}
0 1 0 0 1 1
𝑅= 0 0 1 𝑎𝑛𝑑 𝑆 = 0 0 1
0 0 0 0 0 0
0 0 1
Using max-min composition 𝑅 ∘ 𝑆 = 0 0 0
0 0 0
Fuzzy relations
X={typhoid, viral, cold}, Y={running nose, high temp, shivering}. The fuzzy relation R is defined
𝑟𝑢𝑛𝑛𝑖𝑛𝑔 𝑛𝑜𝑠𝑒 ℎ𝑖𝑔ℎ 𝑡𝑒𝑚𝑝 𝑠ℎ𝑖𝑣𝑒𝑟𝑖𝑛𝑔
as 𝑅 = 𝑡𝑦𝑝ℎ𝑜𝑖𝑑 0.1 0.9 0.8
𝑣𝑖𝑟𝑎𝑙 0.2 0.9 0.7
𝑐𝑜𝑙𝑑 . 0.9 0.4 0.6

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Cartesian Product


Suppose

 A is a fuzzy set on the universe of discourse X𝜇 (𝑥)|𝑥 ∈ 𝑋


 B is a fuzzy set on the universe of discourse X𝜇 (𝑥)|𝑥 ∈ 𝑋
Then 𝑅 = 𝐴 𝑥 𝐵 ⊂ 𝑋 𝑥 𝑌; where R has its membership function given by 𝜇 (𝑥, 𝑦) =
𝜇 (𝑥, 𝑦) = min {𝜇 (𝑥), 𝜇 (𝑦)}
Example:
𝐴 = {(𝑎 , 0.2), (𝑎 , 0.7), (𝑎 , 0.4)} and 𝐵 = {(𝑏 , 0.5), (𝑏 , 0.6)}

𝑏 𝑏
𝑎 0.2 0.2
𝑅 =𝐴𝑥𝐵=
𝑎 0.5 0.6
𝑎 0.4 0.4
Suppose, R(x,y) and S(x,y) are the two fuzzy relations defined over A x B.

 Union: 𝜇 ∪ = max 𝜇 (𝑥, 𝑦), 𝜇 (𝑥, 𝑦) ;


 Intersection: 𝜇 ∩ = min 𝜇 (𝑥, 𝑦), 𝜇 (𝑥, 𝑦) ;
 Complement: 𝜋 = 1 − 𝜋 (𝑥, 𝑦)
 Composition: 𝑇 = 𝑅 ∘ 𝑆 = 𝜋 ∘ = max ∈ {min 𝜇 (𝑥, 𝑦), 𝜇 (𝑦, 𝑧) }

Example: 𝑋 = {𝑥 , 𝑥 , 𝑥 }, 𝑌 = {𝑦 , 𝑦 } 𝑎𝑛𝑑 𝑍 = {𝑧 , 𝑧 , 𝑧 }
𝑦 𝑦
𝑧 𝑧 𝑧
𝑥 0.5 0.1
𝑅= 𝑎𝑛𝑑 𝑆 = 𝑦 0.6 0.4 0.7
𝑥 0.2 0.9
𝑦 0.5 0.8 0.9
𝑥 0.8 0.6

𝑧 𝑧 𝑧
𝑥 0.5 0.4 0.5
𝑅∘𝑆=
𝑥 0.5 0.8 0.9
𝑥 0.6 0.6 0.7

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example:
Consider the following two sets P and D, which represent a set of paddy plants and a set of
plants diseases. More precisely
𝑃 = {𝑃 , 𝑃 , 𝑃 , 𝑃 } a set of four varieties of paddy plants
𝐷 = {𝐷 , 𝐷 , 𝐷 , 𝐷 } a set of the four various diseases affecting the plants.
In addition to these, also consider another set 𝑆 = {𝑆 , 𝑆 , 𝑆 , 𝑆 } be the common symptoms of
the diseases.
Let, R be a relation on P x D, representing which plant is susceptible to which diseases which is
stated as
𝐷 𝐷 𝐷 𝐷
𝑃 0.6 0.6 0.9 0.8
𝑅=𝑃 0.1 0.2 0.9 0.8
𝑃 0.9 0.3 0.4 0.8
𝑃 0.9 0.8 0.4 0.2
Also, consider T to be the another relation on D x S, which is given by
𝑆 𝑆 𝑆 𝑆
𝐷 0.1 0.2 0.7 0.9
𝑇=𝐷 1.0 1.0 1.0 0.6
𝐷 0.0 0.0 0.5 0.9
𝐷 0.9 1.0 0.8 0.2
Obtain the association of plants with the different symptoms of the disease using max-min
composition.
𝑆 𝑆 𝑆 𝑆
𝑃 0.8 0.8 0.8 0.9
𝑅∘𝑇 =𝑃 0.8 0.8 0.8 0.9
𝑃 0.8 0.8 0.8 0.9
𝑃 0.8 0.8 0.7 0.9
Example:

𝑎 𝑏
𝛼 𝛽 𝛾 𝛿
0.1 0.3 0.5 0.7 𝛼 0.9 0.1
𝑅= 1 𝑎𝑛𝑑 𝑆 = 𝛽 0.2 0.3
2 0.4 0.2 0.8 0.9
𝛾 0.5 0.6
3 0.6 0.8 0.3 0.2
𝛿 0.7 0.2

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Find 𝑅 ∘ 𝑆

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

2D Membership function: Binary fuzzy relations


(Binary) Fuzzy relations are fuzzy set A x B which map each element in A x B to a membership
grade between 0 and 1 (both inclusive).
Note that a membership function of a binary fuzzy relation can be depicted with a 3D plot.

2D membership function: An example


Let, X = R+ = y (the positive real line) and
R = X x Y = “y is much greater than x”
The membership function of 𝜋 (𝑥, 𝑦) is defined as
(𝑦 − 𝑥)
𝑖𝑓 𝑦 > 𝑥 
𝜇 (𝑥, 𝑦) = 4
0 𝑖𝑓 𝑦 ≤ 𝑥
Suppose, X = {3, 4, 5} and Y = {3, 4, 5, 6, 7} then
3 4 5 6 7
𝑅= 3 0.0 0.25 0.5 0.75 1.0
4 0. 0 0.0 0.25 0.5 0.75
5 0.0 0.0 0 0.25 0.5
How you can derive the following?
If x is A or y is B then z is C;
Given that

 R1: of x is A then z is C [𝑅1 ∈ 𝐴 𝑥 𝐶 ]


 R2: of y is B then z is C [𝑅2 ∈ 𝐵 𝑥 𝐶 ]
Hint:
You have given two relations R1 and R2.
Then, the required can be derived using the union operation of R1 and R2.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Proposition:

 Two valued logic vs. Multi-valued logic


 Example of Fuzzy proposition
 Fuzzy proposition vs. crisp proposition
 Canonical representation of fuzzy proposition
 Graphical representation of Fuzzy proposition
Two valued logic vs. Multi-valued logic

 The basic assumption upon which crisp logic is based- that every proposition is either
TRUE or FLASE
 The classical two-valued logic can be extended to multi-valued logic,
 As an example, three valued logic to denote true(1), false(0) and indeterminacy (1/2).
Different operations with three-valued logic can be extended as shown in the truth table:

𝒂 𝒃 ⋀ ⋁ ~𝒂  =
0 0 0 0 0 1 1
0 ½ 0 ½ 0 1 ½
0 1 0 1 0 1 0
½ 0 0 ½ ½ ½ ½
½ ½ ½ ½ ½ ½ 1
½ 1 ½ 1 ½ 1 ½
1 0 0 1 1 0 0
1 ½ ½ 1 1 ½ ½
1 1 1 1 1 1 1
Fuzzy connective used in the above table are:

 AND (⋀)
 OR (⋁)
 NOT (~)
 IMPLICATION (=> )
 EQUAL (=)
Fuzzy connectives defined for such a three-valued logic better can be stated as follows:

Symbol Connective Usage Definition


~ NOT ~P 1 − 𝑇(𝑃)
⋁ OR P⋁Q max {𝑇(𝑃), 𝑇(𝑄)}
⋀ AND P⋀Q min {𝑇(𝑃), 𝑇(𝑄)}
=> IMPLICATION (𝑃 => 𝑄) 𝑜𝑟 (~𝑃 ⋁Q) max {(1 − 𝑇(𝑃)), 𝑇(𝑄)}

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

= EQUALITY (𝑃 = 𝑄) 𝑜𝑟 [(𝑃 => 𝑄)⋀(𝑄 => 𝑃)] 1-{𝑇(𝑃) − 𝑇(𝑄)}

Fuzzy proposition: Example 1


P: Ram is honest
T(P) = 0.0 : Absolutely false
T(P) = 0.2 : Partially false
T(P) = 0.4 : May be false or not false
T(P) = 0.6 : May be true of not true
T(P) = 0.8 : Partially true
T(P) = 1.0 : Absolutely true

P : Mary is efficient ; T(P) = 0.8


Q : Ram is efficient ; T(Q) = 0.6

 Mary is not efficient.


o T(~P) = 1 – T(P) =0.2
 Mary is efficient and so is Ram.
o T(P⋀Q) = min { T(P), T(Q) } = 0.6
Example 2:

 Either Mary or Ram is efficient.


o T(P∨Q) = max { T(P), T(Q) } = 0.8
 If Mary is efficient then so is Ram.
o T(P=> Q) = max { 1 - T(P), T(Q) } = 0.6
Fuzzy proposition Vs. Crisp proposition

 The fundamental difference between crisp (classical) proposition and fuzzy propositions
is in the range of the truth values.
 While each classical proposition is required to be either true of false, the truth or galsity
of fuzzy proposition is a matter of degree.
 The degree of truth of each fuzzy proposition is expressed by a value in the interval [0.1]
both inclusive.
Canonical representation of fuzzy proposition

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Suppose, X is a universe of discourse of five persons. Intelligent of x ∈ 𝑋 is a fuzzy set as


defined below.
o 𝐼𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡: {(𝑥 , 0.3), (𝑥 , 0.4), (𝑥 , 0.1), (𝑥 , 0.6), (𝑥 , 0.9)}
 We define a fuzzy proposition as follows:
o 𝑃: 𝑥 𝑖𝑠 𝐼𝑛𝑡𝑒𝑙𝑙𝑖𝑔𝑒𝑛𝑡
 The canonical form of fuzzy proposition of this type, P is expressed by the sentence.
o 𝑃: 𝑣 𝑖𝑠 𝐹
 Predicate in terms of fuzzy set.
𝑃: 𝑣 𝑖𝑠 𝐹; where v is an element that takes values v from some universal set V and F is a
fuzzy on V that represents a fuzzy predicate.

 In other words, given, a particular element v, this element belongs to F with


membership grade 𝜋 (𝑣).
Graphical interpretation of fuzzy proposition

For a given value v of variable V in proposition P, T(P) denotes the degree of truth proposition
P.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Implications

 Fuzzy Rule
 Examples of fuzzy implications
 Interpretation of fuzzy rules
 Product operators
 Zadeh’s Max-Min rule and some example
Fuzzy Rule

 A fuzzy implication (also known as fuzzy if-then rule, fuzzy rule or fuzzy conditional
statement) assumes the form:
o 𝒊𝒇 𝑥 𝑖𝑠 𝐴 𝒕𝒉𝒆𝒏 𝑦 𝑖𝑠 𝐵 where, A and B are linguistic variables defined by fuzzy
sets A and B on the universe of discourses X and Y, respectively.
 Often, x is A is called the antecedent or premise, while y is B is called the consequence
or conclusion.
Fuzzy Implication : Example 1

 If pressure is High then temperature in Low


 If mango is Yellow then mango is Sweet else mango is Sour
 If road is Good then driving is Smooth else traffic is High
 The fuzzy implication is denoted as R : A -> B
 In essence, it represents a binary fuzzy relation R on the (Cartesian) product A x B
Fuzzy Implication: Example 2

 Suppose, P and T are two universes of discourses representing pressure and


temperature, respectively as follows.
P = {1, 2, 3, 4} and T = {10, 15, 20, 25, 30, 35, 40, 45, 50}
 Let the linguistic variable High temperature and Low pressure are given as
𝑇 = {(20,0.2), (25,0.4), (30,0.6), (35,0.6), (40,0.7), (45,0.8), (50,0.8)}
𝑃 = {(1,0.8), (2,0.8), (3,0.6), (4,0.4)}
Then the fuzzy implication if temperature is High then pressure is Low can be defined as
𝑅∶𝑇 →𝑃
1 2 3 4
20 0.2 0.2 0.2 0.2
25 0.4 0.4 0.4 0.4
𝑤ℎ𝑒𝑟𝑒, 𝑅 = 30 0.6 0.6 0.6 0.4
35 0.6 0.6 0.6 0.4
40 0.7 0.7 0.6 0.4
45 0.8 0.8 0.6 0.4
50 0.8 0.8 0.6 0.4

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Note: If temperature is 40 then what about low pressure?


Interpretation of fuzzy rules
In general, there are two ways to compute the fuzzy rule A -> B as

 A coupled with B
 A entails B
Interpretation as A coupled with B

𝑅 ∶𝐴→𝐵 =𝐴𝑥𝐵 =∫ 𝜇 (𝑥) ∗ 𝜇 (𝑦)|(𝑥, 𝑦); where * is called a T-norm operator.

The most frequently used T-norm operators are:

 Minimum : 𝑇 (𝑎, 𝑏) = min(𝑎, 𝑏) = 𝑎 ∧ 𝑏


 Algebraic product : 𝑇 (𝑎, 𝑏) = 𝑎𝑏
 Bounded product : 𝑇 (𝑎, 𝑏) = 0 ∨ (𝑎 + 𝑏 − 1)
𝑎 𝑖𝑓 𝑏 = 1
 Drastic product : 𝑇 = 𝑏 𝑖𝑓 𝑎 = 1  
0 𝑖𝑓 𝑎, 𝑏 < 1

Here, a =𝜋 (𝑥) and b =𝜋 (𝑦). T is called the function of T-norm operator.


Based on the T-norm operator as defined, we can automatically define the fuzzy rule 𝑅 ∶ 𝐴 → 𝐵
as a fuzzy set with two-dimensional MF:

𝜇 (𝑥, 𝑦) = 𝑓 𝜇 (𝑥), 𝜇 (𝑦) = 𝑓(𝑎, 𝑏) 𝑤𝑖𝑡ℎ 𝑎 = 𝜇 (𝑥), 𝑏 = 𝜇 (𝑦) and f is the fuzzy
implication function.
In the following, few implications of 𝑅 ∶ 𝐴 → 𝐵
Min operator:

𝑅 =𝐴𝑥𝐵 =∫ 𝜇 (𝑥) ∧ 𝜇 (𝑦)|(𝑥, 𝑦); or 𝑓 (𝑎, 𝑏) = 𝑎 ∧ 𝑏 [Mamdani Rule]

Algebraic product operator:

𝑅 =𝐴𝑥𝐵 =∫ 𝜇 (𝑥). 𝜇 (𝑦)|(𝑥, 𝑦); or 𝑓 (𝑎, 𝑏) = 𝑎𝑏 [Larser Rule]

Interpretation of A entails B
There are three main ways to interpret such implication:

 Material Implication:
o 𝑅∶𝐴→𝐵=𝐴 ∪ 𝐵

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Propositional Calculus:
o 𝑅 ∶ 𝐴 → 𝐵 = 𝐴 ∪ (𝐴 ∪ 𝐵)
 Extended propositional calculus:
o 𝑅 ∶ 𝐴 → 𝐵 = (𝐴 ∩ 𝐵 ) ∪ 𝐵
Product Operators:

 Bounded product operator


𝑅 = 𝐴 𝑥 𝐵 = ∫ 𝜇 (𝑥) ⊙ 𝜇 (𝑦)|(𝑥, 𝑦) = ∫ 0 ∨ (𝜇 (𝑥) + 𝜇 (𝑥) − 1)|(𝑥, 𝑦) or
𝑓 (𝑎, 𝑏) = 0 ∧ (𝑎 + 𝑏 − 1)
 Drastic product operator
𝑎 𝑖𝑓 𝑏 = 1
𝑅 =𝐴𝑥𝐵 =∫ 𝜇 (𝑥) ⏞. 𝜇 (𝑦)|(𝑥, 𝑦) or 𝑓 (𝑎, 𝑏) = 𝑏 𝑖𝑓 𝑎 = 1  
0 𝑖𝑓 𝑎, 𝑏 < 1

With the above mentioned implications, there are a number of fuzzy implication functions that
are popularly followed in fuzzy rule-based system.

 Zadeh’s arithmetic rule:


𝑅 = 𝐴̅ ∪ 𝐵 = ∫ 1 ∧ (1 − 𝜇 (𝑥) + 𝜇 (𝑦))|(𝑥, 𝑦) or 𝑓 (𝑎, 𝑏) = 1 ∧ (1 − 𝑎 + 𝑏)
 Zadeh’s max-min rule:
𝑅 = 𝐴̅ ∪ (𝐴 ∩ 𝐵) = ∫ 1 ∧ (1 − 𝜇 (𝑥)) ∨ (𝜇 (𝑥) ∧ 𝜇 (𝑦))|(𝑥, 𝑦) or 𝑓 (𝑎, 𝑏) =
(1 − 𝑎) ∨ (𝑎 ∧ 𝑏)
 Boolean fuzzy rule:
𝑅 = 𝐴̅ ∪ 𝐵 = ∫ (1 − 𝜇 (𝑥))⋁𝜇 (𝑦))|(𝑥, 𝑦) or 𝑓 (𝑎, 𝑏) = (1 − 𝑎)⋁𝑏
 Goguen’s fuzzy rule:
1 𝑖𝑓 𝑎 ≤ 𝑏
𝑅 =∫ 𝜇 (𝑥) ∗ 𝜇 (𝑦)|(𝑥, 𝑦) or 𝑓 (𝑎, 𝑏) =  
𝑖𝑓 𝑎 > 𝑏

Example: Zadeh’s Max-Min rule


If x is A then y is B with the implication of Zadeh’s max-min rule can be written equivalently as:

𝑅 = (𝐴 𝑥 𝐵) ∪ (𝐴 𝑥 𝑌)
Here, Y is the universe of discourse with membership values for 𝑦 ∈ 𝑌 is 1, that is , 𝜋 (𝑦) =
1∀𝑦 ∈ 𝑌;
Suppose: 𝑋 = {𝑎, 𝑏, 𝑐, 𝑑}𝑎𝑛𝑑 𝑌 = {1,2,3,4}𝑎𝑛𝑑 𝐴 = {(𝑎, 0.0, ), (𝑏, 0.8), (𝑐, 0.6), (𝑑, 1.0)},
𝐵 = {(1,0.2, ), (2,1.0), (3,0.8), (4,0.0)} are two fuzzy sets.

We are to determine 𝑅 = (𝐴 𝑥 𝐵) ∪ (𝐴 𝑥 𝑌)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

The computation 𝑅 = (𝐴 𝑥 𝐵) ∪ (𝐴 𝑥 𝑌) is as follows


1 2 3 4 1 2 3 4
𝑎 0 0 0 0 𝑎 1 1 1 1
𝐴𝑥𝐵 = 𝑏 0.2 0.8 0.8 0 and 𝐴̅𝑥𝑌 = 𝑏 0.2 0.2 0.2 0.2
𝑐 0.2 0.6 0.6 0 𝑐 0.4 0.4 0.4 0.4
𝑑 0.2 0.1 0.8 0 𝑑 0 0 0 0

1 2 3 4
𝑎 1 1 1 1
𝑅 = (𝐴 𝑥 𝐵) ∪ (𝐴 𝑥 𝑌) = 𝑏 0.2 0.8 0.8 0.2
𝑐 0.4 0.6 0.6 0.4
𝑑 0.2 1.0 0.8 0
Example 4:

IF x is A THEN y is B ELSEB ELSE y is C. The relation R is equivalent to 𝑅 = (𝐴 𝑥 𝐵) ∪ (𝐴 𝑥 𝐶)


The membership function of R is given by
𝜋 (𝑥, 𝑦) = max [min{𝜋 (𝑥), 𝜋 (𝑦)} , min{𝜋 ̅ (𝑥), 𝜋 (𝑦)}]
𝑋 = {𝑎, 𝑏, 𝑐, 𝑑}𝑎𝑛𝑑 𝑌 = {1,2,3,4}𝑎𝑛𝑑 𝐴 = {(𝑎, 0.0), (𝑏, 0.8), (𝑐, 0.6), (𝑑, 1.0)},
𝐵 = {(1,0.2), (2,1.0), (3,0.8), (4,0.0)}, 𝐶 = {(1,0.0), (2,0.4), (3,1.0), (4,0.8)}
Determine the implication relation:
If x is A the y is B else y in C
1 2 3 4
𝑎 0 0.4 1.0 0.8
𝑅 = 𝑏 0.2 0.8 0.8 0.2
𝑐 0.2 0.6 0.6 0.4
𝑑 0.2 1.0 0.8 0

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Inferences
Let’s start with propositional logic. We know the following in propositional logic.

 Modus Ponens 𝑃, 𝑃 => 𝑄, <=> 𝑄


 Modus Tollens 𝑃 => 𝑄, ~𝑄, <=>, ~𝑃
 Chain Rule 𝑃 => 𝑄, 𝑄 => 𝑅, <=>, 𝑃 => 𝑅
An example from propositional logic
1. 𝐶∨𝐷
2. ~𝐻 => (𝐴 ∧ ~𝐵)
3. 𝐶 ∨ 𝐷 => ~𝐻
4. (𝐴 ∧ ~𝐵) => (𝑅 ∨ 𝑆)
From the above can we infer 𝑅 ∨ 𝑆?
Similar concept is also followed in fuzzy logic to infer a fuzzy rule from a set of given fuzzy rule
(also called fuzzy rule base).
Inferring procedures in Fuzzy logic
Two important inferring procedures are used in fuzzy systems.

 Generalized Modus Ponens (GMP)


𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐵
𝑥 𝑖𝑠 𝐴′
𝑦 𝑖𝑠 𝐵′
 Generalized Modus Tollens (GMT)
𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑇ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐵
𝑦 𝑖𝑠 𝐵′
𝑥 𝑖𝑠 𝐴
Fuzzy Inferring Procedures

 Here, A, B, A’ and B’ are fuzzy sets.


 To compute the membership function A’and B’the max-min composition of fuzzy sets
B’and A’, respectively with R(x,y) (which is the known implication relation) is used.
 Thus
𝐵′ = 𝐴′ ∘ 𝑅(𝑥, 𝑦) 𝜋 (𝑦) = max [min (𝜋 (𝑥), 𝜋 (𝑥, 𝑦))]
𝐴′ = 𝑅(𝑥, 𝑦) ∘ 𝐵′ 𝜋 (𝑥) = max [min (𝜋 (𝑥, 𝑦), 𝜋 (𝑦))]
Generalized Modus Ponens: Example
𝑃: 𝒊𝒇 𝑥 𝒊𝒔 𝐴 𝒕𝒉𝒆𝒏 𝑦 𝒊𝒔 𝐵

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Let us consider two sets of variables x and y be


𝑋 = {𝑥 , 𝑥 , 𝑥 } 𝑎𝑛𝑑 𝑌 = {𝑦 , 𝑦 }
Also, let us consider the following.
𝐴 = {(𝑥 , 0.5), (𝑥 , 1.0), (𝑥 , 0.6)} 𝑎𝑛𝑑 𝐵 = {(𝑦 , 0.5), (𝑦 , 0.4)}
Suppose, given a fact expressed by the proposition x in A’, where
𝐴’ = {(𝑥 , 0.6), (𝑥 , 0.9), (𝑥 , 0.7)}
We are to derive a conclusion in the form y in B’.
Here, we should use generalized modus ponens (GMP)

We are to find 𝐵 = 𝐴 ∘ 𝑅(𝑥, 𝑦), where 𝑅(𝑥, 𝑦) = max {𝐴 𝑥 𝐵, 𝐴̅ 𝑥 𝑌}


𝑦 𝑦
For 𝐴 𝑥 𝐵, 𝜋 (𝑥, 𝑦) = min[𝜋 (𝑥), 𝜇 (𝑦)] = 𝐴 𝑥 𝐵 = 𝑥 0.5 0.4
𝑥 0.5 0.4
𝑥 0.5 0.4
𝐴̅ = {(𝑥 , 0.5), (𝑥 , 0.0), (𝑥 , 0.4)} 𝑎𝑛𝑑 𝑌 = {(𝑦 , 1.0), (𝑦 , 1.0)}
𝑦 𝑦
And 𝐴̅ 𝑥 𝑌, 𝜋 ̅ (𝑥, 𝑦) = min[𝜋 ̅ (𝑥), 𝜇 (𝑦)] = 𝐴̅ 𝑥 𝑌 = 𝑥 0.5 0.5
𝑥 0.0 0.0
𝑥 0.4 0.4
𝑦 𝑦
𝑅(𝑥, 𝑦) = (𝐴 𝑥 𝐵) ∪ (𝐴̅ 𝑥 𝑌) = 𝑥 0.5 0.5
𝑥 0.5 0.4
𝑥 0.5 0.4
Let, 𝐴’ = {(𝑥 , 0.6), (𝑥 , 0.9), (𝑥 , 0.7)}
𝑦 𝑦
Therefore 𝐵 = 𝐴 ∘ 𝑅(𝑥, 𝑦) = [0.6 0.9 0.7] ∘ 𝑥 0.5 0.5 = [
0.5 0.5]
𝑥 0.5 0.4
𝑥 0.5 0.4
Thus we derive that 𝑦 𝑖𝑛 𝐵 𝑤ℎ𝑒𝑟𝑒 𝐵 = {(𝑦 , 0.5), (𝑦 , 0.5)}

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example: Generalized Modus Tollens


Let, 𝐵’ = {(𝑦 , 0.9), (𝑦 , 0.7)}
𝑦 𝑦
Therefore 𝐴 = 𝑅(𝑥, 𝑦) ∘ 𝐵 = 𝑥 0.5 0.5 ∘ 0.9 = [
𝑥 0.5 0.5 0.5]
0.5 0.4 0.7
𝑥 0.5 0.4
Thus we derive that 𝑥 𝑖𝑛 𝐴 𝑤ℎ𝑒𝑟𝑒 𝐴 = {(𝑥 , 0.5), (𝑥 , 0.5), (𝑥 , 0.5)}
Practical Example:
Apply the fuzzy GMP rule to deduce Rotation is quite slow. Given that.

 If temperature in High then rotation is Slow


 Temperature is Very High
Let,
𝑋 = {30, 40, 50, 60, 70, 80, 90, 100} be the set of temperature
𝑌 = {10, 20, 30, 40, 50, 60} be the set of rotations per minute.
The fuzzy set High(H), Very High(VH), Sloe(S) and quite Slow (QS) are given below.
𝐻 = {(70,1), (80,1), (90,0.3)}
𝑉𝐻 = {(80,0.6), (90,0.9), (100,1)}
𝑆 = {(30,0.8), (40,1), (50,0.6)}
𝑄𝑆 = {(10,1), (20,0.8), (30,0.5)}
 If temperature in High then rotation is Slow
𝑅 = {𝐻 𝑥 𝑆)⋃(𝐻 𝑥 𝑌)
 Temperature is Very High
Thus, to deduce “Rotation is quite Slow”, we make use of the composition rule
𝑄𝑆 = 𝑉𝐻 ∘ 𝑅(𝑥, 𝑦)
30 40 50 30 40 50
𝐻 𝑥 𝑆 = 70 0.8 1.0 0.6 𝑎𝑛𝑑 𝐻 𝑥 𝑌 = 70 0.0 0.0 0.0
80 0.8 1.0 0.6 80 0.0 0.0 0.0
90 0.3 0.3 0.3 90 0.7 0.7 0.7
30 40 50
𝑅 = 70 0.8 1.0 0.6
80 0.8 1.0 0.6
90 0.7 0.7 0.7

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

30 40 50
𝑄𝑆 = 𝑉𝐻 ⋄ 𝑅 = [0.6 0.9 1.0] ⋄ 70 0.8 1.0 0.6
80 0.8 1.0 0.6
90 0.7 0.7 0.7
𝑄𝑆 = [0.8 0.9 0.7]

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

What is defuzzification?

 Defuzzification means the fuzzy to crisp conversion.


Example 1.
Suppose, 𝑇 denotes a fuzzy set representing temperature is High.
𝑇 is given as follows.
𝑇 = {(15,0.1), (20,0.4), (25,0.45), (30,0.55), (35,0.65), (40,0.7), (45,0.85), (50,0.9)}
 What is the crisp value that implies the high temperature?
Example 2. Fuzzy to crisp
As an another example, let us consider a fuzzy set whose membership function is shown in the
following figure.

What is the crisp value of the fuzzy set in this case?


Example 3. Fuzzy to Crisp
Now, consider the following two rules in the fuzzy rule base.

𝑅1. 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐶
𝑅. 𝑖𝑓 𝑥 𝑖𝑠 𝐵 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐷
A pictorial representation of the above rule vase is shown in the following figure.
What is the crisp value that can be inferred from the above rules given an input say x’?

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Why Defuzzification?
The fuzzy results generated can note be used in an application, where decision has to be taken
only in crisp values. For the A/C system we have.
Example. 𝑖𝑓 𝑡𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 𝑖𝑠 𝑇 𝑇ℎ𝑒𝑛 𝑟𝑜𝑡𝑎𝑡𝑖𝑜𝑛 𝑖𝑠 𝑅 .

Here, may be input 𝑇 is fuzzy, but action rotation should be based on the crisp value of 𝑅 .

Generic structure of a fuzzy system

Following figure shows a general framework of a fuzzy system.

Defuzzification Techniques

Defuzzification methods

A number of defuzzification methods are known. Such as

 Lambda-cut method
 Maxima method
 Centroid method
 Weighted average method

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Lambda-cut method

Lambda-cut method is applicable to derive crisp value of a fuzzy set or relation.

 Lambda-cut method for fuzzy relation

The same has been applied to fuzzy set

 Lambda-cut method for fuzzy set

In many literatures, Lambda-cut method is also alternatively termed as Alpha-cut method.

Lambda-cut method for fuzzy set

 In this method a fuzzy set A is transformed into a crisp set 𝐴 for a given value of 𝜆(0 ≤ 𝜆 ≤ 1)
 In other-words, 𝐴 = {𝑥|𝜇 (𝑥) ≥ 𝜆}
 That is, the value of Lambda-cut set 𝐴 is x, when the membership value corresponding to x is
greater than or equal to the specified 𝜆.
 This Lambda-cut set 𝐴 is also called alpha-cut set.

Lambda-cut method for fuzzy set: Example

𝐴 = {(𝑥 , 0.9), (𝑥 , 0.5), (𝑥 , 0.2), (𝑥 , 0.3)}

𝜆 = 0.6
𝐴 . = {(𝑥 , 1), (𝑥 , 0), (𝑥 , 0), (𝑥 , 0)} = {𝑥 }
𝐴 = {(𝑥 , 0.1), (𝑥 , 0.5), (𝑥 , 0.8), (𝑥 , 0.7)}

𝜆 = 0.2
𝐴 . = {(𝑥 , 0), (𝑥 , 1), (𝑥 , 1), (𝑥 , 1)} = {𝑥 , 𝑥 , 𝑥 }
Lambda-cut sets: Example

Two fuzzy sets P and Q are defined on x as follows.

𝜇(𝑥) 𝑥 𝑥 𝑥 𝑥 𝑥
P 0.1 0.2 0.7 0.5 0.4
Q 0.9 0.6 0.3 0.2 0.8

Find the following:

 𝑃 . ,𝑄 .
 (𝑃 ∪ 𝑄) .
 (𝑃 ∪ 𝑃) .
 (𝑃 ∩ 𝑄) .

Lambda-cut for a fuzzy relation

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

The Lambda-cut method for a fuzzy set can also be extended to fuzzy relation also.

Example: For a fuzzy relation R


1 0.2 0.3
𝑅 = 0.5 0.9 0.6
0.4 0.8 0.7
We are to find Lambda-cut relations for the following values of 𝜆 = 0, 0.2, 0.5, 0.9.
1 1 1 1 1 1 1 0 0 1 0 0
𝑅 = 1 1 1 𝑎𝑛𝑑 𝑅 . = 1 1 1 𝑎𝑛𝑑 𝑅 . = 0 1 0 𝑎𝑛𝑑 𝑅 . = 1 1 1
1 1 1 1 1 1 0 0 0 0 1 1
Some properties of Lambda-cut sets

If A and B are two fuzzy sets, defined with the same universe of discourse, then

 (𝐴 ∪ 𝐵) = 𝐴 ∪ 𝐵
 (𝐴 ∩ 𝐵) = 𝐴 ∩ 𝐵
 (𝐴 ) ≠ 𝐴 except for values of 𝜆 = 0.5
 For any 𝜆 ≤ 𝛼, where 𝛼 varies between 0 and 1, it is true that 𝐴 ≤ 𝐴 , where the values of
𝐴 is the universe of discourse.

Some properties of Lambda-cut relations

if R and S are two fuzzy relation, defined with the same fuzzy sets over the same universe of discourses,
then

 (𝑅 ∪ 𝑆) = 𝑅 ∪ 𝑆
 (𝑅 ∩ 𝑆) = 𝑅 ∩ 𝑆
 (𝑅 ) ≠ 𝑅
 For any 𝜆 ≤ 𝛼, where 𝛼 varies between 0 and 1, it is true that 𝑅 ≤𝑅

Summary: Lambda-cut methods

Lambda-cut method converts a fuzzy set (or a fuzzy relation) into crisp set (or relation).

Output of a fuzzy system

The output of a fuzzy system can ve a single fuzzy set or union of two or more fuzzy sets. To understand
the second concept, let us consider a fuzzy system with n-rules.

𝑅 : 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐵
𝑅 : 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐵
… … … … … … … … … … … ….
…………………………………
𝑅 : 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐵

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

In this case, the output y for a given input 𝑥 = 𝑥 is possible

𝐵 = 𝐵 ∪ 𝐵 ∪ ………𝐵
Output fuzzy set: Illustration

Suppose, two rules 𝑅 𝑎𝑛𝑑 𝑅 are given as follows:

𝑅 : 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐶
𝑅 : 𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑡ℎ𝑒𝑛 𝑦 𝑖𝑠 𝐶
Here the output fuzzy set 𝐶 = 𝐶 ∪ 𝐶 . For instance, let us consider the following:

The fuzzy output for 𝑥 = 𝑥 is shown below.

The fuzzy output for 𝑥 = 𝑥 is shown below.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

The fuzzy output for 𝑥 = 𝑥 is shown below.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Defuzzification Methods
Following defuzzification methods are known to calculate crisp output in the situations as
discussed in the last lecture.

 Maxima Methods
o Height method
o First of maxima (FoM)
o Last of maxima (LoM)
o Mean of maxima (MoM)
 Centroid Methods
o Centre of gravity method (CoG)
o Centre of sum method (CoS)
o Centre of area method (CoA)
 Weighted average method
Maxima Methods

 Height method
 First of maxima (FoM)
 Last of maxima (LoM)
 Mean of maxima (MoM)
Maxima method : Height Method
This method is based on Max-membership principle, and defined as follows.
𝜇 (𝑥 ∗ ) ≥ 𝜇 (𝑥) for all 𝑥 𝜖 𝑋.

Note:

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Here x* is the height of the output fuzzy set C.


 This method is applicable when height is unique.
Maxima method : FoM
FoM: First of Maxima is 𝑥 ∗ = min {𝑥|𝐶(𝑥) = max 𝐶(𝑤)}

Maxima method : LoM


LoM: Last of Maxima is 𝑥 ∗ = max {𝑥|𝐶(𝑥) = max 𝐶(𝑤)}

Maxima Method : MoM

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

∑ (𝑥 )
𝑥∗ = ∈
|𝑀|
Where, 𝑀 = {𝑥 |𝜇(𝑥 ) = ℎ(𝐶)} and h(C) is the height of the fuzzy set C.
MoM : Example 1
Suppose, a fuzzy set Young is defined as follows:
𝑌𝑜𝑢𝑛𝑔 = {(15,0.5), (20,0.8), (25,0.8), (30,0.5), (35,0.3)}
Then the crisp value of Young using MoM method is
20 + 25
𝑥∗ = = 22.5
2
Thus, a person of 22.5 years old is treated as young!
MoM: Example 2
What is the crisp value of the fuzzy set using MoM in the following case?

𝑎+𝑏
𝑥∗ =
2
Note:

 Thus, MoM is also synonymous to middle of maxima.


 MoM is also a general method of Height.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Centroid Methods

 Centre of gravity method (CoG)


 Centre of sum method (CoS)
 Centre of area method (CoA)
Centroid Method : CoG

 The basic principle in CoG method is to find the point x where a vertical line would slice
the aggregate into two equal masses.
 Mathematically, the CoG can be expressed as follows:
∫ 𝑥. 𝜇 (𝑥)𝑑(𝑥)
𝑥∗ =
∫ 𝜇 (𝑥)𝑑(𝑥)
 The lower part shows the area of the region.
 Graphically

Note:

 𝑥 ∗ is the x-coordinate of centre of gravity.


 ∫ 𝜇 (𝑥)𝑑(𝑥) denotes the area of the region bounded by the curve 𝜇 .
 If 𝜇 is defined with a discrete membership function, then CoG can be stated as:
∑ . ( )
𝑥∗ = ∑ ( )
for i = 1 to n.
 Here 𝑥 is a sample element and n represents the number of samples in fuzzy set C.
CoG : A geometrical method of calculation
Steps:

 Divide the entire region into a number of small regular regions (e.g. triangles, trapezoid,
etc.)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Let 𝐴 𝑎𝑛𝑑 𝑥 denotes the area and 𝑐. 𝑔. of the 𝑖 portion.


∑𝒏
𝒊 𝟏 𝒙𝒊 (𝑨𝒊 )
 Then 𝑥 ∗ according to CoG is 𝑥 ∗ = ∑𝒏
where n is the number of smaller
𝒊 𝟏(𝑨𝒊 )
geometrical components.
CoG : An example of integral method of calculation

0.3𝑥 0≤𝑥<2

⎪ 0.7 2 ≤ 𝑥 < 2.7
𝜇 (𝑥) = 𝑥 − 2 2.7 ≤ 𝑥 < 3 
⎨ 1 3≤𝑥<4

⎩ (−0.5𝑥 + 3) 4≤𝑥≤6

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

.
For 𝐴 : 𝑦 − 0 = (𝑥 − 0), 𝑜𝑟 𝑦 = 0.35𝑥

For 𝐴 : 𝑦 = 0.7

For 𝐴 : 𝑦 − 0 = (𝑥 − 2), 𝑜𝑟 𝑦 = 𝑥 − 2

For 𝐴 : 𝑦 = 1

For 𝐴 : 𝑦 − 1 = (𝑥 − 4), 𝑜𝑟 𝑦 = −0.5𝑥 + 3

∫ . ( ) ( )
Thus, 𝑥 ∗ = ( ) ( )
=

.
𝑁= 0.35𝑥 𝑑𝑥 + 0.7𝑥 𝑑𝑥 + (𝑥 − 2𝑥)𝑑𝑥 + 𝑥𝑑𝑥 + (−0.5𝑥 + 3𝑥)𝑑𝑥
.

= 10.98
.
𝐷= 0.35𝑥𝑑𝑥 + 0.7𝑥𝑑𝑥 + (𝑥 − 2)𝑑𝑥 + 𝑑𝑥 + (−0.5𝑥 + 3)𝑑𝑥
.

= 3.445
10.98
𝑥∗ = = 3.187
3.445
Centroid Method : CoS
If the output fuzzy set = 𝐶 ∪ 𝐶 ∪ … … … 𝐶 , then the crisp value according to CoS is defined
as
∑ 𝑥𝐴
𝑥∗ =
∑ 𝐴

Here, 𝐴 denotes the area of the region bounded by the fuzzy set 𝐶 𝑎𝑛𝑑 𝑥 is the geometric
centre of the area 𝐴 . Graphically,

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Note:

 In the CoG method, the overlapping area is counted once, whereas, in CoS, the
overlapping is counted twice or so.
 In CoS, we use the centre of area and hence, its name instead of centre of gravity as in
CoG.
CoS : Example
Consider the three output fuzzy sets as shown in the following plots:

In this case, we have


1
𝐴 = x 0.3 x (3 + 5), 𝑥 = 2.5
2
1
𝐴 = x 0.5 x (4 + 2), 𝑥 = 5
2
1
𝐴 = x 1.0 x (3 + 1), 𝑥 = 6.5
2
. ( ) . . ( ) . ( ) .
Thus, 𝑥 ∗ =
. ( ) . ( ) . ( )

Note:
The crisp value of 𝐶 = 𝐶 ∪ 𝐶 ∪ 𝐶 using CoG method can be found to be calculated as
𝑥 ∗ = 4.9
Centroid method : Centre of largest area
If the fuzzy set has two sub regions, then the centre of gravity of the sub region with the largest
area can be used to calculate the defuzzified value.
∫ . ( ) ( )
Mathematically, 𝑥 ∗ = ( ) ( )

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Here, 𝐶 is the region with largest area, x’is the centre of gravity 𝐶 .
Graphically,

Weighted average method

 The method is also alternatively called “Sugeno defuzzification” method.


 The method can be used only for symmetrical output membership functions.
 The crisp value according to this is
∑ ( )
𝑥∗ = ∑
where, 𝐶 , 𝐶 , … … … 𝐶 are the output fuzzy sets and (𝑥 ) is the value
( )
where middle of the fuzzy set 𝐶 is observed.
 Graphically,

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Exercise 1 :
Find the crisp value of the following using all defuzzified methods.

Exercise 2:
Find the crisp value of the following using all defuzzified methods.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Exercise 3 :

 The membership function defining a student as Average, Good, and Excellent denoted
by respective membership functions are as shown below.

 Find the crisp value of “Good Student”


Hint:
Use CoG method to the portion GOOD to calculate it.
Exercise 4 :

 The width of a road as narrow and wide is defined by two fuzzy sets, whose membership
functions are plotted as shown above.
 If a road with its degree of membership value is 0.4 then what will be its width (in crisp)
measure.
Hint:
Use COG method for the shaded region.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Exercise 5 :

 The faulty measure of a circuit is defined fuzzily by three fuzzy sets namely Robust(R),
Fault tolerant (FT) and Faulty (F), defined by three membership functions with number
of faults occur as universe of discourses and is shown below.

 Reliability is measured as 𝑅 ∗ = 𝐹 ∪ 𝐹𝑇 ∪ 𝑅 with a certain observation in testing


(𝑥, 0.3) ∈ 𝑅, (𝑥, 0.5) ∈ 𝐹𝑇, (𝑥, 0.8) ∈ 𝐹.
 Calculate the reliability measure in crisp value.
 Calculate with
o CoS
o CoG.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Logic Controller

 Applications of Fuzzy Logic


 Fuzzy Logic Controller
 Modules of Fuzzy Logic Controller
 Approaches of Fuzzy Logic Controller Desing
o Mamdani Approach
o Takagi and Sugeno’s Approach
Fuzzy Systems: Fuzzy Logic Controller

 Concept of fuzzy theory can be applied in many applications, such as fuzzy reasoning,
fuzzy clustering, fuzzy programming, etc.
 Out of all these applications, fuzzy reasoning, also called fuzzy logic controller (FLC) is
an important application.
 Fuzzy logic controllers are special expert systems. In general a FLC employs a knowledge
base expressed in terms of a fuzzy inference rules and a fuzzy inference engine to solve
a problem.
 We use FLC where an exact mathematical formulation of the problem is not possible or
very difficult.
 These difficulties are due to non-linearities, time-varying nature of the process, large
unpredictable environment disturbances, etc.

Figure 1: A general scheme of fuzzy controller


A general fuzzy controller consists of four modules:

 A fuzzy rule base,


 A fuzzy inference engine,

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 A fuzzification module, and


 A defuzzification module.
As shown in figure 1, a fuzzy controller operates by repeating a cycle of following four steps:

 Step 1: Measurements (inputs) are taken of all variables that represent relevant
condition of controller process.
 Step 2: These measurements are converted into appropriate fuzzy sets to express
measurements uncertainties. This step is called fuzzification.
 Step 3: The fuzzified measurements are then used by the inference engine to evaluate
the control rules stored in the fuzzy rule base. The result of this evaluation is a fuzzy set
(or several fuzzy sets) defined on the universe of possible actions.
 Step 4: This output fuzzy is then converted into a single (crisp) value (or a vector of
values). This is the final step called defuzzification. The defuzzidied values represent
actions to be taken by the fuzzy controller.
There are mainly two approaches of FLC.

 Mamdani Approach
 Takagi and Sugeno’s Approach
o Mamdani approach follows linguistic fuzzy modeling and characterized by its
high interpretability and low accuracy.
o On the other hand, Takagi and Sugeno’s approach follows precise fuzzy
modeling (numerical) and obtains high accuracy but at the cost of low
interpretability.
We illustrate the above two approached with examples.
Mamdani Approach: Mobile Robot

 Consider the control of navigation of a mobile robot in the presence of a number of


moving objects.
 To make the problem simple, consider only four moving objects, each of equal size and
moving with the same speed.
 A typical scenario is shown in figure 2.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Figure 2: Mobile Robot

 We consider two parameters: D, the distance from the robot to an object and 𝜽 the
angle of motion of an object with respect to the robot.
 The value of these parameters with respect to the most critical object will decide an
output called deviation (𝜹).
 We assume the range of values of D is [0.1, … ,2.2] in meter and 𝜃 is [−90, … ,0, … ,90] in
degree.
 After identifying the relevant input and output variables of the controller and their
range of values, the Mamdani approach is to select some meaningful states called
linguistic states for each variable and express them by appropriate fuzzy sets.
Linguistic States
For the current example, we consider the following linguistic states for the three parameters.
Distance is represented using four linguistic states:

 VN: Very Near


 NR: Near
 VF: Very Far
 FR: Far

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Angle (for both angular direction (𝜃) and deviation (𝛿) are represented using five linguistic
states:

 LT: Left
 AL: Ahead Left
 AA: Ahead
 AR: Ahead Right
 RT: Right
Three different fuzzy sets for the three different parameters are given below:

Fuzzy Rule Base

 Once the fuzzy sets of all parameters are worked out, our next step in FLC design is to
decide fuzzy rule base of the FLC.
 The rule base for the FLC of mobile robot is shown in the form of a table below.
𝑳𝑻 𝑨𝑳 𝑨𝑨 𝑨𝑹 𝑹𝑻
𝑽𝑵 𝐴𝐴 𝐴𝑅 𝐴𝐿 𝐴𝐿 𝐴𝐴
𝑵𝑹 𝐴𝐴 𝐴𝐴 𝑅𝑇 𝐴𝐴 𝐴𝐴
𝑭𝑹 𝐴𝐴 𝐴𝐴 𝐴𝑅 𝐴𝐴 𝐴𝐴
𝑽𝑭 𝐴𝐴 𝐴𝐴 𝐴𝐴 𝐴𝐴 𝐴𝐴

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Rule base for the mobile robot


Note that this rule base defines 20 rules for all possible instances. These rules are simple rules
and take in the following forms.

 Rule 1: If (distance is VN) and (angle is LT) Then (deviation is AA)


.
.
 Rule 13: If (distance is FR) and (angle is AA) Then (deviation is AR)
.
.
 Rule 20: If (distance is VF) and (angle is RT) Then (deviation is AA)

Fuzzification of Inputs

 The next step is the fuzzification of inputs. Let us consider, at any instant, the object O 3
is critical to the Mobile Robot and distance D=1.04 m and angle 𝜃=30.
 For this input, we are to decide the deviation 𝛿 of the robot as output.
 From the given fuzzy sets and input parameters values, we say that the distance
D=1.04m may be called as either NR (near) or FR (far).
 Similarly, the input angle 𝜃=30. can be declared as either AA (ahead) or AR (ahead right).
 Input
o D=1.04m
o 𝜃=30.
Hence, we are to determine the membership values corresponding to these values which is as
follows.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Rule Strength Computation


There are many rules in the rule base and all rules may not be applicable.
For the given x=1.04 and 𝜃=30. , only following four rules out of 20 rules are fireable.

 R1: if (distance is NR) and (angle is AA) Then (deviation is RT)


 R2: if (distance is NR) and (angle is AR) Then (deviation is AA)
 R3: if (distance is FR) and (angle is AA) Then (deviation is AR)
 R4: if (distance is FR) and (angle is AR) Then (deviation is AA)
The strength (also called 𝛼 values) of the fireable rules are calculated as follows.

 𝛼(𝑅1) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.6571,0.3333) = 0.3333


 𝛼(𝑅2) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.6571,0.6667) = 0.6571
 𝛼(𝑅3) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.3429,0.3333) = 0.3333
 𝛼(𝑅4) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.3429,0.6667) = 0.3429

In practice, all rules which are above certain threshold value of the rule strength are selected
for the output computation.
Let the threshold of 𝛼 be 0.3400. then the selected rules are

 𝛼(𝑅1) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.6571,0.3333) = 0.3333


 𝛼(𝑅2) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.6571,0.6667) = 0.6571
 𝛼(𝑅3) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.3429,0.3333) = 0.3333
 𝛼(𝑅4) = min 𝜇 (𝑥), 𝜇 (𝑦) = min(0.3429,0.6667) = 0.3429

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Fuzzy Output
The next step is to determine the fuzzified outputs corresponding to each fired rules. The
working principle of doing this is first discussed and then we illustrate with the running
example.
Suppose, only two fuzzy rules, R1 and R2, for which we are to decide fuzzy output

 𝑅1: 𝐼𝐹(𝑠 𝑖𝑠 𝐴 ) 𝐴𝑁𝐷 (𝑠 𝑖𝑠 𝐵 )𝑇𝐻𝐸𝑁 (𝑓 𝑖𝑠 𝐶 )


 𝑅2: 𝐼𝐹(𝑠 𝑖𝑠 𝐴 ) 𝐴𝑁𝐷 (𝑠 𝑖𝑠 𝐵 )𝑇𝐻𝐸𝑁 (𝑓 𝑖𝑠 𝐶 )
Suppose, 𝑠 ∗ and 𝑠 ∗ are the inputs for fuzzy variables 𝑠 and 𝑠 . 𝜇 , 𝜇 , 𝜇 , 𝜇 , 𝜇 𝑎𝑛𝑑 𝜇
are the membership values for different fuzzy sets. (output is 𝐶 ∪ 𝐶 )
The fuzzy output computation is graphically shows as below.

Note:

 We take min of membership function values for each rule.


 Output membership function is obtained by aggregating the membership function of
result of each rule.
 Fuzzy output is nothing but fuzzy OR of all output of rules.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Illustration: Mobile Robot


For four rules, we find the following results.

Aggregation of all results

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Defuzzification
The fuzzy output needs to be defuzzufued and its crisp value has to be determined for the
output to take decision.

Conclusion:
Therefore, the robot should deviate by 19.58089 degree towards the right with respect to the
line joining to the move of direction to avoid collision with the obstacle O 3.

Takagi and Sugeno’s Approach

 In this approach, a rule is composed of fuzzy antecedent and functional consequent


parts.
 This, any i-th rule, in this approach is represented by
𝑖𝑓 𝑥 𝑖𝑠 𝐴 𝑎𝑛𝑑 𝑥 𝑖𝑠 𝐴 … … 𝑎𝑛𝑑 (𝑥 𝑖𝑠 𝐴 )
 Then, 𝑦 = 𝑎 + 𝑎 𝑥 + 𝑎 𝑥 + ⋯ + 𝑎 𝑥 where 𝑎 , 𝑎 , 𝑎 , … , 𝑎 are the co-
efficients.
 The weight of i-th rule can be determined for a set of inputs 𝑥 , 𝑥 , 𝑥 , … , 𝑥 as follows.
 𝑤 = 𝜇 (𝑥 )𝑋𝜇 (𝑥 )𝑋 … 𝑋𝜇 (𝑥 ), where 𝐴 , 𝐴 , … , 𝐴 indicates membership
function distributions of the linguistic hedges used to represent the input variables and
𝜇 denotes membership function value.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 𝑦 = 𝑎 + 𝑎 𝑥 + 𝑎 𝑥 + ⋯+ 𝑎 𝑥 and 𝑤 = 𝜇 (𝑥 )𝑋𝜇 (𝑥 )𝑋 … 𝑋𝜇 (𝑥 ), the



combined action then can be obtained as 𝑦 = ∑
, where k denotes the total number
of rules.
Illustration:
Consider two inputs I1 and I2. These two inputs have the following linguistic states:

 𝐼 : 𝐿(𝑙𝑜𝑤), 𝑀(𝑀𝑒𝑑𝑖𝑢𝑚), 𝐻(𝐻𝑖𝑔ℎ)


 𝐼 : 𝑁𝑅(𝑛𝑒𝑎𝑟), 𝐹𝑅(𝐹𝑎𝑟), 𝑉𝐻(𝑉𝑒𝑟𝑦 𝐹𝑎𝑟)
Note:
The rule base of such a system is decided by a maximum of 3 x 3 = 9 feasible rules.
Given the distribution function for I1 and I2 as below.

The output of any i-th rules can be expressed by the following.

𝑦 = 𝑓(𝐼 , 𝐼 ) = 𝑎 𝐼 + 𝑏 𝐼 ; where j,k=1,2,3.

Suppose:

𝑎 = 1, 𝑎 = 2, 𝑎 = 3 𝑖𝑓 𝐼 = 𝐿, 𝑀 𝑎𝑛𝑑 𝐻, 𝑟𝑒𝑠𝑝𝑒𝑐𝑡𝑖𝑣𝑒𝑙𝑦

𝑏 = 1, 𝑏 = 2, 𝑏 = 3 𝑖𝑓 𝐼 = 𝑁𝑅, 𝐹𝑅 𝑎𝑛𝑑 𝑉𝐹, 𝑟𝑒𝑠𝑝𝑒𝑐𝑡𝑖𝑣𝑒𝑙𝑦


We have to calculate the output of FLC for I1=6.0 and I2=2.2.
Solution:

 The input I1 =6.0 can be called either L and M. Similarly, the input I2 =2.2 can be declared
either FR or VF.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 Using the principal of similarity of triangle, we have the following.


o 𝜇 (𝐼 ) = 0.8
o 𝜇 (𝐼 ) = 0.2
o 𝜇 (𝐼 ) = 0.8
o 𝜇 (𝐼 ) = 0.2
 For the input set, following four rules can be fired out of all 9 rules.
o R1: 𝐼 𝑖𝑠 𝐿 𝑎𝑛𝑑 𝐼 𝑖𝑠 𝐹𝑅
o R2: 𝐼 𝑖𝑠 𝐿 𝑎𝑛𝑑 𝐼 𝑖𝑠 𝑉𝐹
o R3: 𝐼 𝑖𝑠 𝑀 𝑎𝑛𝑑 𝐼 𝑖𝑠 𝐹𝑅
o R4: 𝐼 𝑖𝑠 𝑀 𝑎𝑛𝑑 𝐼 𝑖𝑠 𝑉𝐹
 Now, the weights for each of the above rules can be determined as follows.
o R1: 𝑤 = 𝜇 x 𝜇 = 0.8 X 0.8 = 0.6
o R2: 𝑤 = 𝜇 x 𝜇 = 0.8 X 0.2 = 0.16
o R3: 𝑤 = 𝜇 x 𝜇 = 0.2 X 0.8 = 0.16
o R4: 𝑤 = 𝜇 x 𝜇 = 0.2 X 0.2 = 0.04
 The functional consequent values for each rules can be calculated as below.
o 𝑦 = 𝐼 + 2𝐼 = 6.0 + 2 x 2.2 = 10.4
o 𝑦 = 𝐼 + 3𝐼 = 6.0 + 3 x 2.2 = 12.6
o 𝑦 = 2𝐼 + 2𝐼 = 2 x 6.0 + 2 x 2.2 = 16.4
o 𝑦 = 2𝐼 + 3𝐼 = 2 x 6.0 + 3 x 2.2 = 18.6
 Therefore, the output y of the controller can be determined as follow.
o 𝑦=
o 𝒚 = 𝟏𝟐. 𝟎𝟒

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Genetic Algorithm
Basically used to solve optimization problem.

It is used to find the global maxima and global minima for a given f(x). GA is used for these kind
of optimization problem. A function is called as the optimization problem and
this function is either to be maximized or minimized. This objective function is subjected to a
number of constraint . This is no more a trivial problem and this cannot be solved
in a normal time and so it requires some pragmatic approach like soft computing techniques. So
this problem is no more a simple problem. Traditionally a numbers of method are there with
the following limitation.

 Computationally expensive.
 For a discontinuous objective function, method may fail.
 Method may not be suitable for parallel computing.
 Discrete (integer) variable are difficult to handle.
 Methods may not necessarily adaptive.
Evolutionary algorithms have been evolved to address the above mentioned limitations of
solving optimization problems with traditional approaches.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

EVOLUTIONARY ALGORITHMS
The algorithms, which follows some biological and physical behaviors:
Biological behaviors:

 Genetics and Evolution -> Genetic Algorithm (GA)


 Behavior of ant colony -> Ant Colony Optimization (ACO)
 Human nervous system -> Artificial Neural Networks (ANN)
In addition to that there are some algorithms inspired by some physical behaviors:
Physical behaviors:

 Annealing process -> Simulated Annealing (SA)


 Swarming of particle -> Particle Swarming Optimization (PSO)
 Learning -> Fuzzy Logic (FL)
GENETIC ALGORITHM
It is a subset of evolutionary algorithm:

 Ant colony optimization


 Swarm particle optimization
Models biological process:

 Genetics
 Evolution
To optimize highly complex objective functions:

 Very difficult to model mathematically


 NP-Hard (also called combinatorial optimization) problem (which are computationally
very expensive)
 Involves large number of parameters (discrete and/or continuous)
BACKGROUND OF GENETIC ALGORITHMS
First time introduced by Prof. John Holland (of Michigan University, USA, 1965). But, the first
article on GA was published in 1975.
Principles of GA based on two fundamental biological processes:

 Genetics: Gregor Johan Mendel (1865)


 Evolution: Charles Darwin (1875)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

A BRIEF ACCOUNT OF GENETICS


The basic building blocks in living bodies are cells. Each cell carries the basic unit of heredity,
called gene
For a particular specie, number of chromosomes is fixed.
Examples:

 Mosquito: 6
 Frogs: 26
 Human: 46
 Goldfish: 94
Genetic Code

 Spiral helix of protein substance is called DNA.


 For a species, DNA code is unique, that is, vary uniquely from one to other.
 DNA code (inherits some characteristics from one generation to next generation) is used
as biometric trait.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Reproduction

Haploid (reproductive cell has half the number of chromosomes)


Diploid (each chromosome from both haploids are combined to have full number)
Crossing Over

Evolution: Natural Selection


Four primary premises

 Information propagation: An offspring has many of its characteristics of its parents (i.e.
information passes from parents to its offspring) [Heredity]
 Population diversity: Variation in characteristics in the next generation. [Diversity]
 Survival for existence: Only a small percentage of the offspring produced survive to
adulthood. [Selection]
 Survival of the best: Offspring survived depends on their inherited characteristics.
[Ranking]
Mutation:
To make the process forcefully dynamic when variations in population going to stable.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

BIOLOGICAL PROCESS: A QUICK OVERVIEW

Working of Genetic Algorithm


Definition of GA: Genetic algorithm is a population based probabilistic search and optimization
techniques, which works based on the mechanism of natural genetics and natural evolution.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

FRAMEWORK OF GA

Note:

 GA is an iterative process.
 It is a searching technique.
 Working cycle with / without convergence.
 Solution is not necessarily guaranteed. Usually, terminated with a local optima.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

FRAMEWORK OF GA: A DETAILED VIEW

OPTIMIZATION PROBLEM SOLVING WITH GA


For the optimization problem. Identify the following:

 Objective function(s)
 Constraint(s)
 Input parameters
 Fitness evaluation (it may be algorithm or mathematical formula)
 Encoding
 Decoding

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

GA OPERATORS
In fact, a GA implantation involved with the realization of the following operations.

 Encoding: How to represent a solution to fit with GA framework.


 Convergence: How to decide the termination criterion.
 Mating pool: How to generate next solutions.
 Fitness Evaluation: How to evaluate a solution.
 Crossover: How to make the diverse set of next solutions.
 Mutation: To explore other solution(s).
 Inversion: To move from one optima to other.
DIFFERENT GA STRATEGIES

 Simple Genetic Algorithm (SGA)


 Steady State Genetic Algorithm (SSGA)
 Messy Genetic Algorithm (MGA)
Simple GA

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

IMPORTANT PARAMETERS INVOLVED IN SIMPLE GA


SGA Parameters

 Initial population size : N


 Size of mating pool,
 Convergence threshold
 Mutation
 Inversion
 Crossover
Salient features in SGA

 Have overlapping generation (only fraction of individuals are replaces)


 Computationally expensive
 Good when initial population size is large.
 In general, give better results.
 Selection is biased towards more highly fit individuals; Hence, the average fitness (of
overall population) is expected to increased in succession
 The best individual may appear in any iteration.
STEADY STATE GENETIC AGORITHM (SSGA)

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

SSGA Features

 Generation gap is small: only two offspring are produced in on generation.


 It is applicable when
o Population size is small
o Chromosomes are of longer length
o Evaluation operation is less computationally expensive (compare to duplicate
checking)
Limitation of SSGA:

 There is chance of stuck at local optima, if crossover/mutation/inversion is not strong


enough to diversify the population
 Premature convergence may result.
 It is susceptible to stagnation. Inferiors are neglected or removed and keeps making
more trails for very long period of time without any gain (i.e. long period of localized
search)
DIFFERENT ENCODING SCHEMES

 Binary encoding
 Real value encoding
 Order encoding
 Tree encoding
Often, GAs are specified according to the encoding scheme it follows. For example

 Binary encoding -> Binary Coded GA or simply Binary GA


 Real value encoding -> Real Coded GA or simply Real GA
 Order encoding -> Order GA or Permuted GA
 Tree encoding
Encoding Schemes in GA
Genetic Algorithm uses metaphor consisting of two distinct elements:

 Individual
 Population
An individual is a single solution while a population is a set of individuals at an instant of
searching process.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

INDIVIDUAL REPRESENTATION: PHENOTYPE AND GENOTYPE

 An individual is defined by a chromosome. A chromosome stores genetic information


(called phenotype) for an individual.
 Here, a chromosome is expressed in terms of factors defining a problem.

Note:

 A gene is the GA’s representation of a single factor (i.e. a design parameter), which has a
domain of values (continuous, discontinuous, discrete etc.) symbol, numbering, etc.
 In GA, there is a mapping from genotype to phenotype. This eventually decides the
performance (namely speed and accuracy) of the problem solving.
There are many ways of encoding:

 Binary encoding: Representing a gene in terms of bits (0’s and 1’s).


 Real value encoding: Representing a gene in terms of values or symbols or string.
 Order encoding: Representing a sequence of elements.
 Tree encoding: Representing in the form of a tree of objects.
Binary Encoding
In this encoding scheme, a gene or chromosome is represented by a string (fixed or variable
length) of binary bits (0’s and 1’s).

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

EXAMPLE: 0-1 KNAPSACK PROBLEM

 There are n items, each item has its own cost and weight .
 There is a knapsack of total capacity w.
 The problem is to take as many items as possible but not exceeding the capacity of the
knapsack.
This is an optimization problem and can be better described as follows.

Consider the following, an instance of the 0-1 Knapsack problem.

Brute force approach to solve the above can be stated as follows:

 Select at least one item


o [10], [20], [30], [10, 20], [10 30], [20, 30], [10, 20, 30]
 So, for n-items, there are trails.
 0 – means item not included and 1 – means item included
o [100], [010], [001], [110], [101], [011], [111]
The encoding for the 0 – 1 Knapsack problem, in general, for n items set would look as follows.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

FEW MORE EXAMPLES:


Example 1:

Minimize: where and x is any discrete integer value.

Example 2:

Maximize subjected to: and

REAL VALUE ENCODING

 The real-coded GA is most suitable for optimization in a continuous search space.


 Uses the direct representations of the design parameters.
 Thus, avoids any intermediate encoding and decoding steps.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

REAL VALUE ENCODING WITH BINARY CODES


Methodology: Step 1 [Deciding the precision]
For any continuous design variable x such the and if is the precision required,
then string length n should be equal to ,

Equivalently,

In general . It is also called, Obtainable accuracy.


Note:
If , then 4.05 or 4.40 4 and 4.50 or 4.99 4.5 and so on.
Real value encoding: Illustration 1

 Example 1: , n = 6. What is the accuracy?

 Example 2: What is the obtainable accuracy, for the binary representation for a variable
X in the range ?
 Example 3: In the above case, what is the binary representation of X = 34.35?
Methodology: Step 2 [Obtaining the binary representation]
Once, we know the length of binary string for an obtainable accuracy (i.e. precision), then we
can have the following mapping relation from a real value X to its binary equivalent decoded
value XB, which is given by

where XB = Decoded value of a binary string,


n is the number of bits in the representation,
XL =000000 … … … 0 and XU=111111 … … … 1
Are the decoded values of the binary representation of the lower and upper values of X.
Example:
Suppose, and are the two extreme decoded values of a variable x.
n = 4 is the number of binary bits in the representation of x.
is a decoded value for a given x.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

What is the value of x = ? and its binary representation?

Here, , Binary representation of x = 1100.

Order Encoding
Let us have a look into the following instance of the Travelling Salesman Problem (TSP).

TSP:

 Visit all the cities


 One city once only
 Starting and ending city is the same.
How we can formally define the TSP?
Understanding the TSP:
There is a cost of visiting a city from another city and hence the total cost of visiting all the cities
but exactly once (except the starting city).
Objective function:
To find a tour (i.e. a simple cycle covering all the cities) with a minimum cost involved.
Constraints:

 All cities must be visited.


 There will be only one occurrence of each city (except the starting city).

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Design parameters:

 Euclidean distance may be taken as the measurement of the cost, otherwise, if it is


specified explicitly.
 The above stated information are the design variables in this case.
We are to search for the best path out of n! possible paths.
A small instance of the TSP

Minimizing

Subject to
where
Here, P is an ordered collection of cities and such that

Note: P represents a possible tour with the starting cities as and


set of n number of cities,
is the distance between any two cities

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

TREE ENCODING
In this encoding scheme, a solution is encoded in the form of a binary tree.

Floor Planning: An example of tree encoding


Floor planning is a standard problem in VLSI design. Here, given n circuits of different area
requirements, we are to arrange them into a floor of chip layout, so that all circuits are placed
in a minimum layout possible.

Formulation of floor planning problem


A possible formulation of Floor planning problem of VLSI circuit is as follows.

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Given:

 A set of n rectangular blocks


 For each , we have the following specification:
o The width and height (which are constant for rigid blocks and variable for
flexible blocks)
o , the desirable aspect ratio about where where if the block
is rigid.
o the area of each block
 A set of nets describing the connectivity information.

 Desirable floor plan aspect ratio , where H and W are the height
and width of the floor plan, respectively.

 Timing information
A legal floor plan is a floor plan that satisfies the following constraints.
Constraints:

 Each block is assigned to a location say .


 No two blocks overlap
 For each flexible block say and should meet aspect ratio constraint.
Objectives:
We are to find a floor plan, which would

 Minimize floor plan area.


 Minimize wire length.
 Minimize circuit delay.
Tree encoding for floor planning problem

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

 How many floor plans are possible?


 Can we find a binary tree representation of a floor plan?
Binary tree representation for floor planning
A floor plan can be modeled by a binary tree with n leaves and n-1 modes where

 Each node represents a vertical cut-line or horizontal cut-line, and letter V and H refer to
vertical and horizontal cut-operators.
 Each leaf node represents a rectangle blocks.
Example: Floor Plan I

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Note:

 The operators H and V expressed in polish notation carry the following meanings.

 A tree can be represented in a compact form using Polish notation


 Polish Notation

Example: Floor Plan I (with Polish Notation)

Example: H and V Operators

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

Example: Floor Plan II

Problem
How many number of solutions possible with n blocks in a floor planning problem?

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.
SOFT COMPUTING
LECTURE NOTES

VEER SURENDRA SAI UNIVERSITY OF TECHNOLOGY, BURLA


By: Dr. Kishore Kumar Sahu, Asst. Professor, Dept. of IT.

You might also like