Graph Theory & Algorithms October 6, 2005 Roll No. Set Cover: Given a set of subsets S of the Universal Set U, what is the smallest subset T of S such that the union of all these sub sets in T covers all elements of U. Vertex Cover: The Universal set U is the set of all edges in a graph. What is the smallest subset of vertices of the graph that covers all edges? Independent Set: What is the largest subset S of vertices of a graph such that no pair of vertices in S has an edge in between? Is there a connection between the vertex cover and the independent set problem? Matching: A sub-graph of G, where the maximum degree of each vertex is one, i.e. no edge has a common end point. These edges are also known as independent edges. Maximal Matching: This is a matching in which more edges cannot be added to increase the size of this matching. Find a simple algorithm to find a maximal matching in a graph. Assume that we have found the maximal matching in a graph, how can you find the vertex cover of the graph using the information obtained from maximal matching? Will that be an optimal vertex cover? Discuss. Edge Cover: The Universal set is the set of all vertices in a graph. What is the smallest subset of edges, which covers all vertices? How small (or high big) the size of the edge cover can become as compared to the number of vertices in a graph? Maximum Matching: This is a matching in a graph with as many edges as possible? How bad a maximal matching can become as compared to maximum matching? Maximum Matching and Perfect Matching in a Bipartite Graph: What is a perfect matching in a bipartite graph? Perfect Matching and Edge Cover: We have found a perfect matching in a bipartite graph (how about a general graph). How can we find the edge cover? Will that be an optimal edge cover? Maximum Matching & Edge Cover: Given a maximum matching in a graph how can we find the edge cover? Maximum Matching and Vertex Cover: The size of the maximum matching in a graph is equal to the optimal (minimum size) of the vertex cover in a bipartite graph? Given the maximum matching how will we find the corresponding vertex cover? Union of Matching: M1 M2. If there is a path between two vertices in the union then the edges will be alternating. Cycles will be of even length, simply because the graph is bipartite. Paths can be of even length (in which the number of edges contributed by both the matching will be equal) or odd, where one of the matching will have one edge more. With respect to the other matching, the odd path will be from a free vertex to a free vertex. It is easy to see that only odd paths can increase the size of matching. If there is a matching in which there is an alternating path from a free vertex to a free vertex, then that matching is not maximum. Can we use this idea to find the maximum matching? Berge’s Theorem: M is maximum matching if and only if there doesn’t exist an alternating path (from a free vertex to a free vertex) with respect to M. Proof: Given M, suppose that there is an alternating path, this means that the size of matching in M can be improved, which is a contradiction. M is not maximum there is some alternating path since M is not maximum, then there will be some other matching Mmax which is maximum. M Mmax will have an alternating path. Maximal Matching VS Maximum Matching Let M be a maximal matching, and Mmax be the maximum matching. It is easy to see that each edge in M can, at most, block two edges of Mmax. Therefore, |M| ½|Mmax| M is called k-optimal if no alternating path of length 2k – 1, with respect to M. If the matching is 1-optimal then there is no augmenting path of length 1. As the maximum length of augmenting path can be n-1, therefore the maximum optimality is n/2 Start with an empty matching. It is 0-optimal. Then find any maximal matching. This is 1-optimal. Now start augmenting paths. M: empty matching While( an augmenting path) { Find a maximal set of augmenting path of given length. Augment (M) } But how many times do we have to do this? At most n/2 times. Fact 1: After each iteration at least one edge is added is added to the matching. Let’s look at M after n iterations. Fact: If M is k-optimal matching |M| If M is n optimal then |M| |Mmax| - |M| |Mmax| - n n n 1 |Mmax| = k |Mmax| k 1 |Mmax| 1 |Mmax| 1 n = n n n n edges missing, and fact 1 This means that after tells us that each iteration give us at least one edge, so we require another n iterations, at most. n 1 n 1 n iterations there will be atmost |Mmax| =