0% found this document useful (0 votes)
4 views55 pages

Module 6 - Fuzzy Logic and Inference

Chapter 7 introduces fuzzy sets and their relationship with crisp sets, defining crisp sets as having well-defined boundaries and fuzzy sets as having imprecise boundaries. It discusses various set operations, notations, and properties of crisp sets before explaining the concept of fuzzy sets, which allow for degrees of membership. The chapter highlights the limitations of classical set theory in handling uncertainties and presents fuzzy sets as a more general approach to modeling real-world problems.

Uploaded by

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

Module 6 - Fuzzy Logic and Inference

Chapter 7 introduces fuzzy sets and their relationship with crisp sets, defining crisp sets as having well-defined boundaries and fuzzy sets as having imprecise boundaries. It discusses various set operations, notations, and properties of crisp sets before explaining the concept of fuzzy sets, which allow for degrees of membership. The chapter highlights the limitations of classical set theory in handling uncertainties and presents fuzzy sets as a more general approach to modeling real-world problems.

Uploaded by

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

Chapter 7

Introduction to Fuzzy Sets

The aim of this chapter is to introduce the concept of fuzzy set and find its relationship
with crisp set (also known as classical set).

7.1 Crisp Sets


To define the term: crisp set, let us first concentrate on the concept of Universal set
(also called the universe of discourse). A Universal set (represented by X) is a set
consisting of all possible elements (also known as members) related to a particular context.
For example, if our aim is to investigate on the technical universities, then all the technical
universities in the world may be assumed to form a Universal set. It is important to mention
that a number of sets can be derived from the Universal set. Let us try to find the set of
technical universities with only three departments each. To obtain the above set, we check
with each university whether it belongs to that set. Thus, there is a fixed and well-defined
boundary between the elements of that set and those lying outside it. The above set with
a fixed boundary (represented by solid line) is known as a crisp set.
A set is generally represented by its elements: Let us assume that there are n technical
universities, each of which has three departments. The set of technical universities with
three departments each is denoted by

A = {a1 , a2 , . . . , an } (7.1)

A set can also be represented by the property of its element like the following:

A = {x|P (x)}, (7.2)

that is, set A contains all x belonging to X that have the property P .
For example: A ={x, such that they have three technical departments each}.
A set A can also be indicated by its characteristic function as follows:

1, if x belongs to A,
μA (x) = (7.3)
0, if x does not belong to A.
102 SOFT COMPUTING:Fundamentals and Applications

Thus, μA (x) has any one of two values: 1 (true) or 0 (false).

7.1.1 Notations Used in Set Theory


The following notations are used in the crisp sets:

1. ∅: It indicates an empty set (also known as null set) that does not contain any
element.

2. x ∈ A: It states that an element x of the Universal set X belongs to set A.

3. x ∈
/ A: It represents a condition that an element x of the Universal set X does not
belong to set A.

4. A ⊆ B: It is used to indicate that set A is a subset of set B, that is, each element of
A is also an element of B but the reverse may not be true.

5. A ⊇ B: It indicates that set A is a superset of set B, that is, each element of B is


also an element of A but the reverse may not be true.

6. A = B: It states that the sets: A and B are equal, that is, both of them contain the
same elements. If A ⊆ B and B ⊆ A, then A = B.

7. A = B: It says that the sets: A and B are not equal.

8. A ⊂ B: It is used to represent that set A is a proper subset of set B, for which


both the conditions: A ⊆ B and A = B are to be true and consequently, B contains
at least one element that is missing in A.

9. A ⊃ B: It states that the set A is a proper superset of set B, for which both the
conditions: A ⊇ B and A = B are to be satisfied. It means that set A contains at
least one element that is missing in set B.

10. |A|: It indicates the cardinality of set A, which is defined as the total number of
elements present in that set. For example, in case of a singleton set A = {a1 }, |A| = 1.

11. p(A): It represents the power set of A, which is nothing but the maximum number of
subsets including the null that can be constructed from the set A. Let us consider that
set A contains three elements, that is, A = {a1 , a2 , a3 }. The subsets (8 in number),
those can be constructed from the set A are: {a1 }, {a2 }, {a3 }, {a1 , a2 }, {a1 , a3 },
{a2 , a3 }, {a1 , a2 , a3 }, {∅}. Now, the cardinality of set A, that is, |A| = 3 and that of
p(A) is given by |p(A)| = 2|A| = 23 = 8.
Crisp Sets 103

7.1.2 Crisp Set Operations


A few set operations are explained below.

• Difference: The difference between two sets: A and B is represented as follows:

A − B = {x|x ∈ A and x ∈
/ B} (7.4)

It is also known as relative complement of set B with respect to set A, which


contains all the elements of A, those are not included in B (refer to Fig. 7.1(a)).
Absolute complement of a set A is indicated by Ā or Ac and it is defined as the

X X

A−B c
A B A

(a) (b)

Figure 7.1: The diagrams showing the complements of a set: (a) relative complement, (b) absolute
complement.

difference between the Universal set X and set A as given below (refer to Fig. 7.1(b)).

Ā = Ac = X − A = {x|x ∈ Xand x ∈
/ A}. (7.5)

Notes: It is important to note the following points:

1. Complement of a complement yields the original set.


2. Absolute complement of an empty set is nothing but the Universal set.
3. Absolute complement of the Universal set yields an empty set.

Example: Let A = {a, c, d, f, r, g, h} and B = {c, d, r, m, n}.


Therefore, A − B = {a, f, g, h}.

• Intersection: Intersection of two sets, namely A and B is denoted by A ∩ B and it


is defined as follows:
A ∩ B = {x|x ∈ A and x ∈ B} (7.6)
Fig. 7.2 shows the intersection of two sets: A and B, as the shaded area.
Two sets: A and B are called disjoint, if there is no common element between them
and it is indicated by A ∩ B = ∅.
Example:
Let A = {a, c, d, f, r, g, h} and B = {c, d, r, m, n}.
Therefore, A ∩ B = {c, d, r}.
104 SOFT COMPUTING:Fundamentals and Applications

A B

Figure 7.2: A diagram showing the intersection of two sets.

• Union: Union of two sets, such as A and B is represented by A ∪ B and it is defined


like the following:
A ∪ B = {x|x ∈ A or x ∈ B} (7.7)
The union of two sets: A and B is shown in Fig. 7.3, as the shaded area.
Example:

X
A B

Figure 7.3: A diagram showing the union of two sets.

Let A = {a, c, d, f, r, g, h} and B = {c, d, r, m, n}.


Therefore, A ∪ B = {a, c, d, f, r, g, h, m, n}.

7.1.3 Properties of Crisp Sets


Let us consider some crisp sets: A, B and C defined in the Universal set X. The following
properties of the crisp sets are important to mention:

1. Law of involution:

A=A

2. Laws of commutativity:

A∪B = B∪A
A∩B = B∩A
Fuzzy Sets 105

3. Laws of associativity:

(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)

4. Laws of distributivity:

A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)

5. Laws of idempotence/tautology:

A∪A = A
A∩A = A

6. Laws of absorption:

A ∪ (A ∩ B) = A
A ∩ (A ∪ B) = A

7. Laws of identity:

A∪X =X
A∩X =A
A∪∅=A
A∩∅=∅

8. De Morgan’s Laws:

(A ∪ B) = A ∩ B
(A ∩ B) = A ∪ B

9. Law of contradiction:

A∩A=∅

10. Law of excluded middle:

A∪A =X
106 SOFT COMPUTING:Fundamentals and Applications

Fuzzy
set
Figure 7.4: A schematic representation of fuzzy set.

7.2 Fuzzy Sets


Fuzzy sets are the sets with imprecise (vague) boundaries. Let us assume that we will have
to find the set of technical universities with three good departments each. It becomes a set
with imprecise boundary, which is popularly known as fuzzy set. Fig. 7.4 displays a fuzzy
set with its boundary denoted by dotted line. The concept of fuzzy set was introduced by
Prof. L.A. Zadeh of the University of California, USA, in 1965 [81], although an idea related
to it was visualized by Max Black, an American Philosopher, in 1937 [82]. Prof. Zadeh’s
paper was a challenge over the crisp set theory, the reasons for which are discussed below.
Real-world problems are generally associated with different types of uncertainties (such
as vagueness, imprecision). In the past, a considerable amount of effort was made to model
those uncertainties. Prior to 1965, people used to consider probability theory (which
works based on Aristotelian two-valued logic) as the prime agent for dealing with uncer-
tainties. It is to be noted that the above logic uses the concept of classical or crisp set
theory. Prof. Zadeh argued that probability theory can handle only one out of several
different types of possible uncertainties. Thus, there are some uncertainties, which cannot
be tackled using the probability theory. Let us take one example, in which Mr. A requests
Mr. B, one of his friends, to bring some red apples for him from the market. There are
two uncertainties at least, which are related to the following: (i) availability of the apples
and (ii) a guarantee that the apple is red. Depending on the season, there is a probability
(that is, the frequency of likelihood that an element is in a class) of obtaining the apples,
which varies between 0.0 and 1.0. According to the crisp set, the apples will be either red
(1) or non-red (0). On the other hand, in fuzzy set, the colour: red can be defined as
follows (refer to Fig. 7.5) using the concept of membership (that is, similarity of an element
to a class) function value (μ): If the colour is Perfectly Red (PR), then it may be said red
with a membership value of 1.0, if it is Almost Red (AR), then it is considered as red with
a membership value of 0.8, if it is Slightly Red (SR), then it is assumed to be red with
a membership value of 0.4, even if it is Not Red (NRD), then also it is called red with a
membership value of 0.0, and so on. Thus, in fuzzy set, an element can be a member of
the set with some membership value (that is, degree of belongingness). In this way, the
uncertainty related to colour of the apples can be handled. Thus, a fuzzy set is considered
to be a more general concept of the classical set. It is to be noted that the characteristic
function used in crisp set has been renamed as the membership function in fuzzy set.
Fuzzy Sets 107

Is the apple red ?

According to

Crisp set Fuzzy set

Yes/Member No/Non−member PR AR SR NRD


μ=1.0 μ=0.0 μ=1.0 μ=0.8 μ=0.4 μ=0.0

PR: Perfectly Red


AR: Almost Red
SR: Slightly Red
NRD: Not Red
μ: Membership value

Figure 7.5: A diagram used for explaining the concept of crisp set and fuzzy set.

Note: Belief measure of a set A (denoted by bel(A)) is nothing but its degree of sup-
port or certainty or evidence [83]. On the other hand, plausibility measure of the set A
(represented by pl(A)) is defined as the complement of the belief of the complement of A,
that is, pl(A) = 1 − bel(Ā). Now, ignorance is determined as 1 − {bel(A) + bel(Ā)}. If
bel(A) + bel(Ā) = 1, then ignorance turns out to be equal to 0 and belief becomes equal
to plausibility (that is, bel(A) = pl(A)). Here, we can use probability measure. On the
other hand, if ignorance becomes non-zero, we will have to use plausibility (also known
as possibility) measure, which is equivalent to fuzzy set.

7.2.1 Representation of a Fuzzy Set


A fuzzy set A(x) is represented by a pair of two things: the first one is the element x and
the second one is its membership value μA (x), as given below.

