

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ECS 122A: Algorithm Design and Analysis Handout 5 UC Davis — Charles Martel Due Wednesday, May 28, 2008, 4:00 PM
the marked box in K ¯ emper Hall, room 2131 (right side). No late homeworks will be accepted.
Much of what one learns in this course comes from trying to solve the homework problems, so work hard on them. Doing a conscientious job on the homeworks is the best preparation for the exams. We hope that you will ultimately solve the majority of the problems, but don’t be surprised if some of them stump you; some of the problems may be quite challenging.
Your solutions should be terse, correct, and legible. Understandability of the solution is as necessary as correctness. Expect to lose points if you provide a ”correct” solution with a not-so-good writeup. As with an English paper, you can’t expect to turn in a first draft: it takes refinement to describe something well. Typeset solutions are always appreciated.
If you can’t solve a problem, briefly indicate what you’ve tried and where the difficulty lies. Don’t try to pull one over on us.
If you think a problem was misgraded, please see the grader first. (The TA will be the grader for the homework).
A graph G is said to be k-colorable if its vertices can be colored with k different colors such that no two adjacent vertices share the same color.
Earlier in the course, we saw a dynamic programming algorithm for the Knapsack problem: Given n items, each with a weight wi and a value vi, and a weight bound W , what is the maximum valued set of items whose weight does not exceed W? What was the running time for this dynammic programming algorithm, and is it polynomial in the input size? Why or why not?
Given a graph G and an integer k where k is a constant, and passed as an input parameter, show a polynomial-time algorithm for the Independent Set problem.
2 ECS 122A Handout 5: Problem Set 5
For the input string: ACABAACAABAACACAABAACBA
Suppose we have a procedure D that solves the decision version of Vertex Cover (VC): given a graph G and an integer k is there a VC of size k? (note: we make no claims here as to how fast D runs, just that it works).