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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:30
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
question
Computers and Technology, 22.06.2019 19:20
Write a program that reads a file consisting of students’ test scores in the range 0–200. it should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. output the score ranges and the number of students. (run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157, 189.)
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
Match the file formats with the types of multimedia they can store
Answers: 2
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