A(x) = {(x, μA (x)), x ∈ X} (7.8)

It may be either discrete or continuous in nature, as discussed below.

Discrete Fuzzy Set:


If a fuzzy set A(x) is discrete in nature, it can be expressed using the membership values
of its elements. Thus, the set A(x) is denoted like the following:


n
A(x) = μA (xi )/xi , (7.9)
i=1
108 SOFT COMPUTING:Fundamentals and Applications

where n is the number of elements present in the set.


Let us take an example, in which atmospheric temperature during the first fifteen days
of a month has been found to be medium. This medium temperature (M ) has been

1.0

0.0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Days

Figure 7.6: Representation of a discrete fuzzy set (that is, medium atmospheric temperature).

represented as follows:
M = 0.05/1 + 0.2/2 + 0.3/3 + 0.4/4 + 0.55/5 + 0.7/6 + 0.875/7 + 1.0/8 + 0.875/9 + 0.7/10 +
0.55/11 + 0.4/12 + 0.3/13 + 0.2/14 + 0.05/15.
The + sign does not indicate any algebraic sum but collection of the pairs of elements and
their membership values used to represent a fuzzy set. Fig. 7.6 shows the above represen-
tation in a plot. It is important to note that it can also be expressed as follows:
M = {(1, 0.05), (2, 0.2), (3, 0.3), (4, 0.4), (5, 0.55), (6, 0.7), (7, 0.875), (8, 1.0), (9, 0.875),
(10, 0.7), (11, 0.55), (12, 0.4), (13, 0.3), (14, 0.2), (15, 0.05)}.

Continuous Fuzzy Set:


A continuous fuzzy set A(x) is expressed mathematically like the following:

A(x) = μA (x)/x. (7.10)
X
It is important to mention that an integral sign is utilized here to indicate the collection of
the pairs of elements and their membership values used to represent a continuous fuzzy set.
It is represented with the help of a membership function distribution. Before we discuss
the different types of membership function distributions used generally, let us define the
concept of a convex fuzzy set.
A fuzzy set A(x), such that x ∈ X (where X is the Universal set) will be convex in
nature, if the following condition is satisfied:
μA {λx1 + (1 − λ)x2 } ≥ min{μA (x1 ), μA (x2 )}, (7.11)
where x1 and x2 are two values of x lying within X, λ is a constant lying in the range of
(0.0, 1.0), that is, 0.0 ≤ λ ≤ 1.0. Fig. 7.7 shows the convex and non-convex membership
Fuzzy Sets 109

1.0 1.0

0.75

μ μ 0.5

0.0 0.0

x x
(a) (b)

Figure 7.7: Schematic view showing (a) convex and (b) non-convex membership function distributions.

function distributions. Various types of membership function distributions are in use, some
of them are discussed below.

• Triangular Membership: It is denoted by Triangle (x; a, b, c) (refer to Fig. 7.8).


The membership function value (μtriangle ) for this distribution is determined as fol-

1.0

0.0
a b c
x

Figure 7.8: Triangular membership function distribution.

lows:
x−a c−x
μtriangle = max(min( , ), 0). (7.12)
b−a c−b
Thus, μtriangle values are set equal to 0.0, 1.0 and 0.0 at x = a, x = b and x = c,
respectively.

• Trapezoidal Membership: Fig. 7.9 shows a trapezoidal membership function dis-


tribution, that is represented as Trapezoidal (x; a, b, c, d). The membership value
110 SOFT COMPUTING:Fundamentals and Applications

1.0

0.0
a b c d
x
Figure 7.9: Trapezoidal membership function distribution.

μtrapezoidal can be expressed like the following:

x−a d−x
μtrapezoidal = max(min( , 1, ), 0). (7.13)
b−a d−c
The membership function values at x = a, x = b, x = c and x = d are set equal to
0.0, 1.0, 1.0 and 0.0, respectively.

• Gaussian Membership: The Gaussian membership function distribution shown in


Fig. 7.10, is indicated by Gaussian (x; m, σ), where m and σ represent the mean
and standard deviation of the distribution, respectively. The membership function

1.0

0.0
m
x
Figure 7.10: Gaussian membership function distribution.

μGaussian is represented as follows:


1
μGaussian = 1 x−m 2 . (7.14)
( σ )
e 2
Fuzzy Sets 111

At the point x = m, μGaussian comes out to be equal to 1.0 and as the value of x
deviates more and more from m, the value of μGaussian tends towards 0.0.

• Bell-shaped Membership Function: A bell-shaped membership function distribu-


tion (refer to Fig. 7.11) is represented as Bell-shaped (x; a, b, c) and it is expressed
as follows:
1
μBell−shaped = 2b
, (7.15)
1 + | x−c
a |
where a controls the width of the function, b (a positive number) indicates the slope
of the distribution and c is the center of the function.
1.0

0.0
c
x
Figure 7.11: Bell-shaped membership function distribution.

• Sigmoid Membership: A sigmoid function (shown in Fig. 7.12) can also be used
as membership function of a fuzzy set. It is denoted by Sigmoid (x; a, b) and its
membership function μsigmoid is expressed as follows:
1
μsigmoid = , (7.16)
1 + e−a(x−b)
where a indicates the slope of the distribution. Thus, μsigmoid becomes equal to 0.5,
at x = b. Moreover, it tends towards 0.0 and 1.0, as x approaches to 0.0 and a value
higher than b, respectively.

7.2.2 Difference Between Crisp Set and Fuzzy Set


Let us take another example to distinguish the concept of crisp set from that of fuzzy set,
in which Mr. Y requests Mr. Z to meet him at 7.00 pm. Fig. 7.13 shows the difference
between the crisp and fuzzy sets. According to the crisp set theory, if Mr. Z can meet Mr.
Y exactly at 7.00 pm, then it is true (generating full membership, that is, 1.0); otherwise
it is false (yielding non-membership, that is, 0.0). On the other hand, the time 7.00 pm
can be expressed within a range according to its representation in the fuzzy set (refer to
Fig. 7.13), in which different times will have different membership function values lying in
112 SOFT COMPUTING:Fundamentals and Applications

1.0

μ 0.5

0.0
b
x

Figure 7.12: Sigmoid membership function distribution.

1.0
Crisp set representation
0.66 Fuzzy set representation
μ

0.33

0.0
6.45 6.50 6.55 7.00 7.05 7.10 7.15

Time

Figure 7.13: A schematic view showing the difference between crisp and fuzzy sets.

the range of 0.0 to 1.0. Thus, if Mr. Z meets Mr. Y at 7.05 pm, then also it will be said
that he has met his friend at 7.00 pm with the membership value μ = 0.666, and so on. A
crisp set has a fixed boundary, whereas the boundary of a fuzzy set is vague in nature.

7.2.3 A Few Definitions in Fuzzy Sets


Some important terms related to fuzzy sets are defined below.

1. α-cut of a fuzzy set A(x): It is a set consisting of elements x of the Universal set
X, whose membership values are either greater than or equal to the value of α (refer
to Fig. 7.14). It is denoted by the symbol α μA (x). Thus, α-cut of a fuzzy set A(x) is
expressed as follows:
α
μA (x) = {x|μA (x) ≥ α}. (7.17)
Similarly, strong α-cut of a fuzzy set A(x) is represented like the following:
α+
μA (x) = {x|μA (x) > α}. (7.18)
Fuzzy Sets 113

1.0
A(x)
μ (x)
Α
α

0.0
2 4 6 8 10

x
Figure 7.14: α-cut of a fuzzy set.

Example:
The membership function distribution of a fuzzy set is assumed to follow a Gaussian
distribution with mean m = 100 and standard deviation σ = 20. Determine 0.6-cut
of this distribution.
The Gaussian membership function distribution can be expressed as follows:
1
μ= 1 x−m 2
e2( σ )

After substituting the value of μ = 0.6 in the above equation and taking log (ln) on
both the sides, we get
1 x−100 2
ln e 2 ( 20
)
= ln 1.6667

We simplify the above relationship and solve to get the range of x, which is found to
be as follows: (79.7846, 120.2153). It is called the 0.6-cut (refer to Fig. 7.15).
1.0

0.6
μ

0.0
79.7846 m 120.2153
x
Figure 7.15: 0.6-cut of a fuzzy set.
114 SOFT COMPUTING:Fundamentals and Applications

2. Support of a fuzzy set A(x): It is defined as the set of all x ∈ X, such that
μA (x) > 0. It is indicated by supp(A) and can be represented as follows:

supp(A) = {x ∈ X|μA (x) > 0}. (7.19)

Thus, the support of a fuzzy set is nothing but its strong 0-cut.

3. Scalar cardinality of a fuzzy set A(x): It is denoted by |A(x)| and can be defined
like the following:

|A(x)| = μA (x) (7.20)
x∈X

Example:
Let us consider a fuzzy set A(x) as follows:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}

Its cardinality |A(x)| = 0.1 + 0.2 + 0.3 + 0.4 = 1.0.

4. Core of a fuzzy set A(x): It is nothing but its 1-cut.

5. Height of a fuzzy set A(x): It is denoted by h(A) and defined as the largest of
membership values of the elements contained in that set.

6. Normal fuzzy set: A fuzzy set A(x) is called normal, if its height h(A) = 1.0.

7. Sub-normal fuzzy set: A fuzzy set A(x) is known as a sub-normal fuzzy set, if

1.0

0.625
μ A(x)

0.0

x
Figure 7.16: Sub-normal fuzzy set.

its height h(A) < 1.0 (refer to Fig. 7.16).


Fuzzy Sets 115

7.2.4 Some Standard Operations in Fuzzy Sets and Relations


As a fuzzy set is expressed in terms of membership values of its elements, operations of the
fuzzy sets are represented by their membership values. Some standard operations used in
the fuzzy sets are explained below.

1. Proper subset of a fuzzy set: Let us consider two fuzzy sets: A(x) and B(x),
such that all x ∈ X. The fuzzy set A(x) is called the proper subset of B(x), if
μA (x) < μB (x). It can be represented as follows:

A(x) ⊂ B(x), if μA (x) < μB (x). (7.21)

Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

As μA (x) < μB (x) for all x ∈ X, A(x) ⊂ B(x).

2. Equal fuzzy sets: Two fuzzy sets: A(x) and B(x) are said to be equal, if μA (x) =
μB (x) for all x ∈ X. It is expressed as follows:

A(x) = B(x), if μA (x) = μB (x). (7.22)

Note: Two fuzzy sets: A(x) and B(x) are said to be un-equal, if μA (x) = μB (x) for
at least one x ∈ X.
Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

As μA (x) = μB (x) for different x ∈ X, A(x) = B(x).

3. Complement of a fuzzy set A(x): It is denoted by Ā(x) and defined with respect
to the Universal set X as follows:

Ā(x) = 1 − A(x), for all x ∈ X. (7.23)

Fig. 7.17 shows the complement of a fuzzy set.


116 SOFT COMPUTING:Fundamentals and Applications

1.0

μ A(x)

A(x)
0.0
2 4 6 8 10

x
Figure 7.17: Complement of a fuzzy set.

Example:
Let us consider a fuzzy set A(x):

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}

