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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started