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

Inheritance Operator

The document discusses various crossover techniques in genetic algorithms, including single-site, multi-point, uniform, and matrix crossover methods. It explains how these techniques combine genetic information from parent strings to produce offspring, emphasizing the importance of selecting appropriate crossover sites for optimal results. Additionally, it touches on mutation operators and their role in introducing variability in the genetic algorithm process.

Uploaded by

Divyanshu jain
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)
19 views

Inheritance Operator

The document discusses various crossover techniques in genetic algorithms, including single-site, multi-point, uniform, and matrix crossover methods. It explains how these techniques combine genetic information from parent strings to produce offspring, emphasizing the importance of selecting appropriate crossover sites for optimal results. Additionally, it touches on mutation operators and their role in introducing variability in the genetic algorithm process.

Uploaded by

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

254 Neural Netuvrks.

Fuzzy Logu, and icneti Algvrithnms lless Aple


9.2 CROSS oVER utionn

ne reprduction phase is over, the ppulation is enriched with bet.


u c t i o n makes chones o good stuings, but does not ercale new ones, CrONs e ndivdua
Pplied t the mating o l with a hope that it would ereale a better string. 'The
a t r is to seareh the parameter space. In addition, scarch IS to be mnde
t n storrd in the present string is mnanimally preserved becnuse these arentay t
he crn
instanes o gnd strings selected during reproduetion. in thrce
C orer is a recombination operator, which procecds steps. Jirst .

rahr selats at random a pair of two individual strings tor mating, then a cros.
at random along the string length and the position values arc swapped betwen. site is select
en
tollowing the cross-site. For instance, let the two selected Strings in u muting pair ected
wo srin
be A
and B = 00000. If the random selection of a cross-site is two, then the nev
new strings follow
over would be A* = l1000 and B* = 00111. This is a single-site cross over. T h g C
operators ook very simple. their combined action is responsible for much of GA' gh the
computer implementation point of view, they involve only random number of pener
copying. and partial string swapping. There exist many types of cross over operationsi rations, Mring
sections. in genetie
algornthm which are discussed in the following

9.2.1 Single-site Cross Over


In a single-site cross over, a cross-site is selected randomly
along the length of the mated
and bits next to the cross-sites are exchanged as shown in
better children can be obtajned by combining
Fig. 9.1. If an appropriate
site is cho strings
good substances of parents. Since the knowleda
the appropriate site is not known and it is
selected
randomly, random selection of Croso. of
this
may produce enhanced children if the selected -sites
the string quality. site appropriate. If not, it may severely hamne
is
Anyway, because of the crossing of
parents better children are produced nper
that will continue in the next and
generation also. But if good strings are not created
they will not survive beyondnext generation because by cross Over.
for the next mating pool. reproduction will not select those
strinos
ngs
Cross site
Parent-11 (0) 0O

Parent-2 O O
Strings before mating
Child-1 O OO

Child-2

Strings after mating


Fig. 9.1
Single-site cross over.
Cross Ovor
o nC r o s s

Molel omg
n n anom ites are
yNalhM,
n two mated parent
thnen and
the ctuas site the cntenta hrker
are cehangod as shown is
in Fig 9 theee an kettel hp
Cross-site 1
Crosssito 2
Parent-11

Pent-2 OOOoo
Strings before mating
Chad- OOO0o@
Cid-2 0O
Strings after mating
Fig. 9.2 Two-point cross over.

Multi-point Cross Over

point cross over, again there are two cases. One is even number of cross-sites and
e is the odd number of cross-sites. In case of even numbered cros-sites, the string is
n i n g with no beginning or end. The crOss-sites are selected around thecircle uniformly
mo.Now the information between alternate pairs of sites is interchanged as shown in
the number of cross-sites is odd, then a different cross-point is always assumed atthe
ginning. The information (genes) between alternate pairs is exchanged as shown
Fg94

Parent-1 Parent-2
Before crossing
Child-1
(O
After crossing
Child-2

g.9.3 Multi-point cross over with even number of cross-stE


25656 Neural Netvorks,
Fuzzy Leg netie Algonthma-Syntliests
and
Applicalions
Cross-site 3
Cross-site 1 Cross-aite 2
Parent1
Parent-2
Child-1
- Chilld-2

with odd
number of cross-sites
c r o s s over
ig. 9.4 Multi-point

9.2.4 Uniform Cross Over


over operator. In a unifornm
An ettreme of multi-point is the uniform cross
cross over
with a probability of 0.5 and then intOs Ove
perator, each bit from either parent is selected
cross over is radically
different from one. interchanged as
Over. Sometimes gene in the offspring is created by copying the corresponding genene-point.
Fig. 9.5(a). II is seen that uniform
shown in
frCrOgs
the other parent chosen according to a randomly generated cross over mask. When the
from one o
there
the mask. the gene is copied from the first parent and when there is 0, the gene isexchanged
coni into
second parent as shown in Fig. 9.5(b). The process is repeated with the parents evch rOm
produce the second offspring. A new cross over mask is randomly generated for each
pai
parents. Offspring therefore contains a mixture of genes from each parent. The number of efeO
CTOSsing points is not fixed but averages to L2 (where L is chromosome length).

Parent-

Parent-2

Before crossing

(0 Child-1

Child-2

Interchange Interchange
Interchange
Fig. 9.5(a)
Uniform cross
over.
Cross over mask
1 00
Parent-1 1

Parent-2 OO OO O0 0
Parent-1

Fig. 9.5(b) Unifom


cross over
using mask.
5 Matrix Cross Over
(Two-dimensional Cross Over)
-lly. the strings are represented as a single
case. two strings of
dimensional array as shown in Fig. 9.6. In the
length 4 are concatenated to form an individual. So, the cross-sites
ed for this case are
obviously single-dimensional whereas in the case of two-dimensional
over. "each individual is represented as a two-dimensional
array of vector to facilitate the
s. The process of two-dimensional cross over is
depicted in Fig. 9.7.

String-1 1 0 1 1 10 0 1
String-2 0 1 0 1 1 1 10
Substring-1 Substring--2

Fig. 9.6 Single-dimensional strings.

Parent-2
Parent-1
Before crossing
ynssa at.lpplt.a
258 Ninarai Neten y nd wh

Child-2

A t e r crossing

over.
cross
Matrix
9.7
Fig.
is
then the string is
d.
divided
are
chosen,
nto utme
and column nd colu
and column-wise, wil
Fk
ates akvng
Two
row

cross-sites,
both row-

Two c r o s s - s i t e c
decide eac
th row
r t a n g u l a r regons. regions.
ng rectangular
and vertical
ms a l
utmt
nine overlapping
individual into
cach
three layers horizontally
vertically. Select
the inform
donde and then exchange
ams
wr
wal or horizontally n in tha
either vertically o v e r operators is mad
layer, The selection ofcross
the searchthatis
cah
g the mated
populations.
terween
single-point
croSs over operator, r, the
proper.
Is
In case
of a and children. Some no
a genets space
informationis preserved
between parents Some studies have
hut marimum
According to Deb (1995). it it ic
is 995), difficult
eae

cross over operator.


find an optimal
selection. So, it is left to personal interest tto
madr to
e

generalar the
optimal cross over operator nterest select the
s oVT operator

926 Cross Over Rate

a GA lterature. the term cross over rate is usually denoted as Pa the probability of cross ver
The probabuliaty varies from 0 to 1. This is calculated in GA by finding out the ratio of the numbr
pars to be crossed to some fixed population. Typically for a population size of 30 to 200,
s Ovcr frales are ranged from 0.5 to l.
We have seen that with random
cross-sites, the children strings produced
mbenatson of good substrings from parent strings may not have a
alls un the ppropriate place. But we do not depending on whether or not the crossing site
worry about this too much because if good strings
t
ccaled by cross over, there will be more
epr duction operator. But if good
e

copies of them in the next mating


t

strings are not


pool generated by
long because created by cross over,
reproduction will select they will not surVE
discussion that the effect against those strings in
clear from
this

hus. in order to preserve some of of cross over may either subsequent


generations. It s

stnngs in the mating good strings that are be detrimental or eficial


already present in the mating Dcio
When a cross pool
are used in
over
cross over.
POOl notall
are usea in
the cross over
of probability
is used only Pc
operation
current population. Even and
100(1- Pc) 100Pc percent strings
trings in
in the
no populatd
though the best percentage the population
of p asit
100(1- P)% of the rema
current popua
pulation can
Ncrminis all the new
ainlv respnuble t ulatum.
he e ari
h nf
this t
uaily
Aufnudslim
new
atting refevvet ranelmat
A
NVERSION AND DELETION
Inversion

trwm the Ppuiaton sIs


selected and the
bits betwecn two randurn sitcs are inverted as

Bits between
sites inverted
Fig. 9.8 Inversion.

Lnear+end-inversion

sear-end-inversion pertorms linear inversion with a specified probability of 0.75. If linear


ersion was not performed, the end inversion would be performed with equal probability of
15 at either the left or right end of the string. Under end inversion., the left or right end of the
and a second inversion-point was picked uniformly at
ing was picked as one inversion-point
Linear+end-inversion
random from the point no farther away than one half of the string length.
mnamizes the tendency of linear inversion
to disrupt bits located near the centre of the string
near the ends.
Casproportionately to those bits located

Continuous inversion
inversion probability P, to each new

conlinuous inversion, inversion was applied with specified


iDdividual when it is created.

Mass inversion one-half of the


is created and thereafter,
until a new population
ersion takes place two inverting points).
(using the
same
inversion
Paonundergoes identical

.3.2 Deletion and Duplication


previous bits are duplicated and it
selected and
the

three bits at random


in order are
IS
or
shown in Fig. 9.9.
eural Netur
gpleostm
( ) ( )(o aBefura detoti

e( () OO (o) Al atetion
() Duplicaton

Deletion and duplication.


Fig. 99

9.3.3 Deletion and Regeneration


randomiy as shown in Fig.
N* ween two
cTOAS- AIteS are deleted and regenerated 9.10
o

Deletion

0 Regeneration
Fig. 9.10 Deletion and regeneration.

9.3.4 Segregation

The bits of the parents are


segregated and then crossed over to
produce offspring shown in
Fig 911 as

Parent-1
Parent-2
Before

Child-1
Child-2
After
Fig. 9.11 Segregation.
i anuto Madlmg 26

ysS Cross O
r o s s
Over and Inversion
and inversun atr
wath
the combinathon of boxh ross vver
n are enchanged between

m nites are chosen, the contents bracketted by


these sites if
For enample,
nts annt. the end oints of these eachanged contents
switch place s
operatin
i n v e r s i o n

and
Mrents shshown in Hig 912 are 2 and 7. the cross over
t h en
aay
shown in Fig. 9.12
nthe

Parent-1
Before cross over

and inversion

Parent-2

After cross over

and
cross over
After
inversion

inversion.
over and
9.12 Cross
Fig.

9.4 MUTATION OPERATOR

9.4.1 Mutation bit involves flipping it,


Mutation of a
mutation. mutation is
to The bit-wise
re subjected probability P
After cross over, the strings are mutation coin witha
a small lipping a
probability of Pm
versa
with
Changing 0 to I and vice coin with
a
a
by flipping than P then
c d bit-by-bitsimulated number is smaller
as
follows. random
probabi
NDIlily of Pn is at random. Ifthe at any bit, the outcome is
0 to I is chosen outcome is false. If
number between otherwise the
flioning is true,
come of coin
26
262 Neural Netuorks,
huay eg
HEV eg, and enels Algorithmayihei nd Applicai
Tue then the bit
pplications
ueendently mutei, that is, the mutation of a bit does unehanged.
not aect theThe
isaltered, otherwise the bit is kept of bits
probability o iring
other bits A sumple geneth algorithm treats the utation nly s of Te
ole of kal genetn materials Suppse, for example, all thesCcondary
sMrings in oper ator
reshwing kat gene
neyod a zC at a gven psition and the optimal soluton has one at hpulationhe
an egenerate a one at that position while a mutation could POli
loss of genctic material, Thene mua he
/ rane oley against the ireversible so ne oflon o
trdues new genetic structures in the population by tandomly modifying
al minima's traps since its yeraten
Nats t helps the seanrh
aug genetic the r build
e l a t e d to any previous
efritcture of the population.
structure of populaion. It creates d
creates different A
The mutation is also used to maTCg
of the search space.
esentng other sections
the ppulation For example, consider the following population having four eipht iveri
0110 1011 strings.
0011 1101

0001 0110
0111 1100

Notice that all four strings have a zero in the leftmost bit position. If
the
solutuon requires a onein that position, then neither_ reproductic tion nor trueoptimum
described above will be able.to create.one in that position. The inclusion of over ope cross
some probability (Npm) of turning zero
mutation inisoperator
to one as
0110 1011
0011 1101
0001 0110
1111 1100
Mutation for real numbers can be done as

Before (1.38 -69.4 326.44


0.1)
After (1.38 -67.5 326.44
0.1)
Hence, mutation causes movement in the search
information to the space (local
population. or
global) and restores los

9.4.2 Mutation
Rate Pm
Mulation rate is the
muled. The probability of mutation which is
mutation operator used to to be
important for the search. preserves the diversity_
Mutation among the
calculate-umoe also very
conclude that mutation
is
population W
probabilities are smaller in natural e s
adoption. Typically, appropriately considered secondary
the simple a populations
mutation rates
varying from 0.001genetic algorithm uses the
mechanism oL
mechanism of genetic alwith thehe
to 200 ith
to 0.5. population size or
MSE OPERATORS

ATISE
aot mmwr estenuvely in the veding mec hanisy tr gererte algu.eidhos
t real variales tw nary atringa and genetic
the
ing erateors weh
the ..
ni u v genetie algrthn program a written in
" anguag
. shs in " (the bitWiC operators), we an directly manipulate the
n s y v Yahv
vd o memry These operators can be carie nat casuly and efficiently
,
and characters but not on floats and doubles Byron S fned
wrators into threc, namely, 1. The one's corplement uperator
t w i C y * r a t o r

y w Nyrator, d 3. The shilt operator.


and

ne's Complement Operator

that causes the bits of its operand to be


is an unary operator
nerator() becomes 1. This operator always precedes
becomes zero and zero
that I
wersed, so tha

four-bit strings each


8.1, where two
variables 6, 6, are

example
problem
the
total string length is eight.
hence,
the
nd

1 24° 16
4
0100 0001
a
1110-> 11 14 66
66° 84
84°
-a
= 1011

Bit-wise
Operators
1 Logical Bit-wise
Exclusive-OR, and
Bit-wise AND, 2.
namely, 1.
bit-wise operators,
logical instead of
hree
can be used
and hence,
Sse OR. operands The truth
two integer-type bit by bit basis.
require on
operators are compared
Ach
of these two operands, they
ET operating upon
While

is shown in Table 9.1.


etu
wise AND (&) operator 1,
otherwise ltCu
a
value
have
if both the bits
expression
returns I
(&)
-> 10
10
1010 1010
Parent la =

3
1100 0011
> 12
Parent 2b =

8 2
0010-
1000
Child a&b =
Neunal Netuvris. Fuzzy log1. and enel Algonthms-Synthesis anl Applatios
Z
Table 9.1 Tuth table

OR
Ecusivec OR
AND operator
' A operator
orator a lb
Ab
ah

0
0

Bit-wise exclusive-OR () operator of the bits have a value of .


returns a l if one he
A Dut-wise cxclusive-OR (A) expression value 0.
it returns a
otherwise
other has a value of 0
.1010 1010 > 10 10
Parent la =

12 3
Parent 2b = 1100 0011 >

1001 > 69
Child a&b = 0110

Bit-wise OR () operator
one or more bits
have a value of I otherwise it ret
returns a I if
A bit-wise OR () expression
a value 0. 10 10
Parent la = 1010 1010 >

Parent 2b = 1100 0011 > 12 3

Child a&b = 1110 1011 1 3 11


The three bit-wise operators are summarized in Table 9.1.1n this Table, A and B represent
the corresponding bits within the first and second operands respectively..

9.5.3 Shift Operators

Two bit-wise shift operators are, shift left (<<) and shift right (>>) operators. Each operator
perates on a single variable but requires two operands. The first operand is an integer type
operand that represents the bit pattern to be shifted and the second is an unsigned integer that
indicates the number of displacements (i.e. whether the bits in the first operand will be shifted by
bit
t pOSition, 2
with the word size
position and so on). This value cannot exceed the number of bits associacs
of the first operand.
Shift left operator (<)
ne Shitt lett operator causes all the bits in the first operand to be shifted to thne i
number of positions indicated by the second operand. The leftmost bits (i.e. the overflow bits)with
theoriginal bit pattern is lost. The rightmost bit positions that become vacant auc filled wil
Zeroes.

a =
1010 0110 10 6
a<<2 =
1001 1000 9 8
Aabutian
t
g h t o p e r a t o r (>>)
r i g n t o p e r

NTat a u s all the yle n the (rot e r ed he thfrel the righe he


t
ns indn atevd by the oe omd
ywr e The right mevet bta fie the unelerflew
hiti
a t t e r n arr hut 1he len e ot eitena that here rne ant ara then filied

r s s in whwh a given bit pattern is transformed into another bt pattern by mean


of the operands in the bit wise
OYeration
IsC
The onginal bit pattern is one
that brings aheut
The soond opeand called mask, is a specially selected bit pattern

portuon of a given
r a n s f o r m a t i o n

difterent kinds of masking operations. For cxample, a


several
h r r are *veral

new word is filled with 0


copied to a newword, while the remainder of the
he
an
bit pattern will be "masked off"
from the final result.
e of the original
Aart

OPERATORS USED IN GA
BIT-WISE on two
combinations. Each operator operates
in different
ncal bit-w1se operators are-used the number ofindividuals in the population
one resultant so
as to keep
and generates
nduals
are used in GA process. bit-wise AND and
bit-wise
operators
ant Two different for mating and on
each pair
selected randomly exclusive-OR operations
Populations are exclusive-OR or OR and
AND and
are performed. Similarly, for the next generation.
OR cperators children or population
performed to produce
ate

8.7 GENERATIONAL CYCLE


four (Pl = 4)
with a population of
algorithm the
cycle of the genetic assume
values
generational functions which can
Taie 92 shows a objective "divide
each. In this example,
the The fitness
function performs
ngs with 10 bits the decimal place. strings thus
number of Is in 0 to 1. The four
10. the the range of should
g to give normalize the objective function in selection scheme
o p e r a t i o n to the proportional offspring
and 0.9. Ideally, selection to be
values of 0.3, 0.6,
0.6, values for
1.5(0.9/0.6) Darwinian
itess
1.0(0.6/0.6),
1.0(0.6/0.6), and However, according
to

ate 0.5(0.3/0.6), 0.6) to the strings. the weakest


0.6 + 0.9)/4 have two copies,
+ 0.6 + individual will with fitness
flaverage) (0.3
=

the strongest Hence, the string


theory
fl
of survival of the fittest,
i n d i v i d u a l s will
have one copy
each.
others I copy.
In Table 9.2,
the
ndividual des,
dies, and
and average and randomly for
Pl of 0.5 will have 0 copy with 1.5 has two copies the four strings are paired c r o s s o v e r
value Next, At a
set of strings. other pair.
forms the 1
Population P2 represer this selected
one pair,
and 2 and
3
o v e r point
falls between
CTOss over. I and 4 forms
Strings and 3 is left intact.
The cross
2
probability rate of
dle of 0.5, only the pair
between I
and 5 are
swapped.
P4 on the
sixth bit of
and 5 and hence, of the strings s e e n in
population effective
Ence, portion population
P3 can be
have muted representing
an

action of mutatio ation on out of 40


two bits
andttne of string 4. Only
first bit
266 Neural Netuorks, Fuzzv Legic, and CGenetie Algornthnsiynthes and
Applications
mutation probability 0.05. Population P4 represents the next generation. In effect, PI;
rate of
are the
populations while P2 and P3 represent the intereiate slages in the
generational cye
The parameters, rate, and
mutation rate, and crOss
cro* over rate Yle
namely population size,
1amely the population size, n alorithm
and must be
i e e d to as the control panameters of the simple genetic g specifiethe
ified
its execution.
We
beine
must
genetic nlgorithm, a specify
oTo terminate the execution of simple
number of generations, arter
a string withPpin,
string with a cernai
criterion.lt could be terminated after a fixed s in the populations
the pOpulations
have attained
nave
" ntness value is located or after all the strings
have identical
bits at most
a
poSitions). deyree
g e n e i t y (a large number of strings
genetic algorithm
Table 9.2 A generational cycle of the simple

Population Pl
S Fitness SIfav) Copy
String 0.5 0
O0000 11100 0.3
0.6 1.0 1
10000 11111
0.6 1.0 1
01101 01011
0.9 1.5 2
11111 11011

Population P2 after reproduction

String S= Fitness Cross over CS1 Cs2


10000 11111 0.6
01101 010il 0.6
11111 11011 0.9
11111 11011 0.9 1 5

Population P3 after cross over

String f Fitness
11111 11111 1.0
01101 01011 0.6
11111 11011 0.9
10000 11011 0.5

Population P4 after mutation

String f= Fitness
01111 11111 0.9
01101 11011 0.7
11111 11011 0.9
10000 11011 0.5
xample Problem
Cnetic
Modeldelling 267

You might also like