Its complement Ā(x) = {(x1 , 0.9), (x2 , 0.8), (x3 , 0.7), (x4 , 0.6)}.
4. Intersection of fuzzy sets: Intersection of two fuzzy sets: A(x) and B(x) for all
x ∈ X, is denoted by (A ∩ B)(x) and its membership function value is determined as
follows (refer to the shaded area of Fig. 7.18):

μ(A∩B) (x) = min{μA (x), μB (x)}. (7.24)

It is to be noted that intersection is analogous to logical AND operation.

A(x) B(x)
1.0

μ 1111
0000
intersection 0000
1111
0000
1111
0000
1111
0000
1111
0000
1111
0.0 0000
1111
2 4 6 8 10

Figure 7.18: Intersection of two fuzzy sets.

Example:
Let us consider the following two fuzzy sets:
Fuzzy Sets 117

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, μ(A∩B) (x1 ) = min{μA (x1 ), μB (x1 )} = min{0.1, 0.5} = 0.1.


Similarly, μ(A∩B) (x2 ), μ(A∩B) (x3 ), μ(A∩B) (x4 ) are found to be equal to 0.2, 0.3 and
0.4, respectively.
5. Union of fuzzy sets: Union of two fuzzy sets: A(x) and B(x) for all x ∈ X, is
represented by (A ∪ B)(x) and its membership function value is determined as follows
(refer to the shaded area of Fig. 7.19):
μ(A∪B) (x) = max{μA (x), μB (x)}. (7.25)
It is important to note that union is analogous to logical OR operation.

A(x) B(x)
1.0 11111111
00000000
00000000
11111111
00000000
11111111
00000000
11111111
00000000
11111111
00000000
11111111
μ 00
11
00000000
11111111
00
11
00
11
00000000
11111111
00
11
00
11
union 00000000
11111111
00
11
00
11
00000000
11111111
00
11
00
11
00000000
11111111
00
11
00
11
00000000
11111111
00
11
00
11
0.0 00000000
11111111
00
11
2 4 6 8 10

Figure 7.19: Union of two fuzzy sets.

Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, μ(A∪B) (x1 ) = max{μA (x1 ), μB (x1 )} = max{0.1, 0.5} = 0.5.


Similarly, μ(A∪B) (x2 ), μ(A∪B) (x3 ), μ(A∪B) (x4 ) are found to be equal to 0.7, 0.8 and
0.9, respectively.
6. Algebraic product of fuzzy sets: An algebraic product of two fuzzy sets: A(x)
and B(x) is denoted by A(x).B(x) and defined like the following:
A(x).B(x) = {(x, μA (x).μB (x)), x ∈ X}. (7.26)
Example:
Let us consider the following two fuzzy sets:
118 SOFT COMPUTING:Fundamentals and Applications

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, A(x).B(x) = {(x1 , 0.05), (x2 , 0.14), (x3 , 0.24), (x4 , 0.36)}.

7. Multiplication of a fuzzy set by a crisp number: The product of a fuzzy set


A(x) and a crisp number d is expressed as follows:

d.A(x) = {(x, d × μA (x)), x ∈ X}. (7.27)

Example:
Let us consider a fuzzy set A(x):

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}

If d = 0.2, then d.A(x) = {(x1 , 0.02), (x2 , 0.04), (x3 , 0.06), (x4 , 0.08)}.

8. Power of a fuzzy set: The p-th power of a fuzzy set A(x) yields another fuzzy set
Ap (x), whose membership value can be determined as follows:

μAp (x) = {μA (x)}p , x ∈ X. (7.28)


1
It is important to mention that if p is set equal to 2 and 2, then Ap (x) is called
concentration and dilation, respectively.
Example:
Let us consider a fuzzy set A(x):

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}

Now, for p = 2,
A2 (x) = {(x1 , 0.01), (x2 , 0.04), (x3 , 0.09), (x4 , 0.16)}.

9. Algebraic sum of two fuzzy sets A(x) and B(x): It is determined as follows:

A(x) + B(x) = {(x, μA+B (x)), x ∈ X}, (7.29)

where μA+B (x) = μA (x) + μB (x) − μA (x).μB (x).


Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, A(x) + B(x) = {(x1 , 0.55), (x2 , 0.76), (x3 , 0.86), (x4 , 0.94)}.
Fuzzy Sets 119

10. Bounded sum of two fuzzy sets A(x) and B(x): It is defined like the following:
A(x) ⊕ B(x) = {(x, μA⊕B (x)), x ∈ X}, (7.30)
where μA⊕B (x) = min{1, μA (x) + μB (x)}.
Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, A(x) ⊕ B(x) = {(x1 , 0.6), (x2 , 0.9), (x3 , 1.0), (x4 , 1.0)}.
11. Algebraic difference of two fuzzy sets A(x) and B(x): It will give rise to a new
fuzzy set as given below.
A(x) − B(x) = {(x, μA−B (x)), x ∈ X}, (7.31)
where μA−B (x) = μA∩B̄ (x).
Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, B̄ = {(x1 , 0.5), (x2 , 0.3), (x3 , 0.2), (x4 , 0.1)}.


Therefore, A(x) − B(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.2), (x4 , 0.1)}.
12. Bounded difference of two fuzzy sets A(x) and B(x): It is calculated as follows:
A(x)  B(x) = {(x, μA B (x)), x ∈ X}, (7.32)
where μA B (x) = max{0, μA (x) + μB (x) − 1}.
Example:
Let us consider the following two fuzzy sets:

A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}


B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}

Now, A(x)  B(x) = {(x1 , 0), (x2 , 0), (x3 , 0.1), (x4 , 0.3)}.
13. Cartesian product of two fuzzy sets: Let us consider two fuzzy sets: A(x) and
B(y) defined on the Universal sets X and Y , respectively. The Cartesian product of
fuzzy sets: A(x) and B(y) is denoted by A(x) × B(y), such that x ∈ X and y ∈ Y . It
is determined, so that the following condition is satisfied.
μA×B (x, y) = min(μA (x), μB (y)). (7.33)
Example:
Let us consider the following two fuzzy sets:
120 SOFT COMPUTING:Fundamentals and Applications

A(x) = {(x1 , 0.2), (x2 , 0.3), (x3 , 0.5), (x4 , 0.6)}


B(y) = {(y1 , 0.8), (y2 , 0.6), (y3 , 0.3)}

Now, min(μA (x1 ), μB (y1 )) = min(0.2, 0.8) = 0.2.


Similarly, the values of min(μA (x1 ), μB (y2 )), min(μA (x1 ), μB (y3 )),
min(μA (x2 ), μB (y1 )), min(μA (x2 ), μB (y2 )), min(μA (x2 ), μB (y3 )),
min(μA (x3 ), μB (y1 )), min(μA (x3 ), μB (y2 )), min(μA (x3 ), μB (y3 )),
min(μA (x4 ), μB (y1 )), min(μA (x4 ), μB (y2 )) and min(μA (x4 ), μB (y3 )) are found to be
equal to 0.2, 0.2, 0.3, 0.3, 0.3, 0.5, 0.5, 0.3, 0.6, 0.6 and 0.3, respectively. Thus, A × B
will come out to be as follows:
⎡ ⎤
0.2 0.2 0.2
⎢ ⎥
⎢ 0.3 0.3 0.3 ⎥
A×B =⎢ ⎥
⎣ 0.5 0.5 0.3 ⎦
0.6 0.6 0.3

14. Composition of fuzzy relations: Let A = [aij ] and B = [bjk ] be two fuzzy relations
expressed in the matrix form. Composition of these two fuzzy relations, that is, C is
represented by
C = A ◦ B, (7.34)
such that it can be expressed in the matrix form:

[cik ] = [aij ] ◦ [bjk ],

where

cik = max[min(aij , bjk )].

Example:
Let us consider the following two fuzzy relations:
 
0.2 0.3
A = [aij ] =
0.5 0.7
 
0.3 0.6 0.7
B = [bjk ] =
0.1 0.8 0.6

Now, the elements of [cik ] matrix can be determined as follows:

c11 = max[min(a11 , b11 ), min(a12 , b21 )]


= max[min(0.2, 0.3), min(0.3, 0.1)]
= 0.2
Fuzzy Sets 121

c12 = max[min(a11 , b12 ), min(a12 , b22 )]


= max[min(0.2, 0.6), min(0.3, 0.8)]
= 0.3

c13 = max[min(a11 , b13 ), min(a12 , b23 )]


= max[min(0.2, 0.7), min(0.3, 0.6)]
= 0.3

c21 = max[min(a21 , b11 ), min(a22 , b21 )]


= max[min(0.5, 0.3), min(0.7, 0.1)]
= 0.3

c22 = max[min(a21 , b12 ), min(a22 , b22 )]


= max[min(0.5, 0.6), min(0.7, 0.8)]
= 0.7

c23 = max[min(a21 , b13 ), min(a22 , b23 )]


= max[min(0.5, 0.7), min(0.7, 0.6)]
= 0.6

Therefore, C is found to be like the following:


 
0.2 0.3 0.3
C=
0.3 0.7 0.6

7.2.5 Properties of Fuzzy Sets


Fuzzy sets follow the properties of crisp sets stated in Section 7.1.3, except the following
two, as explained below.

1. Law of excluded middle:


In crisp set,

A ∪ A = X.

However, according to the fuzzy set,

A ∪ A = X.
122 SOFT COMPUTING:Fundamentals and Applications

2. Law of contradiction:
As per crisp set,

A ∩ A = ∅.

However, in the fuzzy set,

A ∩ A = ∅.

It happens due to the fact that an element belongs to both a fuzzy set as well as its com-
plement. For example, if the apple is red with membership value 0.8 (that is, μred(apple) =
0.8), it is also not red (red) with membership value of 0.2 (that is, μred (apple) = 0.2) (refer
to Fig. 7.20). Fig. 7.20(a) shows the violation of the law of excluded middle, whereas the

A(x) A(x) A(x) A(x)


1.0 1111111111
0000000000
0000000000
1111111111
1.0
0000000000
1111111111
0000000000
1111111111
0000000000
1111111111
0000000000
1111111111
0000000000
1111111111
μ 0000000000
1111111111 μ
0000000000
1111111111 1111111111
0000000000
0000000000
1111111111 0000000000
1111111111
0000000000
1111111111
0000000000
1111111111
0000000000
1111111111 0000000000
1111111111
0000000000
1111111111 0000000000
1111111111
0000000000
1111111111 0000000000
1111111111
0000000000
1111111111
0.0 0000000000
1111111111 0.0 0000000000
1111111111

x x

(a) (b)

Figure 7.20: Two properties of crisp sets violated by the fuzzy sets, such as (a) Law of excluded middle,
(b) Law of contradiction.

reason behind violation of the law of contradiction can be understood from Fig. 7.20(b).

7.3 Measures of Fuzziness and Inaccuracy of Fuzzy Sets


The fuzziness of a fuzzy set was measured using the concept of entropy by DeLuca and
Termini [84] as given below.
Let us consider X = {x1 , x2 , . . . , xn } be a discrete universe of discourse. The entropy of
a fuzzy set A(x) could be determined as follows:

