Graph HW4

A vertex cover is a subset of vertices to that every edge contains at least one vertex from the cover.

Minimal Vertex Cover

In this problem we are going to work with the vertex cover for a tree only. You should not consider graphs that are not trees - in general it is very hard to find a “good” vertex cover for a graph.

We will work on three variations of vertex cover for a tree.

  1. Minimum size
  2. Minimum weight, where weight(v) = degree of the vertex v.
  3. Minimum weight, where weight(v) is any positive number associated with the cost of including a vertex in your cover.

Examples

The first thing to do is make up examples. If you can, write them in a form you could turn in.

Code

Plan first! You should not try to hack this out. Figure out an efficient way to find at least one of the three vertex cover variations listed using the examples you wrote. After you have something you think works, then code it.