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

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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