Beruflich Dokumente
Kultur Dokumente
varied the crossover and mutation probabilities depending on A. Individual Item Monitoring
the difference between average and best fitness in population Each item present has its own weight and profit. For an
to maintain the diversity in the population. Mauldin [6] item to be included in Knapsack, we judge the goodness of
maintained a minimum Hamming distance between any each item on the basis of profit (maximum profit) or weight
offspring and all existing chromosomes in the population in (minimum weight) or profit per unit weight (maximum profit
order to maintain diversity. Jalali and Lee [7] introduced a per unit weight) as per Greedy algorithm.
new sexual selection technique. They divided the population
into male and females. Females were selected using While all three approaches generate feasible solutions,
tournament selection and males were selected based on we cannot guarantee that which one of them will always
hamming distance, active gene or fitness value avoiding generate the optimal solution. All the above three methods
premature convergence. Jalali and Lee [8] used fuzzy logic has certain drawback. It may happen that profit of an item is
controller in the selection of the crossover operator and its high but weight of that item is very high, so we cannot
probability. consider that item to be good item. Similarly, if the weight of
an item is low but profit is very low then also we cannot
Syswerda [9] had mentioned that greater the number of consider that item to be good. Generally profit per unit
crossover point, the more beneficial it is. De Jong and Spears weight (pi /wi) gives a good solution.
[10] in their study had compared different kind of crossover
and mutation operators. Jassadapakorn and Chongstitvatana If we have two items having the same (pi /wi) ratio but
[11] used hamming distance to maintain population different contribution to profit, then for us item having more
diversity. Chu and Beaseley [12] used repair operator based profit contribution will be valuable. So we need to choose an
on greedy algorithm to obtain feasible solution. According to item on the basis of (pi /wi) ratio along with their profit
Chou [13] better solution is obtained if crossover probability contribution. Thus, we have proposed a new technique to
of 1.0 is used along with uniform crossover. value an item on the basis of Titem i , where
E. Diverse Selection
Diversity in the population is very important for
convergence to the global optimal solution. In order to
maintain the diversity in the population a new selection
technique, Diverse Selection is proposed. Diverse Selection
is based on the genotype of the chromosome and Hamming
Distance between two chromosomes is used.
1) Hamming Distance(HD):-Hamming Distance is
defined as the number of bits at which two chromosomes are
different. Let Ci = {ci1, ci2, . . , ciN } and Cj ={cj1, cj2, . . , cjN }
be two chromosomes, N= Length of the chromosome, then
Fig. 1 Set of Linguistic terms associated with Titem i
Hamming Distance between Ci and Cj is defined as [8].
B. Problem Representation N
N-bit binary string to represent a solution where N is the HD (Ci,Cj) = ∑diff(cik,cjk) (5)
total number of items has been used. k=1
C. Initial Population where diff(cik,cjk) = 0, if cik = cjk
Initial population is generated by random population diff(cik,cjk) = 1, if cik ≠ cjk
generation. The size of the population is fixed in each
generation. Here, Dn is similar to the technique proposed by Jalali and
D. Classification of Chromosome Lee [7]
A new technique to classify a chromosome into Good, Dn = HD(Ci,Cj) /Total Length of the String(N) (6)
Bad and Average based on the contribution towards profit of where 0 <= Dn <= 1
each fuzzy set has been proposed.
Algorithm for Classification of Chromosome:
2) Algorithm for Diverse Selection
Let
Sum_profit_Low = sum of profit of all Low items present in Step 1: Sequentially search for the first unselected
the chromosome; chromosome from the population
Step 2: Find the value of Dn with other chromosomes
Sum_profit_Med = sum of profit of all Medium items in the population sequentially until we find a chromosome
present in chromosome whose value of Dn >= 0.5
Sum_profit_High = sum of profit of all High items present Step 3: If no chromosome is found with Dn >= 0.5,
in the chromosome; then we select a chromosome with maximum value of Dn .
Category[i] = array of character containing ‘G’, ‘B’, ‘A’ Step 4: If the selected chromosome in step 1 is Bad
which represents category Good, Bad, Average for each and chromosome selected using step 2 or step 3 is also Bad,
solution i in the population where i ϵ I then we reject that chromosome, we continue our search for
suitable chromosome using step 2 and 3.
Population= Total number of chromosome in the population Step 5: If using step 4, no Good or Average
1. for i=1 to Population chromosome is found, Bad chromosome is selected with
maximum Dn
2. if ( Sum_profit_Low > Sum_profit_Med) and (
Sum_profit_Low > Sum_profit_High) then
Step 4 ensures that crossover between two Bad
3. Category[i]= ‘L’; chromosomes is minimum as it decreases probability of
giving an optimal solution. Diverse Selection helps in
4. elseif(Sum_profit_High> Sum_profit_Med) and
maintaining the diversity of the population which in terms
(Sum_profit_High > Sum_profit_Low) then
helps in finding solution faster and better.
5. Category[i]= ‘H’;
6. else 3) Algorithm for Random Selection
7. Category[i] = ‘A’
In Random Selection, we randomly select both the parents
8. end for from the population and do the cross over among them. We
So we can say single point crossover gives a relaxed bound //ADD phase
for a crossover between Good and Bad chromosome.
9. while Total_wt < C ,do
Similarly we can say for crossover between Good and
Average chromosome and Average and Bad chromosome. So 10. for c1=N to 1 do
we always have single point crossover between chromosome 11. if (chromosome[i][c1] ==0) and Total_wt +
of different category. Wi ≤ C then
According to Syswerda [9], Chou [13] more diverse
12. Set chromosome[i][c1] to 1
population is generated in case of uniform crossover. So we
do uniform crossover between the chromosome of the same 13. Set Total_wt to Total_wt+ Wi
category i.e between Good-Good, Average-Average and
14. End if
Bad-Bad.
15. End for
G. Mutation
According to Arid Hoff [3] the best choice for mutation 16. End while
is flip mutation with the probability of 1/N, where N is the
total number of item. So the same is used. DROP phase helps in attaining a feasible solution out of the
H. Repair Operator infeasible one and ADD phase improves the fitness of the
chromosome. Thus the entire chromosome becomes feasible
After crossover and mutation we find that some of the
and improved with the help of above algorithm.
offspring generated may over flow the Knapsack Capacity.
So in order to make it feasible we discard some of the items IV. EXPERIMENTS AND ANALYSIS
from the chromosome based on the value of Titem i (DROP
phase). Then we keep on adding items in the chromosome In our algorithm, Faster Genetic Algorithm we have
based on the value of Titem i (ADD phase) until it is feasible. considered crossover probability Pc = 1 and mutation
probability P m = 1/N, where N is the total number of items.
Chu and Beaseley [12] used genetic algorithm along with No. of generation = 100.
a repair operator to solve Multidimensional Knapsack
Problem. To convert infeasible solution to feasible, Chu and We are comparing our algorithm with Standard Genetic
Beaseley used repair operator based on simple greedy Algorithm (SGA) [1] [14], Greedy Algorithm (GA) [14],
algorithm. Our repair operator is similar to that of Chu and Greedy Genetic Algorithm (GGA) [14], Adoptive Genetic
Beasely but we have used Titem i. Here, all the items are Algorithm (AGA) [6] [15] and Modified Hybrid Adaptive
arranged in the ascending order of Titem i inorder to perform Genetic Algorithm (MHAGA) [15]. The data sets given
the Repair operation. below have been used extensively to solve 0-1 Knapsack
Problem.
Algorithm for Repair Operator:
Here,
Let: N=Total number of items
C =Knapsack Capacity C=Knapsack Capacity
Total_wt= Total weight of selected items W=Weight of N items
N=total number of items V=Value of N items
th
chromosome[i]=i number solution for Knapsack Data set 1 [14]:
th
Wi= weight of i item N = 10, C = 269,
//DROP phase W={95, 4, 60, 32, 23, 72, 80, 62, 65, 46}
1. While Total_wt > C V={55, 10, 47, 5,4, 50, 8, 61, 85,87}
2. for c1=1 to N do Data set 2 [14][15][16]:
3. if chromosome[i][c1] equals 1 then N = 20, C = 878
4. Set chromosome[i][c1] to 0 W={44, 46, 90, 72, 91, 40, 75, 35, 8, 54, 78, 40, 77, 15, 61,
17, 75, 29, 75, 63}
5. Set Total_wt to Total_wt-Wi
V={92, 4, 43, 83, 84, 68, 92, 82, 6, 44, 32, 18, 56, 83, 25, 96,
6. End if 70, 48, 14, 58}
7. End for
8. End while
1) Comparative study between Faster Genetic Algorithm In GGA, crossover-mutation operator and an improved
(FzGA) and Standard Genetic Algorithm (SGA) [14] [1] selection operator is used. Greedy algorithm is used for
data set 1and 2. infeasible solution [14].
TABLE I: RESULTS FOR SGA AND FzGA TABLE IV: RESULTS FOR GGA AND FzGA
Algorithm Best result for Effective Generation Algorithm Best result for Effective Generation
data set 1 data set 1
SGA 295 37 GGA 295 5
FzGA 295 1 FzGA 295 1
Algorithm Best result for Effective Generation Analysis for data set 1:
data set 2
SGA 1037 100
Chromosome 0111000111 gives the optimal result of 295
FzGA 1042 25 Knapsack capacity: 269
For data set 2: FzGA attained better solution and also faster Best fitness achieved in the generation: 1
convergence than that of SGA. SGA attained the result as Analysis for data set 2:
1037 in 100th generation where as FzGA attained 1042 as
optimal solution in the 25th generation. Chromosome 10111111010111111101 gives the optimal
result of 1042
Thus from the above comparison it is concluded that FzGA
is superior to that of SGA. Knapsack capacity: 878
2) Comparative study between Faster Genetic Algorithm Best fitness achieved in the generation: 25
(FzGA) with Adaptive Genetic Algorithm (AGA) [6][15]
and Modified Hybrid Adaptive Genetic
Algorithm(MHAGA) [15] for data set 2.
In AGA, to maintain the diversity in the population,
crossover and mutation probabilities are are changed based
upon the difference between average and best fitness in
population [6].
In MHAGA, AGA is further improved with the use of
diversity guided mutation and greedy transform algorithm to
repair infeasible solution [15].
TABLE III: RESULTS FOR AGA, MHAGA AND FzGA
Algorithm Best result for data set 2
AGA 1027 Fig. 4. Fitness v/s Generation for data set 1 for FzGA
MHAGA 1037
FzGA 1042