A bottom up dynamic programming method is to be used to solve the subset sum problem. The problem is to find the optimal sum of weighted requests from a set of requests ? subject to a weight constraint W. The set of weighted requests ? = {?1, ?2, ?3, ?4, ?5, ?6} can be summarised as following:

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
icon
Related questions
Question
100%

A bottom up dynamic programming method is to be used to solve the subset sum problem. The problem is to find the optimal sum of weighted requests from a set of requests ? subject to a weight constraint W. The set of weighted requests ? = {?1, ?2, ?3, ?4, ?5, ?6} can be summarised as following:

SubsetSum(n, W):
Let B(0, w) = 0 for each w = {0,..., W}
for i=1 to n
for w+ 0 to W
if w< w; then
B(i, w) B(i - 1, w)
←
else
B(i, w)
max (w; + B(i-1, w - w;), B(i - 1,w))
(a) Produce a table showing the space of the problem and all of the sub
problems, and use that table to determine the optimal subset sum of
requests when the weight constraint of 13 is applied. The table should
take the form of a matrix with 7 rows (values of i in the range 0 to 6
inclusive) and 14 columns (values of w in the range 0 to 13 inclusive).
Transcribed Image Text:SubsetSum(n, W): Let B(0, w) = 0 for each w = {0,..., W} for i=1 to n for w+ 0 to W if w< w; then B(i, w) B(i - 1, w) ← else B(i, w) max (w; + B(i-1, w - w;), B(i - 1,w)) (a) Produce a table showing the space of the problem and all of the sub problems, and use that table to determine the optimal subset sum of requests when the weight constraint of 13 is applied. The table should take the form of a matrix with 7 rows (values of i in the range 0 to 6 inclusive) and 14 columns (values of w in the range 0 to 13 inclusive).
Request
α1
α2
α3
α4
α5
α6
The maximum weight constraint is 13.
w(α₁)
2
2
1
7
7
1
Transcribed Image Text:Request α1 α2 α3 α4 α5 α6 The maximum weight constraint is 13. w(α₁) 2 2 1 7 7 1
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Knapsack Problem
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education