Give an algorithm that takes an n-node path g with weights

Assignment Help Data Structure & Algorithms
Reference no: EM13164825

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

Reference no: EM13164825

Questions Cloud

What was the wavelength of the second photon emitted : What was the wavelength of the second photon emitted?
How many moles of oxygen gas was evolved : KCL,KCLO3, and MnO2 having a total wight of 23.584 was jeated tp decompose the KCLO3. After heating, the mass was found to be 22.347g. how many moles of oxygen gas was evolved.
A mobile app has to dynamically select an encryption : A mobile app has to dynamically select an encryption algorithm based on security requirements and computing time constraints.
How much solid sodium sulfate should you add : You need to make an aqueous solution of 0.180 M sodium sulfate for an experiment in lab, using a 250 mL volumetric flask. How much solid sodium sulfate should you add ?
Give an algorithm that takes an n-node path g with weights : 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
Find the heat of solution for lithium iodide : Lithium iodide has a lattice energy of -7.3 times 10^2kJmol and a heat of hydration of -793kj/mol. Find the heat of solution for lithium iodide.
Write a program in which the user is prompted : Write a program in which the user is prompted for the number of values that they will be entering. The user then enters that number of integers into an array
Write a balanced chemical equation for the decomposition : Write a balanced chemical equation for the decomposition of limestone, CaCO3, to quicklime, CaO, and carbon dioxide.
What is the new water level after of silver metal : A graduated cylinder contains 31.0 of water. What is the new water level after 38.0 of silver metal is submerged in the water?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Create a shell script to locate executable files

Create a shell script to locate executable documents? The script takes a list of document names from the command line and determines which would be executed had these names been given as commands.

  Question about branch hazard

Provide a relevant example using MIPS instruction set architecture. Discuss the similarities and differences of the code will proceed it the branch is taken, vs if the branch is not taken, and explain how this affects the pipeline.

  Characteristics of quicksort

familiarize  with the performance characteristics of Quicksort under normal and worst case conditions. The assignment will require some programming and interpretation of the results.

  Creating application - two dimensional array

Make an application that either sums or averages rows or columns of a 2-dimensional array depending on user choices.

  Inventory tracking database

Construct a relational database of your choice. The DB should contain no more than six tables. Define three business requirements that this database will provide.

  Creating an array

Determine which of the following commands is used to create an array?

  Explain solution of towers of hanoi problem

Classical Towers of Hanoi problem starts with a stack of n > = 1disks on one of three pegs. Solving problem needs moving stack from peg A to peg B in such a way which only one disc is moved at time and no disc can be placed on top of a disc smalle..

  Computing hash value for message

For a message, he computes the hash value H = (VChar 1 x VChar 2 x VChar 3 ...x VChar N) mod(26).

  Analyze the time-space complexity of algorithms

How a vEB tree can be used to support these three operations and analyze the time/space complexity of your algorithms.

  Design algorithm to receive two integer items from terminal

Design an algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient.

  Data structures used to organize typical file cabinet

Recognize at least two data structures which are used to organize typical file cabinet. Why do you feel it is essential to emulate these types of data structures in computer program?

  Create tree correspond to expression pre-order traversal

Let the algebraic expression E=(2x+y)(5a-b)^3. Create tree T which correspond to expression E and determine pre-order traversal of T.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd