CSCI 2300 Lab 5, Fall 2011, 10/12/11

This lab is about graphs and algorithms. You are welcome to start working on the lab ahead of time.
  1. Using a DFS procedure to the Graph Class (Sample) and Sample Data (input) for unweighted graph. test whether a given graph is two colorable or not.
  2. Using a DFS procedure, for the given input directed graph find the topological sorted numbers. (You can still use the same Graph.cc and your dfs procedure.) You may assume that there is exactly one source vertex (that is one vertex with ind-degree 0 and that will be ths atrting vertex.)
  3. In class (10/6/2011), I mentioned about the maximum number of edges in a digraoh(directed graph) with n strongly connected components is n(n-1)/2. Your problem is to find the maximum number of edges with 2 strongly components for a directed graph with 6 vertices. (Optional problem to generalize with n vertices directed graph)