give an algorithm that takes an n-node path g 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.