GAGP Tutorial 1 --------------- The knapsack problem is as follows: given a set of weights W, and a target weight T, find a subset of W whose sum is as close to T as possible. Example: W = {5, 8, 10, 23, 27, 31, 37, 41} T = 82 1. Solve the instance of the knapsack problem given above. 2. Consider solving the knapsack problem using the canonical GA. How can a solution be encoded as a chromosome? 3. What fitness function can be used for the knapsack problem, so that better solutions have higher fitness? 4. Given your answer to question 2, what selection methods would be appropriate? 5. Assume you have a lot of data points that seem to fall into clusters, e.g. the 2D position of mushrooms in a forest. Instead of applying the K-means algorithm directly, you decide to use GA to get the centre positions of the clusters. How might you use a canonical GA to solve this, and what are the problems you might run into, particularly regarding the representation?