subject
Engineering, 17.04.2020 23:57 maleah12x

A natural attempt of a greedy algorithm for this problem is to take the vertex with the largest weight, then delete that vertex’s neighbors (because they cannot also be in an independent set). Repeat this process until there are no more vertices which can be included. Give a counterexample which shows that this algorithm may not give an optimal solution.(b) Let a[i] denote the weight of a maximum-weight independent set when only considering the first i vertices of the path. Give the values a[1], a[2], a[3], and a[4] for the example given above.(c) Define a recursive definition of a[i]. Don’t forget the base case.(d) Give a bottom-up dynamic programming algorithm based off your recursive definition. What is the running time of your algorithm?

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 19:20
Aseries piping system conveys methyl alcohol. the system consists of 70 m of 1- nominal pipe follow by 50 m of 2-nominal pipe, both schedule 40 commercial steel. the 1-nominal pipe contains 3 90° elbows (regular) anda fully open gate valve, all threaded. the pressure drop through the system is 150 kpa. determine the volume flow rate through the system that is horizontally laid.
Answers: 1
question
Engineering, 06.07.2019 03:10
Oxygen at 300 kpa and 400 k is in a closed system with an initial volume of 0.1 m3. is now compressed in a polytropic process, with exponent of n 1.2, to a temperature of 500 k. calculate: a) the boundary work done during the compression, in kj b) the heat transfer during the compression, in kj
Answers: 3
question
Engineering, 06.07.2019 03:20
Asimply supported beam abc of length l has ab of length hl and second moment of area / and bc of length hl and second moment of area i2. determine the strain energy stored in the beam when it is subject to a vertical load f at its midpoint and the consequential central deflection.
Answers: 2
question
Engineering, 06.07.2019 04:10
Aheat pump that operates on the ideal vapor compression cycle with refrigerant-134a is used to heat water from 15°c to 45°c at a rate of 0.12 kg/s. the condenser and evaporator pressures are 1.4 and 0.32 mpa, respectively determine: (a) the power input to the heat pump
Answers: 1
You know the right answer?
A natural attempt of a greedy algorithm for this problem is to take the vertex with the largest weig...
Questions
Questions on the website: 13722362