Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 : Consider a rooted tree that has n vertices. A positive weight is associated with every vertex. We want to select a subset

Question 1: Consider a rooted tree that has n vertices. A positive weight is associated with every vertex. We want to select a subset of independent vertices so that the sum of weights of the selected vertices is the maximum. Note that, a set of vertices are independent if no pair of vertices in this set share an edge between them. (hint: use dynamic programming, say fy(u) and fn(u) are the maximum weight of the independent set for the subtree rooted at node u when u is selected, and not selected, respectively. Now write optimal substructure equation for both fy(u) and fn(u) using the optimal
solution of us children.)
Question 2: For the problem in Question 1, now assume that weight value of all the vertices is exactly 1.Now use a greedy algorithm to solve this problem.

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions

Question

Understand the use of visualizations as a tool in tax analytics.

Answered: 1 week ago