Ask Data Structure Expert

Let G = (V,E) be an undirected graph with nnodes. Recall that a subset of the nodes is called an independentset if no 2 of them are joined by an edge. Finding largeindependent sets is difficult in general; but here we'll seethat it can be done efficiently if the graph is"simple" enough.

              Call a graph G=(V,E) a path if its nodes can be written as v1, v2,..., vn, with an edge between vi and vjif and only if the numbers i and j differ by exactly 1. With eachnode vi, we associate a positive integer weightwi.

               Consider for example the five-node path drawn below. The weightsare the numbers drawn inside the nodes, and the total weight is14.

 

30_Independent Set On A Path.jpg

 

 The goal in this question is to solve the following problem: Findan independent set in a path G whose total weight is as large aspossible.

For the exercises(a) and (b), give your counterexample. For the exercise (c), showthe optimal structure (with an explanation), give the bottom-updynamic programming algorithm, and show the running-timeanalysis.

a) Give an example to show that the followingalgorithm does not always find an independent set of maximum totalweight.

               The "heaviest-first" greedy algorithm

           Start with S equal to the empty set

           While some node remains in G

                 Pick a node vi of maximum weight

                 Add vi to S

                 Delete vi and its neighbors from G

           Endwhile

           Return S

b) Give an example to show that the following algorithm alsodoes not always find an independent set of maximum totalweight.

               Let S1 be the set of all vi where i is an odd number

      Let S2 be the set of allvi where i is an even number

      (Note that S1 and S2 are bothindependent sets)

Determine which of S1 or S2 hasgreater total weight, and return this one

c) Give an algorithm that takes an n-node path G with weightsand returns an independent set of maximum total weight. The runningtime should be polynomial in n, independent of the values of theweights

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M9454943

Have any Question?


Related Questions in Data Structure

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As