Question: please help me with the part c and d at the last picture 1. Let G=(V.E) be an undirected graph with n nodes. Recall that


1. Let G=(V.E) be an undirected graph with n nodes. Recall that a subset of the nodes is called an independent set if no two of them are joined by an edge. Finding large independent sets is difficult in general; but here we'll see that 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 v. 02...., . with an edge between w, and y, if and only if the numbers i and differ by exactly 1. With each node w, we associate a positive integer weight w. Consider, for example, the five-node path drawn in Figure 6.28. The weights are the numbers drawn inside the nodes. The goal in this question is to solve the following problem: Find an independent set in a path G whose total weight is as large as possible. (c) Give an algorithm that takes an n-node path with weights and returns an independent set of maximum total weight. The running time should be polynomial in n, independent of the values of the weights. (c) Create a recurrence for part (c) of problem 6.1. For now, only worry about returning the weight of the independent set of maximum total weight. Do not forget about the base cases. This problem may be difficult to do until after the Monday (2/24) lecture. To Latex users: to help in writing the recurrence, I included around this point in the .tex file (commented out) the Latex code that I used to create the recurrence for coin changing. This uses the ansnath package, which is included in the preamble of the tex file. (d) Using your recurrence for part (c), write pseudocode that uses the top-down approach without memoization to determine the value of the independent set of maximum total weight in an 1-node path G with weights. One suggestion for the signature of your function is FindMaxveight in, w), where IV is an array/list of the n weights. You must use zero-based indexing, 1. Let G=(V.E) be an undirected graph with n nodes. Recall that a subset of the nodes is called an independent set if no two of them are joined by an edge. Finding large independent sets is difficult in general; but here we'll see that 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 v. 02...., . with an edge between w, and y, if and only if the numbers i and differ by exactly 1. With each node w, we associate a positive integer weight w. Consider, for example, the five-node path drawn in Figure 6.28. The weights are the numbers drawn inside the nodes. The goal in this question is to solve the following problem: Find an independent set in a path G whose total weight is as large as possible. (c) Give an algorithm that takes an n-node path with weights and returns an independent set of maximum total weight. The running time should be polynomial in n, independent of the values of the weights. (c) Create a recurrence for part (c) of problem 6.1. For now, only worry about returning the weight of the independent set of maximum total weight. Do not forget about the base cases. This problem may be difficult to do until after the Monday (2/24) lecture. To Latex users: to help in writing the recurrence, I included around this point in the .tex file (commented out) the Latex code that I used to create the recurrence for coin changing. This uses the ansnath package, which is included in the preamble of the tex file. (d) Using your recurrence for part (c), write pseudocode that uses the top-down approach without memoization to determine the value of the independent set of maximum total weight in an 1-node path G with weights. One suggestion for the signature of your function is FindMaxveight in, w), where IV is an array/list of the n weights. You must use zero-based indexing
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
