Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Question :

Suppose we are given a "chain" of n nodes as shown below. Each node i is "neighbors" with the node to its left and the node to its right (if they exist).

An independent set of these nodes is a subset of the nodes such that no two of the chosen nodes are neighbors. In the below example, the first and fourth vertices form an independent set, but the first, third, and fourth vertices do not (because the third and fourth are neighbors). Now suppose each node has a positive weight.

We are interested in computing an independent set such that the sum of the weights of the chosen nodes are as large as possible. In the example, the optimal solution is to choose the second and fourth vertices for a weight of 30.

(15) - (20) - (7) - (10)

(a) 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?

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93128711

Have any Question?


Related Questions in Computer Engineering

Select three interfaces and consider how the teamwork

select three interfaces, and consider how the teamwork application could be redesigned for each of these types. Use your imagination. How about using a tangible interface or even a drone to help remote students collabora ...

Question suppose your il license encodes your name sex and

Question : Suppose your IL license encodes your name, sex, and birthday month/year which can be used by police officers and bouncers to determine if you are who your license says you are. What kind of encoding would this ...

Determine whether or not the following claim is true for

Determine whether or not the following claim is true for all regular expressions r 1  and r 2 . The symbol ≡ stands for equivalence regular expressions in the sense that both expressions denote the same language.  (a) (r ...

Why regulated industries should be required to follow

Why regulated industries should be required to follow security standards. Provide 2 examples of industries that would fall under this category.

Question as you are reviewing the results of your various

Question : As you are reviewing the results of your various scans, what factors do you believe you would take into consideration when determining priority? The priority would be used to determine remediation efforts. So, ...

Question suppose that new more powerful arithmetic

Question : Suppose that new, more powerful arithmetic instruction are added to the instruction set. On average, through the use of these more powerful arithmetic instructions, we can reduce the number of arithmetic instr ...

Submit a 2- to 3-page paper in which youidentify an

Submit a 2- to 3-page paper in which you: Identify an intercultural area Intercultural interaction with a person from a culture different from your own. Explain why you have selected this area. Describe your personal cul ...

Question suppose your corporate commercial website server

Question : Suppose your corporate commercial Website server is located in a demilitarized zone (DMZ) so that potential and existing customers can access it. Explain the steps you would take to secure the Web server and t ...

You have been recently promoted to it security manager your

You have been recently promoted to IT Security Manager. Your first job is to document the older hardware and software your company is currently using in the IT department. State the strengths and weaknesses with the curr ...

With respect to bus request interruptswhat must be allowed

With respect to bus request interrupts: What must be allowed to complete before the interrupts is serviced? What resources (CPU, buses, memory, etc..) is the ISR expected to use? What is the ISR typically expected to do? ...

  • 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