Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q. Implement the branch-and-bound algorithm for the Partial Digest Problem (PDP) using your favoriate programming language (e.g., C, C++, Java or Python). Test your program

image text in transcribed

Q. Implement the branch-and-bound algorithm for the Partial Digest Problem (PDP) using your favoriate programming language (e.g., C, C++, Java or Python). Test your program on the following three datasets. Here, each number in parentheses indicates the multiplicity of the preceding number. L1 = {1(9), 2(8), 3(7), 4(6), 5(5), 6(4), 7(3), 8(2), 9(1)}. L2 = {1(1), 2(1), 3(2), 4(1), 5(2), 6(1), 7(1), 9(2), 10(1), 12(1), 14(1), 15(1)}. L3 = {1(16), 2(15), 3(14), 4(13), 5(12), 6(11), 7(10), 8(9), 9(8), 10(9), 11(8), 12(7), 13(6), 14(5), 15(4), 16(3), 17(2), 18(1)}. To simpify your output, please print only the number of distinct solutions for each dataset (symmetric solutions are considered as the same) and up to three actual distinct solutions (in any order).

PARTIALDIGEST(L) 1 width = Maximum element in L 2 DELETE(width, L) 3 X = {0, width} 4 PLACE(L, X) + PLACE(L, X) 1 if L is empty 2 output X 3 return 4 y Maximum element in L 5 if Aly, X) CL 6 Add y to X and remove lengths Aly, X) from L y 7 PLACE(L, X) 8 Remove y from X and add lengths Aly, X) to L 9 if Alwidth y, X) CL 10 Add width y to X and remove lengths A(width y, X) from L X , 11 PLACE(L, X) 12 Remove width y from X and add lengths A(width y, X) to L 13 return

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago

Question

Write a short note on rancidity and corrosiveness.

Answered: 1 week ago

Question

=+what information would you need about the compact disc industry?

Answered: 1 week ago