Вы находитесь на странице: 1из 19

AVISHEK KHANNA 0806410030 ANSHUL KHARE 0806410020 ABHINAV 0806410004

y In this problem m knapsacks are given & our aim is same as

in single knapsack problem , to fill knapsacks till maximum capacity.


y Weight of i object is not constant , it has range 1<j<m. y This object has weights w[ij] when it has to be included in

one of the knapsack j out of m knapsacks.

y We have to find a vector x=(x1,x2,.................xn ) such that no

knapsack overflows: ni=1wij <= cj for all j=1 to n such that it yields maximum profit p(x)= ni=1 xi pi.

y This is also known as 0-1 linear programming problem.

y Genetic Algorithms are a family of computational models

inspired by evolution. y These algorithms encode a potential solution to a specific problem on a simple chromosome-like data structure and apply recombination operators to these structures as to preserve critical information. y An implementation of genetic algorithm begins with a population of (typically random) chromosomes. y One then evaluates these structures and allocated reproductive opportunities in such a way that these chromosomes which represent a better solution to the target problem are given more chances to `reproduce than those chromosomes which are poorer solutions. The 'goodness' of a solution is typically defined with respect to the current population.

y Coding or Representation y String with all parameters y Fitness function y Parent selection y Reproduction y Crossover y Mutation y Convergence y When to stop

y Encoding y Fitness Evaluation y Reproduction y Survivor Selection

y Reproduction operator
y Crossover y Mutation

y Crossover
y Two parents produce two offspring y There is a chance that the chromosomes of the two

parents are copied unmodified as offspring y There is a chance that the chromosomes of the two parents are randomly recombined (crossover) to form offspring y Generally the chance of crossover is between 0.6 and 1.0
y Mutation
y There is a chance that a gene of a child is changed

randomly y Generally the chance of mutation is low (e.g. 0.001)

y Crossover
y Two parents produce two offspring y There is a chance that the chromosomes of the two

parents are copied unmodified as offspring y There is a chance that the chromosomes of the two parents are randomly recombined (crossover) to form offspring y Generally the chance of crossover is between 0.6 and 1.0
y Mutation
y There is a chance that a gene of a child is changed

randomly y Generally the chance of mutation is low (e.g. 0.001)

y Single point crossover

y Two point crossover (Multi point crossover)

y Mutation
y Generating new offspring from single parent

y Maintaining the diversity of the individuals y Crossover can only explore the combinations of the current gene pool y Mutation can generate new genes

y A vector x=(x1,x2,.................xn ) that overfills at least one

knapsack is infeasible string.

y We don t discard infeasible string but include it in

population
y Although we decrease its strength by adding a penalty

term with it.


y Further the string is from feasibility, higher the penalty

term is.

y Thus adding the penalty term max{pi} , we get

following fitness function to be maximizedf(x)= ni=1 xi pi. s. max{pi} Where, y s- the number of knapsacks overfilled . y The no. of times this term is used , it reflects no. of knapsacks overfilled.

y This approach was applied to a series of problems

knap15,knap20 & so on given by Petersen , which can be accessed at Or library by Beasley . y In this problem 100 runs are to be filled in 10 knapsacks by 15,20 & so on objects respectively for knap15,knap20 problem & so on. y The value of fitness function produced by each of these objects containing runs are given . It shows that which runs are feasible to be added & which are not.

RESULTS OF PROBLEMS KNAP15,20,28,39,50 AS SOLVED BY GENETIC ALGORITHM

y In this table only some values are shown because

others produce fitness function below minimum optimal value.


y For example in knap39,some runs produce fitness

function value beneath 10,561,so values don t add up to 100.

y We can solve knapsack problem by using genetic

algorithm.
y We allow infeasible strings to participate since they

also contribute information.


y But we reduce their strength by introducing penalty

term.

Вам также может понравиться