Analytics 2

Job ID: 33542234

Budget: $30 – $250 USD

Knapsack: Given n different items, where each item i has an assigned value (vi) and weight (wi), select a combination of the items to maximize the total value without exceeding the weight limitations, W, of the knapsack.

Using the Python code base provided as a starting point to implement a genetic algorithm to solve the knapsack problem. Please address the following by including the associated Python code excerpts (as appropriate) and explanation of the code in the PDF file:
? createChromosome() logic
? crossover() logic
? Logic to compute chromosome fitness, e.g., any modifications to the evaluate() function ? rouletteWheel() logic
? mutate() logic
? insert() logic
Apply the technique to the random problem instance and determine the best solution and objective value using your revised algorithm.
Related categories: Python Analytics NumPy Pandas