CSCE 221: Data Structures and Algorithms

Sections: 507, 508, 509
Fall 2015



Homework 9


Due Date: Nov. 20th (before class)


Assignment

  1. C13.2 (Pg. 657)

    Describe, in pseudo-code, an O(n + m)-time algorithm for computing all the connected components of an undirected graph G with n vertices and m edges. Justify the correctness and complexity of the algorithm.

  2. C13.6 (Pg. 658)

    Show that, if T is a BFS tree produced for a connected graph G, then, for each vertex v at level i, the path of T between s and v has i edges, and any other path of G between s and v has at least i edges. Use a formal proving method.
    Hint: Use contradiction to show your proof.

  3. C13.10 (Pg. 658)

    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 an O(n+ m)-time algorithm for finding an Euler tour of such a digraph G. Provide the pseudocode, correctness, complexity and its justification.


Bonus

    C13.11 (Pg. 659)

    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 an efficient algorithm that computes a maximal independent set for a graph G. What is this algorithm's running time? Justify your answer.


Grading Rubric

Each homework composes 2% of your final grade. Each homework will be graded out of 100 possible points. In any problem asking you to design an algorithm please also provide proper pseudocode (mathematical notation), complexity analysis (both space and time), and brief justification of complexity and correctness.

All assignments must be turned in with a signed coverpage. If no coverpage is provided, the assignment will not be graded.

If there are any discrepancies in grades please see Jory Denny during his office hours (not the TA or Grader).