Report results for at least two different values of k. Include relevant excerpts of commented Python code to implement the solution. Table 1: Example of results summary (numbers are not realistic) Algorithm Iterations # Items Selected Weight Objective Local Search (Best Improvement) Local Search with Random Restarts (k = 100) Local Search with Random walk (p = 0.25) 3102 9510 49 97 117 121 21 147 2102 87 32 184 etc. Knapsack Problem Definition Given n different items, where each item i has an assigned value (v¿) and weight (w), select a combination of the items to maximize the total value without exceeding the weight limitations, W, of the knapsack. IMPORTANT!: When generating random problem instance set you must use the code provided and values: n = - 150; max weight of 2500; and, use a seed value (for the random number generator) of 51132023. 1
Report results for at least two different values of k. Include relevant excerpts of commented Python code to implement the solution. Table 1: Example of results summary (numbers are not realistic) Algorithm Iterations # Items Selected Weight Objective Local Search (Best Improvement) Local Search with Random Restarts (k = 100) Local Search with Random walk (p = 0.25) 3102 9510 49 97 117 121 21 147 2102 87 32 184 etc. Knapsack Problem Definition Given n different items, where each item i has an assigned value (v¿) and weight (w), select a combination of the items to maximize the total value without exceeding the weight limitations, W, of the knapsack. IMPORTANT!: When generating random problem instance set you must use the code provided and values: n = - 150; max weight of 2500; and, use a seed value (for the random number generator) of 51132023. 1
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question

Transcribed Image Text:Report results for at least two different values of k.
Include relevant excerpts of commented Python code to implement the solution.

Transcribed Image Text:Table 1: Example of results summary (numbers are not realistic)
Algorithm
Iterations # Items Selected Weight
Objective
Local Search (Best Improvement)
Local Search with Random Restarts (k = 100)
Local Search with Random walk (p = 0.25)
3102
9510
49
97
117
121
21
147
2102
87
32
184
etc.
Knapsack Problem Definition Given n different items, where each item i has an assigned value (v¿) and
weight (w), select a combination of the items to maximize the total value without exceeding the weight
limitations, W, of the knapsack.
IMPORTANT!: When generating random problem instance set you must use the code provided and values:
n = - 150; max weight of 2500; and, use a seed value (for the random number generator) of 51132023.
1
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education