Question: Problem statement A person has planned for a hiking trip. He decided to pack things for his trip. He had only a backpack bag with

Problem statement

A person has planned for a hiking trip. He decided to pack things for his trip. He had only a backpack bag with a maximum capacity of 20 kg. There are different item types that are deemed desirable; these could include bottles of water, fruits, nuts, sandwiches, and so forth. He had made a priority list of the items that had to be added to the bag. Each item type has a set of two attributes, namely a weight (or volume) and a value that quantifies the level of importance associated with each unit of that type of item. Since the bag has a limited weight (or volume) capacity, the problem of interest is to figure out how to load the bag with a combination of units of the specified types of items that yields the greatest total value.

The item's weight and corresponding values are given in the following table.

Item Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Item 7 Item 8
Weight 10 6 4 8 2 7 5 1
Value 2 3 1 6 4 5 8 7

Apply a genetic algorithm to find an optimal ordering of the items which he must include in his bag. Use any appropriate selection methods and justify your design choice of chromosomes. Use a fitness coefficient calculated using the sum of item weights present in the bag. Use the below combination of hyperparameter and interpret your observations

No.of.Initial.Population = {4, 6}

Crossover Type = {Single Point, Two Point}

No.of.Mutation Points = {2, 1}

No.of.Generations = {1000, 5000}

1) Explain the PEAS (Performance measure, Environment, Actuator, Sensor.) for your agent.

2) Use both the above mentioned algorithm with different combination of the hyperparameters and implement in PYTHON.

3) Print the results of each generations and elect the best offspring at the end of the algorithm for each combination of the hyperparameters.

4) Include code in your implementation to calculate the space complexity and time complexity for the informed search and print the same. For local search interpret the significance of the hyperparameters if any applicable.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!