1 n
H(A) = − [μA (xi )log{μA (xi )} + {1 − μA (xi )}log{1 − μA (xi )}] (7.35)
n i=1

Example:
Let A(x) be a fuzzy set in a discrete universe of discourse as given below.
A(x) = {(x1 , 0.1), (x2 , 0.3), (x3 , 0.4), (x4 , 0.5)}. Calculate its entropy value.
Summary 123

The value of entropy, H(A) = − 14 [{0.1 × log(0.1) + 0.9 × log(0.9)} + {0.3 × log(0.3) + 0.7 ×
log(0.7)} + {0.4 × log(0.4) + 0.6 × log(0.6)} + {0.5 × log(0.5) + 0.5 × log(0.5)}] = 0.2499
Now, let us consider two fuzzy sets: A(x) and B(x) defined in the same discrete universe
of discourse X = {x1 , x2 , . . . , xn }, whose membership values are denoted by μA (xi ) and
μB (xi ), respectively, where i = 1, 2, . . . , n.
The inaccuracy of the fuzzy set B(x) can be measured with respect to the fuzzy set A(x)
as follows [85]:

1 n
I(A; B) = − [μA (xi )log(μB (xi )) + (1 − μA (xi ))log(1 − μB (xi ))] (7.36)
n i=1

Example:
Let us consider the following two fuzzy sets in the same discrete universe of discourse:
A(x) = {(x1 , 0.1), (x2 , 0.2), (x3 , 0.3), (x4 , 0.4)}
B(x) = {(x1 , 0.5), (x2 , 0.7), (x3 , 0.8), (x4 , 0.9)}
Determine inaccuracy of the fuzzy set B(x) with respect to the fuzzy set A(x).
The inaccuracy of B(x) with respect to A(x), I(A; B) = − 14 [{0.1 × log(0.5) + 0.9 ×
log(0.5)} + {0.2 × log(0.7) + 0.8 × log(0.3)} + {0.3 × log(0.8) + 0.7 × log(0.2)} + {0.4 ×
log(0.9) + 0.6 × log(0.1)}] = 0.4717

7.4 Summary
This chapter has been summarized as follows:
1. An introduction is given to crisp sets, which are the sets having fixed boundaries. The
notations used in set theory have been listed. After defining a few crisp set operations
(such as difference, intersection, union), different properties of crisp sets have been
stated.
2. The concept of fuzzy sets has been introduced. Fuzzy sets are the sets with vague
boundaries. It is important to mention that a crisp set is a special case of the more
general concept of a fuzzy set. A fuzzy set may be either discrete or continuous in na-
ture. Some of the frequently-used membership function distributions for representing
the fuzzy sets are discussed, in detail. After defining a few terms related to fuzzy sets
(namely α-cut, support, scalar cardinality, core, height, and others), some of their
standard operations are explained in detail.
3. It deals with the measures of fuzziness and inaccuracy of fuzzy sets.

7.5 Exercise
1. Justify the following statements:
(i) Every set is the subset of both itself as well as the Universal set.
124 SOFT COMPUTING:Fundamentals and Applications

(ii) An empty set is a subset of any other set.


(iii) A fuzzy set is said to be convex, if all α-cut sets are convex.
2. Let us consider the following two fuzzy sets:
A(x) = {(x1 , 0.15), (x2 , 0.27), (x3 , 0.47), (x4 , 0.57)}
B(x) = {(x1 , 0.35), (x2 , 0.48), (x3 , 0.58), (x4 , 0.69)}
Determine

(a) Scalar cardinality of above two fuzzy sets,


(b) A(x) and B(x),
(c) Intersection of A(x) and B(x),
(d) Union of A(x) and B(x),
(e) Algebraic product of A(x) and B(x),
(f) d.A(x) and d.B(x), where d = 0.3 is a crisp number,
(g) Concentration and dilation of A(x) and B(x),
(h) Algebraic sum of A(x) and B(x),
(i) Bounded sum of A(x) and B(x),
(j) Algebraic difference of A(x) and B(x),
(k) Bounded difference of A(x) and B(x).

3. Determine Cartesian product of the following two fuzzy sets:


A(x) = {(x1 , 0.1), (x2 , 0.25), (x3 , 0.34)}
B(y) = {(y1 , 0.8), (y2 , 0.7)}.
4. Two fuzzy relations A and B are given below (expressed in the matrix form).
 
0.3 0.4
A = [aij ] =
0.1 0.5
 
0.2 0.6 0.7
B = [bjk ] =
0.9 0.8 0.1

Determine the composition of these two fuzzy relations.

5. Let us consider a fuzzy set A(x) in a discrete universe of discourse as follows:


A(x) = {(x1 , 0.2), (x2 , 0.25), (x3 , 0.3), (x4 , 0.4), (x5 , 0.6)}. Calculate its entropy value.
6. Let us consider the following two fuzzy sets in the same discrete universe of discourse:

A(x) = {(x1 , 0.2), (x2 , 0.25), (x3 , 0.3), (x4 , 0.35), (x5 , 0.4)}
B(x) = {(x1 , 0.3), (x2 , 0.32), (x3 , 0.4), (x4 , 0.45), (x5 , 0.5)}

Determine inaccuracy of the fuzzy set B(x) with respect to the fuzzy set A(x).
Chapter 8

Fuzzy Reasoning and Clustering

This chapter deals with two of the most important applications of fuzzy set theory, which
are developed in the forms of reasoning tool and clustering technique.

8.1 Introduction
The concept of fuzzy set theory has been used in a number of ways, such as Fuzzy Logic Con-
troller (FLC), fuzzy clustering algorithms, fuzzy mathematical programming, fuzzy graph
theory, and others. Out of all such applications, the FLC is the most popular one, due to
the following reasons: (i) ease of understanding and implementations, (ii) ability to handle
uncertainty and imprecision. Moreover, an exact mathematical formulation of the prob-
lem is not essential for development of an FLC. This feature makes it a natural choice for
solving complex real-world problems, which are either difficult to model mathematically or
the mathematical model becomes highly non-linear. Two important tools developed based
on the fuzzy set theory, namely fuzzy logic controller and fuzzy clustering algorithm are
explained below in detail.

8.2 Fuzzy Logic Controller


Fuzzy Logic Controller (FLC) was first developed by Mamdani and Assilian around 1975 [86],
although the concept of fuzzy set was published in 1965. Human beings have the natural
quest to know input-output relationships of a process. The behavior of a human being is
modeled artificially for designing a suitable FLC. The performance of an FLC depends on
its Knowledge Base (KB), which consists of both Data Base (DB) (that is, data related to
membership function distributions of the variables of the process to be controlled) as well
as Rule Base (RB). However, designing a proper KB of an FLC is a difficult task, which
can be implemented in one of the following ways:
• Optimization of the DB only,
• Optimization of the RB only,
126 SOFT COMPUTING:Fundamentals and Applications

• Optimization of the DB and RB in stages,


• Optimization of the DB and RB simultaneously.
The membership function distributions are assumed to be either linear (such as triangular,
trapezoidal) or non-linear (namely Gaussian, bell-shaped, sigmoid). To design and develop
a suitable FLC for controlling a process, its variables need to be expressed in the form of
some linguistic terms (such as VN: Very Near, VFR: Very Far, A: Ahead etc.) and the
relationships between input (antecedent) and output (consequent) variables are expressed
in the form of some rules. For example, a rule can be expressed as follows (refer to Fig. 8.1):

IF I1 is N R AND I2 is A THEN O is ART .

VN NR FR VFR

LT AL A ART RT

1 2 3 4
I (m)
1
−90 −45 0 45 90
LT AL A ART RT
O (degrees)

VN: Very Near LT: Left


−90 −45 0 45 90 NR: Near AL: Ahead Left
I (degrees) FR: Far A: Ahead
2 VFR: Very Far ART: Ahead Right
RT: Right

Figure 8.1: A diagram showing some membership function distributions of input and output variables of
an FLC.

It is obvious that the number of rules to be present in the rule base will increase, as the
number of linguistic terms used to represent the variables increases (to ensure a better
accuracy in prediction). Moreover, computational complexity of the controller will increase
with the number of rules. For an easy implementation in either the software or hardware, the
number of rules present in the RB should be as small as possible. Realizing this fact, some
investigators have also tried to design and develop a hierarchical FLC, in which the number
of rules will be kept to the minimum [87, 88]. It has been observed that the performance of
an FLC largely depends on the RB and optimizing the DB is a fine tuning process [89]. An
FLC does not have an in-built optimization module. An external optimizer is to be used to
develop its optimal KB through a proper tuning and this helps to improve the performance.

8.2.1 Two Major Forms of Fuzzy Logic Controller


System modeling done using the concept of fuzzy sets can be classified into two groups,
namely linguistic fuzzy modeling and precise fuzzy modeling. Linguistic fuzzy mod-
Fuzzy Logic Controller 127

eling, such as Mamdani Approach [86] is characterized by its high interpretability and
low accuracy, whereas the aim of precise fuzzy modeling like Takagi and Sugeno’s Ap-
proach [90], is to obtain high accuracy but at the cost of interpretability. Interpretability
of a fuzzy modeling is defined as its capability to express the behavior of a system in an
understandable form. It is generally expressed in terms of compactness, completeness, con-
sistency and transparency. The accuracy of a fuzzy model indicates how closely it can
represent the modeled system. The working principles of both these approaches are briefly
explained below.

Mamdani Approach [86]:


An FLC consists of four modules, namely a rule base, an inference engine, fuzzification and
de-fuzzification. Fig. 8.2 shows a schematic view explaining the working cycle of an FLC.

Defuzzification Actions
module

Fuzzy Process
Fuzzy
inference to be
rule base controlled
engine

Fuzzification Conditions
module

FLC

Figure 8.2: A schematic view showing the working cycle of an FLC.

The following steps are involved in the working cycle of an FLC:

• The condition (also known as antecedent) and action (also called consequent)
variables needed to control a process are identified and measurements are taken of all
the condition variables.

• The measurements taken in the previous step are converted into appropriate fuzzy
sets to express measurement uncertainties. This process is known as fuzzification.

• The fuzzified measurements are then used by inference engine to evaluate the control
rules stored in the fuzzy rule base and a fuzzified output is determined.
128 SOFT COMPUTING:Fundamentals and Applications

• The fuzzified output is then converted into a single crisp value. This conversion is
called de-fuzzification. The de-fuzzified values represent the actions to be taken by
the FLC in controlling the process.

The fuzzy reasoning process is illustrated in Figure 8.3. Let us assume for simplicity that

μA1 μB1 μC1

Rule 1

s1 s2 f

μA2 μB2 μC2

Rule 2

s1* s1 s2* s2 f
μC

f
U
f

Figure 8.3: A schematic view showing the working principle of an FLC.

only two fuzzy control rules (out of many rules present in the rule base) are being fired as
given below, for a set of inputs: (s1∗ , s2∗ ).

Rule 1: IF s1 is A1 AND s2 is B1 THEN f is C1

Rule 2: IF s1 is A2 AND s2 is B2 THEN f is C2

