CS 432, Algorithms
Problem Set #4, Fall 2005


To turn in:

Turn in solutions to these problems:

  1. Either of the two greedy algorithm problems below:
  2. Problems 6 and 8 from the textbook, page 295.

Problems due: By the end of class on Tuesday, Nov. 1st. I will collect these at 4:30 pm and go over the solutions at that time. If you haven't turned in the HW by then, you can leave class early that day. We'll be reviewing for Exam 2 on that day.


Collaboration Rules for This Assignment (Same as for Previous HWs):

You may talk about the problems with other students in the course and TAs, or you can work alone. If you talk with or collaborate with other students, you must list their names at the first page of your paper. (Failure to do so violates the collaboration policy for CS432.) If you work alone, write a pledge that you worked alone without collaboration on the assignment.

If you collobarate with other students, a group of three students (and no more) may agree to turn in a group write-up of the solutions. List all group members on the paper, and pledge that all members made a reasonable contribution to working out the solutions. However, any of the group members may choose to turn in an individual write-up of the solutions. If you choose to do this, you cannot not simply copy all or part of another group member's write-up. (We will investigate this if we observe it.) You should still list your collaborators on the first page of your paper.

The goal of collaboration among students is simple. you can help each other learn. If what you do for another student simply lets them turn in the assignment without helping them learn in the process, this is not acceptable.


Greedy Algorithm Problems:

Develop a greedy algorithm for either one of these problems:
(a) Vertex cover problem -- see problem 7.8 on page 320 in the book
(b) Graph coloring problem, as follows:
A valid coloring of a graph is an assignment of a color (represented by an int value: 1, 2, ...) to each vertex such that no pair of adjacent vertices have the same color. An obvious way to give a graph a valid coloring is to assign each vertex an unique color, but often we want a valid coloring that uses the smallest number of colors. This is the optimization problem version of graph coloring, and this is the one you need to develop a greedy algorithmn for.
Thus the input is a graph G, and the output is an array color[] where color[i] is the color assigned to the ith vertex. The color[] array should try to use the smallest number of colors possible.

Note on both of these: Using the greedy approach will almost certainly not produce an optimal solution.
For 15% extra credit on this problem, you can give me an input to your problem that causes your algorithm to not produce an optimal solution.