Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- Knapsack Problem by Jenny Galino 48290 views
- Knapsack by Karthik Chetla 1359 views
- 01 knapsack using backtracking by mandlapure 26380 views
- Knapsack problem by Vikas Sharma 1024 views
- Greedy Knapsack Problem - by Y Ach... by Achchuthan Yogarajah 2997 views
- Genetic Algorithm based Approach to... by International Isl... 270 views

3,262 views

2,914 views

2,914 views

Published on

No Downloads

Total views

3,262

On SlideShare

0

From Embeds

0

Number of Embeds

1

Shares

0

Downloads

144

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Genetic Algorithm (0-1 Knapsack problem ) Guided by : Prof. Kinjal Mistree GA
- 2. Content 1. What is knapsack problem? 2. Knapsack problem using GA 3. Idea behind GA 4. Implementation flow 5. Conclusion 6. References
- 3. Knapsack problem(KP) • Let, Xi – no. of copies of items i are to be placed in knapsack in such a way that, maximize ∑ BiXi for i=1..N subject to constraints ∑ ViXi ≤ W • There are Qi copies of item i available where, Qi positive integer satisfying 1 ≤ Qi ≤ ∞ and 0 ≤ Xi ≤ Qi . • If Qi is infinite ,KP is unbounded otherwise bounded. The bounded KP can be 0-1 Knapsack Problem or multiconstraint KP. • If Qi=1 for i=1,2,...N the problem is bounded 0-1 knapsack problem.
- 4. Different approach to solve 0-1KP 1. Dynamic programming 2. Backtracking 3. Branch & bound 4. Genetic algorithm
- 5. 0-1 Knapsack using GA
- 6. Implementation Flow 1.Initialize array items with data(benefit & volume) and population size 2.Randomly generate initial population 3.calculate fitness function • For each item if it is included in knapsack(bit=1) – Add volume and benefits to total benefits and total volume – If total volume > W Remove item from the knapsack & change the bit=0 else return total items with volume and benefit and stop 4.Check which chromosome having same fitness • If 80% have same fitness then stop else reproduction, cross over, mutation and go to step 3. 5.Termination Condition
- 7. Implementation of 0-1 KP Using GA • Representation of items: -2 dimension array which called Cell E.g. Item[benefit][volume] Items 0 1 2 3 • Random Initial population(N=3): 20 30 5 10 10 20 40 50 0 1 0 1 1 1 0 1 1 0 1 1
- 8. Implementation of 0-1 KP Using GA • Encoding of chromosomes: -Binary Encoding 0 1 2 3 20 30 5 10 10 20 40 50 1 0 0 1
- 9. • Fitness Function if wixi <=W then item is added in to knapsack else fitness of chromosome is zero. • Selection • Crossover -The crossover point is determined randomly by generating a n random number between 0 and num_items - 1. -Perform crossover with certain probability -crossover probability-0.90
- 10. • Mutation(Optional) -Perform mutation with 0.1234% probability • Termination condition -The population converges when either 85% of chromosomes in population have same fitness
- 11. Results Using Roulette-wheel
- 12. Termination of GA
- 13. Drawback of Roulette Wheel
- 14. Results using Rank selection
- 15. Conclusion

No public clipboards found for this slide

×
### Save the most important slides with Clipping

Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.

Be the first to comment