If s1∗ and s2∗ are the inputs for fuzzy variables: s1 and s2 and if μA1 and μB1 are the
membership function values for A and B, respectively, then the grade of membership of
s1∗ in A1 and that of s2∗ in B1 are represented by μA1 (s1∗ ) and μB1 (s2∗ ), respectively, for
rule 1. Similarly, for rule 2, μA2 (s1∗ ) and μB2 (s2∗ ) are used to represent the membership
Fuzzy Logic Controller 129

function values. The firing strengths of the first and second rules are calculated as follows:

α1 = min (μA1 (s1∗ ), μB1 (s2∗ )) , (8.1)


∗ ∗
α2 = min (μA2 (s1 ), μB2 (s2 )) . (8.2)

The membership value of the combined control action C is given by



  

μC (f ) = max μ∗C1 (f ), μ∗C2 (f ) . (8.3)

There are several methods of defuzzification (refer to Fig. 8.4), which are explained below.

0.5 0.5
3
μ 0.3 μ 0.3
2
1 4 5 6
0.0 0.0
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
Output Output
(a) (b)

0.5

μ 0.3

0.0
1 2 3 4 5 6 7 8 9 10
Output
(c)
Figure 8.4: Different methods of defuzzification: (a) center of sums method, (b) centroid method, (c)
mean of maxima method.

1. Center of Sums Method: In this method of defuzzification (refer to Fig. 8.4(a)),


the crisp output can be determined as follows:
p
 j=1 A(αj ) × fj
Uf  = p , (8.4)
j=1 A(αj )


where Uf  is the output of the controller, A(αj ) represents the firing area of j-th rule,
p is the total number of the fired rules and fj represents the center of the area.

2. Centroid Method: The total area of the membership function distribution used to
represent the combined control action is divided into a number of standard sub-areas,
130 SOFT COMPUTING:Fundamentals and Applications

whose area and the center of area can be determined easily (refer to Fig. 8.4(b)). The
crisp output of the controller can be calculated using the expression given below.
N
 Ai fi
Uf  = i=1
N
, (8.5)
i=1 Ai

where N indicates the number of small areas or regions, Ai and fi represent the area
and center of area, respectively, of i-th small region.

3. Mean of Maxima Method: From the membership function distribution of com-


bined control action, the range of the output variable corresponding to the maximum
value of membership is identified. The mid-value of this range is considered to be the
crisp output of the controller (refer to Fig. 8.4(c)).

A Numerical Example:
Fig. 8.5 shows a typical problem scenario related to navigation of a mobile robot in the
presence of four moving obstacles. The directions of movement of the obstacles are shown

O O4
1

O
3
O
2

Figure 8.5: A typical robot motion planning problem.

in the figure. The obstacle O2 is found to be the most critical one. Our aim is to develop
a fuzzy logic-based motion planner that will be able to generate the collision-free path for
the robot. There are two inputs, namely the distance between the robot and the obstacle
(D) and angle ( GSO2 ) for the motion planner and it will generate one output, that is,
deviation. Distance is represented using four linguistic terms, namely Very Near (VN),
Near (NR), Far (FR) and Very Far (VFR), whereas the input: angle and output: deviation
are expressed with the help of five linguistic terms, such as Ahead (A), Ahead Left (AL),
Fuzzy Logic Controller 131

VFR RT
1.0 VN NR FR 1.0 LT AL ART
A

μ μ

0.0 0.0
0.1 0.8 1.5 2.2 −90 −45 0 45 90
Distance (m) Deviation (degrees)
RT
1.0 LT AL ART
A

0.0
−90 −45 0 45 90
Angle (degrees)

Figure 8.6: Data Base of the fuzzy logic controller.

Left (LT), Ahead Right (ART) and Right (RT). Fig. 8.6 shows the DB of the FLC. The rule
base of the fuzzy logic-based motion planner is given in Table 8.1. Determine the output -

Table 8.1: Rule Base of the fuzzy logic controller

Angle
LT AL A ART RT
VN A ART AL AL A
Distance NR A A RT A A
FR A A ART A A
VFR A A A A A

deviation for the set of inputs: distance D = 1.04 m and angle  GSO2 = 30 degrees, using
Mamdani Approach. Use different methods of defuzzification.
Solution:
The inputs are:

Distance = 1.04 m, Angle = 30 degrees

The distance of 1.04 m may be called either N R (Near) or F R (Far). Similarly, the input
angle of 30 degrees can be declared either A (Ahead) or ART (Ahead Right). Fig. 8.7 shows
a schematic view used to determine the membership value, corresponding to the distance
of 1.04 m. Using the principle of similar triangle, we can write the following relationship:
x 1.5−1.04
1.0 = 1.5−0.8
132 SOFT COMPUTING:Fundamentals and Applications

NR
1.0 x

0.8 1.5

1.04
Figure 8.7: A schematic view used to determine the membership value corresponding to the distance of
1.04 m.

From the above expression, x is found to be equal to 0.6571. Thus, the distance of 1.04 m
may be declared N R with a membership value of 0.6571, that is, μN R = 0.6571. Similarly,
the distance of 1.04 m can also be called F R with a membership value of 0.3429, that is,
μF R = 0.3429.
In the same way, an input angle of 30 degrees may be declared either A with a membership
value of 0.3333 (that is, μA = 0.3333) or ART with a membership value of 0.6667 (that is,
μART = 0.6667).
For the above set of inputs, the following four rules are being fired from a total of 20:
If Distance is NR AND Angle is A Then Deviation is RT
If Distance is NR AND Angle is ART Then Deviation is A
If Distance is FR AND Angle is A Then Deviation is ART
If Distance is FR AND Angle is ART Then Deviation is A
The strengths (α values) of the fired rules are calculated as follows:
α1 = min (μN R , μA )) = min (0.6571, 0.3333)) = 0.3333
α2 = min (μN R , μART )) = min (0.6571, 0.6667)) = 0.6571
α3 = min (μF R , μA )) = min (0.3429, 0.3333)) = 0.3333
α4 = min (μF R , μART )) = min (0.3429, 0.6667)) = 0.3429
The fuzzified outputs corresponding to above four fired rules are shown in Fig. 8.8. Fig. 8.9
shows the union of the fuzzified outputs, corresponding to the above four fired rules.
The above fuzzified output cannot be used as a control action and its crisp value has been
determined using the following methods of defuzzification:
1. Center of Sums Method
Fig. 8.10 shows the Center of Sums Method of defuzzification. The shaded region
corresponding to each fired rule is shown in this figure. The values of area and center
of area of the above shaded regions are also given in this figure, in a tabular form. The
crisp output U of above four fired rules can be calculated as follows (refer to equation
(8.4)):
12.5 × 71 + 39.7089 × 0.0 + 25.0 × 45.0 + 25.5699 × 0.0
U =
12.5 + 39.7089 + 25.0 + 25.5699
Fuzzy Logic Controller 133

1.0 1.0
NR A RT

1
111111
000000
0.0 0.0 000000
111111
000000
111111
0.3333
0.8 1.5 0 45 45 90
1.0 1.0
NR
ART
11111111111
00000000000
A
00000000000
11111111111
00000000000
11111111111
2

00000000000
11111111111 0.6571
00000000000
11111111111
0.0
0.8 1.5 0 45
0.0
00000000000
11111111111
−45 45
1.0
FR A ART

3
11111111111
00000000000
0.0 00000000000
11111111111 0.3333
0.8 1.5 0 45 0 90
1.0 1.0
FR ART A

4
11111111111
00000000000
00000000000
11111111111
00000000000
11111111111 0.3429
0.8 1.5
0.0
0 45
0.0
00000000000
11111111111
−45 45

Distance input Angle input Deviation angle


1.04 m 30 degrees (degrees)

Figure 8.8: The fuzzified outputs corresponding to four different fired rules.
134 SOFT COMPUTING:Fundamentals and Applications

1.0 A ART RT

0.6571
111111111111111
000000000000000
000000000000000
111111111111111
0.3429 111111111111111
000000000000000
000000000000000
111111111111111
0.0 111111111111111
0.3333
000000000000000
−45 0 45 90

Deviation (degrees)

Figure 8.9: Combined fuzzified output considering all four fired rules.

= 19.5809

Therefore, the robot should deviate by 19.5809 degrees towards right with respect to
the line joining the present position of the robot and the goal to avoid collision with
the obstacle.

2. Centroid Method
The shaded region representing the combined output corresponding to above four fired
rules (refer to Fig. 8.9) has been divided into a number of regular sub-regions, whose
area and center of area can easily be determined. For example, the shaded region of
Fig. 8.9 has been divided into four sub-regions (two triangles and two rectangles) as
shown in Fig. 8.11. The values related to area and center of area of the above four
sub-regions are shown in this figure, in a tabular form. In this method, the crisp
output U can be obtained like the following (refer to equation (8.5)):
A
U = ,
B
where A = 9.7151 × (−25.2860) + 20.2788 × 0.0 + 2.3588 × 20.2870 + 24.8540 × 52.7153,
B = 9.7151 + 20.2788 + 2.3588 + 24.8540.
Therefore, U turns out to be equal to 19.4450.
Thus, the robot should deviate by 19.4450 degrees towards right with respect to the
line joining the present position of the robot and the goal to avoid collision with the
obstacle.
3. Mean of Maxima
Fig. 8.12 shows the fuzzified output of the controller for the above four fired rules.
From this figure, it is observed that the maximum value of membership (that is,
0.6571) has occurred in a range of deviation angle starting from −15.4305 to 15.4305
degrees. Thus, its mean is coming out to be equal to 0.0. Therefore, the crisp output
U of the controller becomes equal to 0.0, that is, U = 0.0. The robot will move along
the line joining its present position and the goal.
Fuzzy Logic Controller 135

1.0 A ART RT

0.6571
111111111111111
000000000000000
000000000000000
111111111111111
0.3429 111111111111111
000000000000000
000000000000000
111111111111111
0.0 111111111111111
000000000000000
0.3333
−45 0 45 90

Deviation (degrees)

Fired
Shaded region Area Center of area
rule
111111
000000
1
000000
111111
000000
111111 12.5 71
000000
111111
45 90

1111111111
0000000000
0000000000
1111111111
2
0000000000
1111111111
0000000000
1111111111
39.7089 0

0000000000
1111111111
−45 45

3 1111111111
0000000000
0000000000
1111111111 25 45
01111111111
000000000090
0000000000
1111111111
4
0000000000
1111111111
0000000000
1111111111 25.5699 0
000000000045
1111111111
−45

Figure 8.10: Defuzzification using the Center of Sums Method.


136 SOFT COMPUTING:Fundamentals and Applications

1.0 A ART RT

1111111111111111
0000000000000000
0.6571 0000000000000000
1111111111111111
2
0000000000000000
1111111111111111
3

0000000000000000
1111111111111111
0.3429
1
0.01111111111111111
0.3333
0000000000000000
−45 0 30 45
4
90
−15.4305
15.4305 Crisp Output
Deviation (degrees)

Marked Shaded regions Area Center of


regions area
1111
0000
1 0000
1111
0000 0.6571
1111 9.7151 −25.2860
0000
1111
0000−15.4305
1111
−45

0000
1111
0000
1111
2
0000 0.6571
1111 20.2788 0
0000
1111
0000
1111
−15.4305 15.4305

