Suppose we have n people of which we want to pick a subset to form…Suppose we have n people of which we want to pick a subset to form a team. Every person has a non-negative value that they bring to the team, and value of that team is simply the sum of values of those in the subset. However, to complicate things, some people do not get along with some other players, and two people who cannot get along cannot be in the same team. Suppose that conflicts are represented as an undirected graph G whose vertex set is the n people, and an edge ij represents that I and j doesn’t get along. The goal now is to choose a subset of people that maximizes the total value without having any conflicts.a) Why does greedy algorithm doesn’t work in this case? give a counter-example.b) Suppose the graph G is a tree (i.e. connected graph with no cycles). Give an algorithm that finds the optimal subset. This algorithm must run in time polynomial in n. (Hint: recursive formulation given the rooted tree, and use dynamic programming)Engineering & TechnologyComputer ScienceCS 3000

Order your essay today and save 20% with the discount code ESSAYHELP