subject

Consider the 0–1 knapsack problem, in which each item has a weight Wi and a value vi, a solution is a subset of the items with total weight at most equal to the capacity W, and the quality of any solution is the sum of the values of the selected items. i 1 2 3 4
Vi 1 4 3 5
Wi 5 4 6 3.
(a) [10 points] Please use dynamic programming to find out what is the optimal solution with W=10, and what are the corresponding selected items.
(b) [6 points] Suppose one greedy algorithm chooses items in descending sorted order by V;/Wi until there is no room for any more items, what is the solution value found by the greedy heuristic for the above 0-1 knapsack problem?

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:20, ashcormu11
Write a program called assignment3 (saved in a file assignment3.java) that computes the greatest common divisor of two given integers. one of the oldest numerical algorithms was described by the greek mathematician, euclid, in 300 b. c. it is a simple but very e↵ective algorithm that computes the greatest common divisor of two given integers. for instance, given integers 24 and 18, the greatest common divisor is 6, because 6 is the largest integer that divides evenly into both 24 and 18. we will denote the greatest common divisor of x and y as gcd(x, y). the algorithm is based on the clever idea that the gcd(x, y) = gcd(x ! y, y) if x > = y and gcd(x, y) = gcd(x, y ! x) if x < y. the algorithm consists of a series of steps (loop iterations) where the “larger” integer is replaced by the di↵erence of the larger and smaller integer. this continues until the two values are equal. that is then the gcd.
Answers: 3
image
Computers and Technology, 23.06.2019 12:00, trippie4life
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
image
Computers and Technology, 23.06.2019 14:00, savannnab1890
Select the correct answer. andre was recently hired by an organization to check for system vulnerabilities. he is supposed to exploit these vulnerabilities and create a report on the extent of damage to which the system was susceptible. what position does andre hold in this organization? a. information security analyst b. information assurance manager c. penetration tester d. network security engineer e. chief information security officer
Answers: 2
image
Computers and Technology, 24.06.2019 15:00, firdausmohammed80
Universal windows platform is designed for which windows 10 version?
Answers: 1
You know the right answer?
Consider the 0–1 knapsack problem, in which each item has a weight Wi and a value vi, a solution is...

Questions in other subjects:

Konu
Mathematics, 07.07.2019 18:00
Konu
Mathematics, 07.07.2019 18:00
Konu
Mathematics, 07.07.2019 18:00