000
111
0.3238 111
000
111
2.3588 20.2870
00030
3
15.4305
0.33 111111111
000000000
4 33 111111111
000000000
000000000
111111111
24.8540 52.7153
15.4305 90

Figure 8.11: Defuzzification using the Centroid Method.


Fuzzy Logic Controller 137

1.0 A ART RT

0.6571
111111111111111
000000000000000
000000000000000
111111111111111
0.3429 111111111111111
000000000000000
000000000000000
111111111111111
0.0 111111111111111
0.3333
000000000000000
−45 0 45 90
−15.4305 15.4305

Deviation (degrees)

Figure 8.12: Defuzzification using the Mean of Maxima Method.

Takagi and Sugeno’s Approach [90]:


Here, a rule is composed of fuzzy antecedent and functional consequent parts. Thus, a rule
(say i-th) can be represented as follows:
If x1 is Ai1 and x2 is Ai2 ..... and xn is Ain
then y i = ai0 + ai1 x1 + . . . + ain xn ,
where a0 , a1 , . . . , an are the coefficients. It is to be noted that i does not represent the
power but it is a superscript only. In this way, a nonlinear system is considered to be a
combination of several linear systems. The weight of i-th rule can be determined for a set
of inputs (x1 , x2 , . . . , xn ) like the following:

wi = μiA1 (x1 )μiA2 (x2 ) . . . μiAn (xn ), (8.6)

where A1 , A2 , . . . , An indicate membership function distributions of the linguistic terms used


to represent the input variables and μ denotes the membership function value. Thus, the
combined control action can be determined as follows:
k
wi y i
y = i=1
k
, (8.7)
i
i=1 w

where k indicates the total number of rules.

A Numerical Example:
A fuzzy logic-based expert system is to be developed that will work based on Takagi and
Sugeno’s approach to predict the output of a process. The DB of the FLC is shown in
Fig. 8.13. As there are two inputs: I1 and I2 , and each input is represented using three
linguistic terms (for example, LW , M , H for I1 and N R, F R, V F R for I2 ), there is a
maximum of 3 × 3 = 9 feasible rules. The output of i-th rule, that is, y i (i = 1, 2, . . . , 9) is
expressed as follows:
y i = f (I1 , I2 ) = aij I1 + bik I2 ,
138 SOFT COMPUTING:Fundamentals and Applications

LW M H NR FR VFR
1.0 1.0

μ μ

0.0 0.0
5.0 10.0 15.0 1.0 2.0 3.0

I I
1 2
LW: Low NR: Near

M: Medium FR: Far

H: High VFR: Very Far

Figure 8.13: Data Base of the FLC.

where j, k = 1, 2, 3; ai1 = 1, ai2 = 2 and ai3 = 3, if I1 is found to be LW , M and H,


respectively; bi1 = 1, bi2 = 2 and bi3 = 3, if I2 is seen to be N R, F R and V F R, respectively.
Calculate the output of the FLC for the inputs: I1 = 6.0, I2 = 2.2.
Solution:
The inputs are:

I1 = 6.0
I2 = 2.2.

The input I1 of 6.0 unit can be called either LW (Low) or M (Medium). Similarly, the
second input I2 of 2.2 unit may be declared either F R (Far) or V F R (Very Far). Fig. 8.14
shows a schematic view used to determine the membership value corresponding to the first
input I1 = 6.0.
1.0

LW
1.0 x

0.0
5 6 10
Figure 8.14: A schematic view used to determine the membership value corresponding to I1 = 6.0.

Using the principle of similar triangle, we can write the following relationship:
x 10−6
1.0 = 10−5

From the above expression, x is coming out to be equal to 0.8. Thus, the input I1 = 6.0
may be called LW with a membership value of 0.8, that is, μLW = 0.8.
Fuzzy Logic Controller 139

Similarly, the same input I1 = 6.0 may also be called M with a membership value of 0.2,
that is, μM = 0.2.
In the same way, the input I2 = 2.2 may be declared either F R with a membership value
of 0.8 (that is, μF R = 0.8) or V F R with a membership value of 0.2 (that is, μV F R = 0.2).
For the above set of inputs, the following four combinations of input variables are being
fired from a total of nine.
I1 is LW and I2 is FR,
I1 is LW and I2 is VFR,
I1 is M and I2 is FR,
I1 is M and I2 is VFR.
Now, the weights: w1 , w2 , w3 and w4 of the first, second, third and fourth combination of
fired input variables, respectively, have been calculated as follows:
w1 = μLW × μF R = 0.8 × 0.8 = 0.64
w2 = μLW × μV F R = 0.8 × 0.2 = 0.16
w3 = μM × μF R = 0.2 × 0.8 = 0.16
w4 = μM × μV F R = 0.2 × 0.2 = 0.04
The functional consequent values: y 1 , y 2 , y 3 and y 4 of the first, second, third and fourth
combination of fired input variables can be determined like the following:
y 1 = I1 + 2I2 = 6.0 + 2 × 2.2 = 10.4
y 2 = I1 + 3I2 = 6.0 + 3 × 2.2 = 12.6
y 3 = 2I1 + 2I2 = 2 × 6.0 + 2 × 2.2 = 16.4
y 4 = 2I1 + 3I2 = 2 × 6.0 + 3 × 2.2 = 18.6
Therefore, the output y of the controller can be determined as follows (refer to equation
(8.7)):

w1 y 1 + w2 y 2 + w3 y 3 + w4 y 4
y =
w1 + w2 + w3 + w4
0.64 × 10.4 + 0.16 × 12.6 + 0.16 × 16.4 + 0.04 × 18.6
=
0.64 + 0.16 + 0.16 + 0.04
= 12.04

8.2.2 Hierarchical Fuzzy Logic Controller


Let us suppose that an FLC is to be designed and developed for controlling a process having
n input variables, say I1 , I2 , . . . , In , and its input-output relationship can be expressed as
O = f (I1 , I2 , . . . , In ). Fig. 8.15 shows a schematic view of the above controller.
Let us also assume that m fuzzy sets are used to represent each variable. Thus, a set of
mn rules is to be designed to develop the FLC completely. It is important to mention that
the number of rules increases exponentially with the number of variables, which increases
computational complexity of the algorithm and difficulties associated with controlling the
140 SOFT COMPUTING:Fundamentals and Applications

I
1
I2 Fuzzy
I3 Logic O
Controller
(FLC)
In

Figure 8.15: A schematic view showing the inputs and output of an FLC.

process. The above problem of rule explosion is known as the curse of dimensionality.
Due to this reason, it becomes difficult to develop a suitable FLC for controlling a complex
real-world problem involving many variables, such as weather forecasting.
To overcome this difficulty, hierarchical FLC was developed by Raju et al. [91], in which a
higher dimensional FLC is considered to be a combination of some lower dimensional fuzzy
logic systems connected in a hierarchical fashion. Fig. 8.16 shows the schematic view of a
hierarchical FLC [87].

O
I 1
1 FLS O
I2 1 2 O
FLS 3
I 2
3 FLS
3
I
4

O O =O
n−2 n−1
FLS
I n−1
n

Figure 8.16: A schematic view of a hierarchical fuzzy logic controller.

As there are n input variables, let us consider (n − 1) fuzzy logic systems as shown in
Fig. 8.16. Two input variables (say I1 and I2 ) are fed to first Fuzzy Logic System (FLS)
and it produces an output O1 . This output O1 along with another input variable (say I3 )
are then fed to the second FLS. This process will continue until all the input variables are
utilized.
As we consider only two inputs for each of the FLSs and each variable is expressed using
m fuzzy sets, m2 rules are to be designed for each FLS. Moreover, there are (n − 1) such
FLSs. Thus, a total of (n − 1)m2 ( in place of mn ) rules are necessary to develop the
FLC completely, which clearly indicates that the number of rules of the hierarchical FLC
increases linearly with the number of input variables n.
It is important to mention that the input variables pass through different number of
Fuzzy Logic Controller 141

FLSs. For example, I1 and I2 pass through all (n − 1) FLSs, whereas In passes through
only (n − 1)-th FLS. It clearly indicates that different weights are put on different input
variables depending on their contributions towards the output of the controller. The most
important input is passed through all (n − 1) FLSs and the least important input may be
passed through (n − 1)-th FLS only. It is to be mentioned that the importance of an input
is generally determined through a sensitivity analysis, the principle of which is discussed
below.

8.2.3 Sensitivity Analysis


Sensitivity (s) of a controller is defined as the ratio of change in output to that in input,
that is,
δO
s= . (8.8)
δI
A controller is said to be linear, if it has a constant sensitivity over the entire range of the
variables.
The sensitivity of an FLC can be checked in the following ways:

1. Once the controller has been developed, we carry out an experiment, in which we
vary the input variables by different amounts, say 0.1%, 1.0%, 10.0% etc. and note
down the outputs of the controller. Using the above information, we can determine
the sensitivity of the controller using equation (8.8) [92].

2. Let us consider a simple FLC having two inputs: I1 and I2 and one output, say O.
The input-output relationship can be expressed like the following.

O = f (I1 , I2 ). (8.9)

We change the input I1 by a small amount δI1 and determine the change in output
using the Mean-Value Theorem, as follows [87]:

δO = f (I1 + δI1 , I2 ) − f (I1 , I2 ) (8.10)


∂f
= | δI1 , (8.11)
∂I1 I1 ,I2

where I1 is a point lying in the range of (I1 , I1 + δI1 ). Now, it is clear from the above
∂f
equation that if | ∂I 1
| > 1, then δO > δI1 ; otherwise, δO < δI1 . Thus, the contribution
of I1 on the output O can be determined. In the similar way, sensitivity analysis of
the second variable I2 can also be conducted.

8.2.4 Advantages and Disadvantages of Fuzzy Logic Controller


An FLC has the following advantages:

• It is a potential tool for dealing with imprecision and uncertainty.


142 SOFT COMPUTING:Fundamentals and Applications

• It does not require an extensive mathematical formulation of the problem.

• The rules are expressed in terms of IF . . . T HEN form. Thus, it becomes easier for
the user to understand the control action.

However, it suffers from the following drawbacks:

• The performance of an FLC depends mainly on its Knowledge Base (KB) and design-
ing a proper KB of an FLC is not an easy task. The designer should have a thorough
knowledge of the process to be controlled.

• The number of rules of an FLC depends on number of variables and that of the
linguistic terms used to represent each variable. Thus, computational complexity
of an FLC increases, when it is developed for controlling a process involving many
variables.

8.3 Fuzzy Clustering


Clustering is a powerful method of data mining, whose aim is to extract useful information
from a set of data. A clustering technique analyzes the pattern of the data set and groups
the data into several clusters based on similarity of the pattern. Clusters may be either
crisp or fuzzy in nature. The crisp clusters have well-defined and fixed boundaries among
themselves, whereas the fuzzy clusters are characterized by their vague boundaries. The
present chapter deals with fuzzy clustering only.
Several methods of fuzzy clustering, such as fuzzy ISODATA [93], Fuzzy C-Means
(FCM) [94], fuzzy k-nearest neighborhood algorithm [95], potential-based clus-
tering [96], entropy-based clustering [97], and others, have been proposed by various
researchers. The principles of fuzzy C-means clustering and entropy-based fuzzy clustering
are explained below, in detail.

