Homework Assignment 10


Assignment

  1. (50 points) A graph G is bipartite if its vertices can be partitioned into two sets X and Y such that every edge in G has one end vertex in X and the other in Y. Design and analyze an efficient algorithm for determining if an undirected graph G is bipartite (without knowing the sets X and Y in advance).
    1. Provide and explain pseudocode
    2. Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
    3. Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.
  2. (50 points) An Euler tour of a directed graph G with n vertices and m edges is a cycle that traverses each edge of G exactly once according to its direction. Such a tour always exists if G is connected and the in-degree equals the out-degree of each vertex in G. Describe and analyze an O(n + m)-time algorithm for finding an Euler tour of such a directed graph G.
    1. Provide and explain pseudocode
    2. Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
    3. Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.
  3. Bonus. (10 points) An independent set of an undirected graph G = (V, E) is a subset I of V such that no two vertices in I are adjacent. That is, if u and v are in I, then (u, v) is not in E. A maximal independent set M is an independent set such that, if we were to add any additional vertex to M, then it would not be independent any more. Every graph has a maximal independent set. (Can you see this? This question is not part of the exercise, but it is worth thinking about.) Give and analyze an efficient algorithm that computes a maximal independent set for a graph G.
    1. Provide and explain pseudocode
    2. Statement and proof of time complexity. Be clear of the assumptions on the ADT implementations.
    3. Statement and proof of memory complexity. Be clear of the assumptions on the ADT implementations.


General Instructions, Turning in assignments, and Grading

General Instructions

Turn in Instructions

Each assignment will be turned in in class (hard copy). Assignments are due BEFORE, let me repeat, before class starts. This does not mean one minute after class starts. Details:

Grading