8.3.1 Fuzzy C-Means Clustering


Fuzzy C-Means (FCM) is one of the most popular fuzzy clustering techniques, in which a
particular data of the set may be the member of several clusters with different values of
membership [94]. In this algorithm, an attempt is made to minimize dissimilarity measure
(expressed in terms of Euclidean distance) of the data points with the pre-defined clusters.
It is obvious that similarity of two data points residing in the same cluster will have a high
value and two points belonging to two different clusters will be dissimilar in nature. It is an
iterative algorithm, in which the cluster centers and membership values of the data points
with the clusters are going to be updated to minimize the dissimilarity measure.
Let us consider L-dimensional N data points represented by xi (i = 1, 2, . . . , N ) (refer to
Fig. 8.17), which are to be clustered. Each data point xi (i = 1, 2, . . . , N ) is expressed by a
vector of L values (that is, xi1 , xi2 , . . . , xiL ). Let us also assume that the above data are to
be clustered into C groups, where 2 ≤ C ≤ N and g (g > 1) is a weighting factor indicating
Fuzzy Clustering 143

L − dimensional space

N data points

Figure 8.17: L-dimensional hyperspace containing N data points.

the level of cluster fuzziness. Let us represent the membership matrix by [μ] and it has the
dimension of N × C. Thus, the membership value of i-th data point with j-th cluster is
represented by μij . It is to be noted that μij lies in the range of (0.0, 1.0) and it follows the
condition given below.

C
μij = 1.0 (8.12)
j=1

As the Euclidean distance is considered for dissimilarity measure, the objective function of
the optimization problem can be written as follows:

C 
N
F (μ, C) = μgij d2ij , (8.13)
j=1 i=1

where dij is the Euclidean distance between i-th point and j-th cluster, that is calculated
like the following: dij = ||cj − xi ||. Now, to accommodate the constraints given in equation
(8.12), the above objective function can be re-written as follows:

C 
N 
N 
C
F (μ, C, λ1 , . . . , λN ) = μgij d2ij + λi ( μij − 1.0), (8.14)
j=1 i=1 i=1 j=1

where λi , i = 1, 2, . . . , N , represent the Lagrange multipliers. After differentiating F with


respect to its arguments, putting them equal to zero and solving, we get the following
relationships for the center of cluster j (CCj ) and membership values (μij ):
N g
i=1 μij xi
CCj = N g , (8.15)
i=1 μij
144 SOFT COMPUTING:Fundamentals and Applications

1
μij =  2 . (8.16)
C dij g−1
m=1 ( dim )

It is to be noted that the cluster centers and membership values can be updated using the
above equations (8.15) and (8.16).
The FCM algorithm consists of the following steps:

• Step 1: Assume the number of clusters to be made, that is, C, where 2 ≤ C ≤ N .

• Step 2: Choose an appropriate level of cluster fuzziness g > 1.

• Step 3: Initialize the N × C sized membership matrix [μ] at random, such that

μij ∈ [0.0, 1.0] and Cj=1 μij = 1.0, for each i.

• Step 4: Calculate k-th dimension of j-th cluster center CCjk using the expression
given below. N g
i=1 μij xik
CCjk = N g . (8.17)
i=1 μij

• Step 5: Calculate the Euclidean distance between i-th data point and j-th cluster
center like the following:
dij = (CCj − xi ). (8.18)

• Step 6: Update fuzzy membership matrix [μ] according to dij . If dij >0, then

1
μij =  2 . (8.19)
C dij g−1
m=1 ( dim )

If dij = 0, then the data point coincides with j-th cluster center CCj and it will have
the full membership value, that is, μij = 1.0.

• Step 7: Repeat from Step 4 to Step 6 until the changes in [μ] turn out to be less than
some pre-specified values.

Using this algorithm, fuzzy clusters of the data set will be generated. The boundaries of
the clusters may be such, that there will be some overlapping of two or more clusters. It is
important to mention that the performance of the algorithm depends on initial membership
values selected at random.

A Numerical Example:
Table 8.2 contains the coordinates of ten points lying on a free-form surface shown in
Fig. 8.18. Carry out clustering using the fuzzy C-means algorithm. Assume g = 1.25 and
termination criterion  = 0.01.
Fuzzy Clustering 145

Table 8.2: Ten points lying on a free-form surface

Points X-coordinate Y-coordinate Z-coordinate


1 0.2 0.4 0.6
2 0.4 0.3 0.8
3 0.8 0.2 0.5
4 0.9 0.5 0.4
5 0.6 0.6 0.6
6 0.3 0.4 0.5
7 0.7 0.6 0.5
8 0.2 0.5 0.3
9 0.3 0.6 0.8
10 0.8 0.3 0.1

Solution:
Number of data points to be clustered N = 10
Dimensions of the data L = 3
Level of cluster fuzziness g = 1.25
Let us assume that the number of clusters to be made C = 2. Let us also suppose that
a membership matrix [μ] of size 10 × 2 is generated at random, as given below.
⎡ ⎤
0.680551 0.319449
⎢ 0.495150 0.504850 ⎥
⎢ ⎥
⎢ 0.821897 0.178103 ⎥
⎢ ⎥
⎢ ⎥
⎢ 0.303795 0.696205 ⎥
⎢ ⎥
⎢ 0.333966 0.666034 ⎥
[μ] = ⎢



⎢ 0.431538 0.568462 ⎥
⎢ ⎥
⎢ 0.415384 0.584616 ⎥
⎢ ⎥
⎢ 0.509643 0.490357 ⎥
⎢ ⎥
⎣ 0.469850 0.530150 ⎦
0.189164 0.810836

Now, the first dimension of first cluster center CC11 is determined like the following:
N g
i=1 μi1 xi1
CC11 = N g
i=1 μi1
A
= ,
B

where A = 0.6805511.25 × 0.2 + 0.4951501.25 × 0.4 + 0.8218971.25 × 0.8 + 0.3037951.25 × 0.9 +


0.3339661.25 ×0.6+0.4315381.25 ×0.3+0.4153841.25 ×0.7+0.5096431.25 ×0.2+0.4698501.25 ×
0.3 + 0.1891641.25 × 0.8 = 1.912120,
B = 0.6805511.25 + 0.4951501.25 + 0.8218971.25 + 0.3037951.25 + 0.3339661.25 + 0.4315381.25 +
146 SOFT COMPUTING:Fundamentals and Applications

Z X
Y

Figure 8.18: A free-form surface.

0.4153841.25 + 0.5096431.25 + 0.4698501.25 + 0.1891641.25 = 3.923066.


Therefore, CC11 = 0.487404.
Similarly, we determine CC12 = 0.412837, CC13 = 0.543316, CC21 = 0.554860, CC22 =
0.459073 and CC23 = 0.477262.
Thus, the coordinates of two cluster centers are found to be as follows:

c1 : (0.487404, 0.412837, 0.543316)


c2 : (0.554860, 0.459073, 0.477262)

We determine the modified values of membership grades like the following:

1
μ11 = d
2 ,
1+( d11 ) g−1
12


d11 = (0.487404 − 0.2)2 + (0.412837 − 0.4)2 + (0.543316 − 0.6)2 = 0.293221526,
where 
d12 = (0.55486 − 0.2)2 + (0.459073 − 0.4)2 + (0.477262 − 0.6)2 = 0.380105056.
1
Therefore, μ11 = d11 8 = 0.888564, corresponding to g = 1.25. The values of other
1+( d )
12
elements of [μ] can be calculated in the same way and these are found to be as follows:
Fuzzy Clustering 147

⎡ ⎤
0.888564 0.111436
⎢ 0.909207 0.090793 ⎥
⎢ ⎥
⎢ 0.376533 0.623467 ⎥
⎢ ⎥
⎢ ⎥
⎢ 0.142926 0.857074 ⎥
⎢ ⎥
⎢ 0.217307 0.782693 ⎥
[μ] = ⎢



⎢ 0.922229 0.077771 ⎥
⎢ ⎥
⎢ 0.060962 0.939038 ⎥
⎢ ⎥
⎢ 0.562085 0.437915 ⎥
⎢ ⎥
⎣ 0.788303 0.211697 ⎦
0.232446 0.767554
It completes one iteration of the algorithm and this will continue until the termination
criterion: change in μ, that is, Δμ ≤  is reached.
After a few iterations, the cluster-centers will be obtained as follows:

c1 : (0.296189, 0.447977, 0.600323)


c2 : (0.773939, 0.425782, 0.404034)

and the values of membership grades are determined like the following:
⎡ ⎤
0.999999 0.000001
⎢ 0.997102 0.002898 ⎥
⎢ ⎥
⎢ 0.001223 0.998777 ⎥
⎢ ⎥
⎢ ⎥
⎢ 0.000008 0.999992 ⎥
⎢ ⎥
⎢ 0.351332 0.648668 ⎥
[μ] = ⎢



⎢ 0.999992 0.000008 ⎥
⎢ ⎥
⎢ 0.002764 0.997236 ⎥
⎢ ⎥
⎢ 0.992437 0.007563 ⎥
⎢ ⎥
⎣ 0.999452 0.000548 ⎦
0.001836 0.998164
Thus, the first cluster will be composed of 1-st, 2-nd, 6-th, 8-th and 9-th data points and
the second cluster will contain 3-rd, 4-th, 5-th, 7-th and 10-th data points.

8.3.2 Entropy-based Fuzzy Clustering


Here, entropy (probability) values of the data points are determined based on a similarity
measure [97]. The similarity of two data points depends on the distance (say Euclidean
distance) between them. The data point with the minimum entropy value is selected as
the cluster center. The data points having similarity with this cluster center more than a
pre-specified value will form a cluster. It is based on the philosophy that the data points
having high similarity with the cluster center should belong to the same cluster with a high
probability. This algorithm has been explained below, in detail.
Let us consider a set of N data points in an L − D hyperspace (refer to Figure 8.17). The
following steps are used to determine entropy of each point:
148 SOFT COMPUTING:Fundamentals and Applications

• Arrange the data set in N rows and L columns.


• Calculate the Euclidean distances between the points i and j as follows:

 L

dij =  (xik − xjk )2 . (8.20)
k=1

It is to be noted that N 2 distances are possible among N data points. It is also


interesting to note that out of N 2 distances, N C2 distances belong to dij and dji each
and there are N diagonal elements of the distance matrix. As dij is equal to dji and
the diagonal elements of distance matrix are turning out to be equal to zero, it is
required to calculate N C2 distances (dij ) only.
• Determine the similarity Sij between two data points (i and j) using the expression
given below.
Sij = e−αdij , (8.21)
where α is a constant to be determined as follows: We assume a similarity Sij of
0.5, when the distance between two data points dij becomes equal to mean distance
 j<i,j=i
of all pairs of data points, that is, dij = d, where d = N 1C2 Ni=1 j=1 dij =
1 N N
NC
2 i=1 j>i dij .
From equation (8.21), we can write

0.5 = e−αd

Taking log (ln) on both sides, we get


ln 2
α= . (8.22)
d
It is important to note that similarity Sij varies in the range of 0.0 to 1.0.
• Calculate the entropy of all N data points separately as follows: Entropy of a data
point with respect to another data point is determined using the expression given
below.
E = −S log2 S − (1 − S) log2 (1 − S). (8.23)
From equation (8.23), it can be observed that entropy E becomes equal to 0.0, for a
value of S = 0 and S = 1.0. Moreover, entropy E takes the maximum value of 1.0
and it occurs, when S becomes equal to 0.5. Thus, the entropy of a point with respect
to another point varies between 0.0 and 1.0.
• Determine total entropy value at a data point xi with respect to all other data points
using the expression given below.
j=i

Ei = − (Sij log2 Sij + (1 − Sij ) log2 (1 − Sij )) (8.24)
j∈x
Fuzzy Clustering 149

During clustering, the point having the minimum total entropy may be selected as the
cluster center.

Clustering Algorithm:
Let us suppose that [T ] is the input data set containing N points and each data point has
L dimensions. Thus, [T ] is an N × L matrix. The clustering algorithm consists of the
following steps:

• Step 1: Calculate entropy Ei for each data point xi lying in [T ].

• Step 2: Identify xi that has the minimum Ei value and select it (xi,min ) as the cluster
center.

• Step 3: Put xi,min and the data points having similarity with xi,min greater than β
(which is a threshold value of similarity) in a cluster and remove them from [T ].

• Step 4: Check if [T ] is empty. If yes, terminate the program, else go to Step 2.

In the above algorithm, entropy has been defined in such a way that a data point, which
is far away from the rest of the data, may also be selected as a cluster center. It may happen
so, because a very distant point (from the rest of the data points) may have a low value of
entropy. To overcome this, another parameter γ (in %) is introduced, which is nothing but
a threshold used to declare a cluster to be a valid one. After the clustering is over, we count
the number of data points lying in each cluster and if this number becomes greater than
or equal to γ% of total number of data points, we declare this cluster to be a valid one.
Otherwise, these data points, which are unable to form a valid cluster, will be declared as
the outliers.

A Numerical Example:
The coordinates of ten points lying on a free-form surface are found to be as shown in
Table 8.2. Carry out fuzzy clustering based on their similarity and entropy values. Assume
β = 0.5 and γ = 10%.

Solution:
We first calculate Euclidean distances between the points using equation (8.20). As there
are 10 points, a total of 10 × 10 = 100 distances are possible and they can be expressed as
a 10 × 10 matrix. It is to be noted that out of these 100 distances, there are 10 diagonal
elements (such as d00 , d11 , d22 , d33 , . . . , d99 ), whose values are equal to 0.0. Thus, there are
effectively 100 − 10 = 90 elements, whose numerical values are non-zero. As the distance
between the points i and j, that is, dij is the same with that between the points j and i,
that is, dji , a total of 10 C2 = 45 distance values are to be really calculated. Table 8.3 shows
those Euclidean distance values. The mean of the distance values, that is, d is found to be
equal to 0.518373. The value of α is determined using equation (8.22) and it is seen to be
150 SOFT COMPUTING:Fundamentals and Applications

Table 8.3: Euclidean distance and similarity values

Combination of data points Euclidean distance Similarity


0,1 0.3000000 0.669551
0,2 0.640312 0.424773
0,3 0.734847 0.374334
0,4 0.447214 0.549912
0,5 0.141421 0.827701
0,6 0.547723 0.480757
0,7 0.316228 0.655179
0,8 0.300000 0.669551
0,9 0.787401 0.348931
1,2 0.509902 0.505695
1,3 0.670820 0.407793
1,4 0.412311 0.576186
1,5 0.331662 0.641795
1,6 0.519615 0.499170
1,7 0.574456 0.463875
1,8 0.316228 0.655179
1,9 0.806226 0.340257
2,3 0.331662 0.641795
2,4 0.458258 0.541851
2,5 0.538516 0.486712
2,6 0.412311 0.576186
2,7 0.700000 0.392189
2,8 0.707107 0.388479
2,9 0.412311 0.576186
3,4 0.374166 0.606337
3,5 0.616441 0.438550
3,6 0.244949 0.720697
3,7 0.707107 0.388479
3,8 0.728011 0.377771
3,9 0.374166 0.606337
4,5 0.374166 0.606337
4,6 0.141421 0.827701
4,7 0.509902 0.505695
4,8 0.360555 0.617473
4,9 0.616441 0.438550
5,6 0.447214 0.549912
5,7 0.244949 0.720697
5,8 0.360555 0.617473
5,9 0.648074 0.420387
6,7 0.547723 0.480757
6,8 0.500000 0.512436
6,9 0.509902 0.505695
7,8 0.519615 0.499170
7,9 0.663325 0.411901
8,9 0.911043 0.295759
Fuzzy Clustering 151

equal to 1.337160. The similarity values are also calculated using equation (8.21) and those
are also shown in Table 8.3. The entropy values of the data points are then calculated using
equation (8.24) and those are found to be like the following:
E0 = 8.285456, E1 = 8.665640,
E2 = 8.815512, E3 = 8.568537,
E4 = 8.516900, E5 = 8.348550,
E6 = 8.490743, E7 = 8.686420,
E8 = 8.560217, E9 = 8.632634.
It is observed from the above values of entropy that 0-th point has the least entropy and
thus, it is declared to be the first cluster center. Now, corresponding to a threshold value
of similarity β = 0.5, 1-st, 4-th, 5-th, 7-th and 8-th points are found to make cluster with
the 0-th point. The remaining points are as follows: 2-nd, 3-rd, 6-th, 9-th. Out of these
four points, the 6-th point is seen to have the least value of entropy. Thus, it is declared
as the center of second cluster. For β = 0.5, 2-nd, 3-rd and 9-th points are found to make
cluster with the 6-th point. As all ten points have been clustered (the first cluster contains
six point and the second cluster consists of four points), the number of outliers is found to
be equal to zero.

Comparison of Fuzzy C-Means Algorithm and Entropy-Based Fuzzy Clustering


Algorithm [98]:
In entropy-based fuzzy clustering algorithm, the number of clusters, number of outliers,
quality of the clusters (determined in terms of compactness and distinctness) are dependent
on the threshold value of similarity. On the other hand, in fuzzy C-means algorithm,
the quality of clusters may depend on the initial matrix of membership values selected
at random. It is interesting to note that entropy-based fuzzy clustering algorithm is very
sensitive to the threshold value of similarity and thus, it is more flexible compared to
the fuzzy C-means algorithm. It is also to be noted that compactness and distinctness
of the clusters are decided based on the intra-cluster and inter-cluster distances of the
elements, respectively. In general, entropy-based fuzzy clustering algorithm is able to yield
less compact but more distinct clusters (if the parameters are set properly) compared to
those obtained by the fuzzy C-means algorithm. However, the performances of clustering
algorithms are found to be data-dependent.
Note: To perform clustering of the large spatial data set, some special types of clustering
algorithms were proposed. Ng and Han [99] suggested a crisp clustering algorithm for the
large data sets utilizing the concept of k representative objects (known as medoids). The
medoids were determined from the data set, so that the sum of dissimilarities within a
cluster became the minimum. The algorithm tried to find a new set of k medoids lying
in the neighborhood of the current set of the same. This algorithm is popularly known
as CLARANS (Clustering Large Applications based on RANdomized Search). Ester et
al. [100] developed a density-based clustering algorithm called DBSCAN (Density-Based
Spatial Clustering of Applications with Noise) for the large data sets. A cluster can be
152 SOFT COMPUTING:Fundamentals and Applications

easily identified, as its density of points is higher than that of the outside. The density of
noise-region is generally less than that of a cluster. A cluster is declared to be a valid one,
if each point of it has a minimum number of neighborhood points. It is to be noted that
DBSCAN could outperform CLARANS algorithm in terms of its ability to form clusters of
arbitrary shapes.

8.4 Summary
This chapter has been summarized as follows:

1. Fuzzy set theory has been used in a number of ways. Out of all such applications, the
present chapter concentrates on two of them, namely fuzzy reasoning and clustering.

2. Fuzzy logic controller is a potential tool for dealing with imprecision and uncertainty.
Two of the most popular forms of fuzzy logic controller, such as Mamdani Approach
and Takagi & Sugeno’s Approach, have been explained in this chapter. Mamdani
Approach is characterized by its high interpretability and low accuracy, whereas the
aim of Takagi & Sugeno’s Approach is to obtain a high accuracy, which may be possible
to achieve at the cost of interpretability.

3. The number of rules of an FLC increases exponentially with the number of variables,
which increases computational complexity of the algorithm. Due to this problem of
rule explosion, a conventional FLC is unable to solve complex real-world problems
involving a large number of variables. To overcome this difficulty, the concept of
hierarchical FLC has been introduced, in which the number of rules is reduced signif-
icantly.

4. Clustering is a powerful tool for data mining. The clusters may be either crisp (having
well-defined and fixed boundaries) or fuzzy (having vague boundaries) in nature. This
chapter deals with the fuzzy clusters only.

5. The principles of fuzzy C-means algorithm and entropy-based fuzzy clustering algo-
rithms have been explained, in detail. Entropy-based fuzzy clustering algorithm is
more flexible compared to the fuzzy C-means algorithm. The performances of clus-
tering algorithms are seen to be data-dependent.

8.5 Exercise
1. Explain briefly the principle of Mamdani Approach of fuzzy logic controller. State its
advantages and disadvantages.

2. Discuss briefly various methods of defuzzification.

3. Explain the prinicple of Takagi and Sugeno’s Approach of FLC.


Exercise 153

4. When and why do we go for hierarchical FLC ?


5. What do you mean by fuzzy clustering ?
6. Explain the principles of fuzzy C-means algorithm and entropy-based fuzzy clustering
algorithm.
7. There are two inputs (I1 and I2 ) and one output (O) of a process. It is required
to develop a fuzzy logic-based expert system based on Mamdani Approach. Let us
assume that the inputs and output are expressed using three linguistic terms, namely
Low (LW ), Medium (M ) and High (H). The membership function distributions of
the above inputs and output are shown in Fig. 8.19. The rule base of the fuzzy logic

LW M H LW M H LW M H
1.0 1.0 1.0

μ μ μ

0.0 0.0 0.0


1 2 3 10 20 30 5 10 15

I I O
1 2

Figure 8.19: Data Base of the fuzzy logic controller.

Table 8.4: Rule Base of the fuzzy logic controller

I2
LW M H
LW LW LW M
I1 M LW M H
H M H H

controller is shown in Table 8.4. Determine the output of the controller for a set of
inputs: I1 = 1.6, I2 = 22.0. Use the following methods of defuzzification: (i) Center
of sums method, (ii) Centroid method, (iii) Mean of maxima method.
8. An expert system based on Takagi and Sugeno’s approach of FLC is to be developed
to predict the output of a process. The membership function distributions of the
input and output variables are shown in Fig. 8.20. As there are two inputs: I1 and
I2 , and each input is represented using three linguistic terms (such as, LW , M , H),
there is a maximum of 3 × 3 = 9 feasible rules. The output of i-th rule, that is, y i
(i = 1, 2, . . . , 9) is expressed as follows:

y i = f (I1 , I2 ) = aij I1 + bik I2 ,

You might also like