Turn in solutions to these problems:
Collaboration Rules for This Assignment:
You may talk about the problems with other students in the course and TAs, or you can work alone. If you talk with or collaborate with other students, you must list their names at the first page of your paper. (Failure to do so violates the collaboration policy for CS432.) If you work alone, write a pledge that you worked alone without collaboration on the assignment.
If you collobarate with other students, a group of three students (and no more) may agree to turn in a group write-up of the solutions. List all group members on the paper, and pledge that all members made a reasonable contribution to working out the solutions. However, any of the group members may choose to turn in an individual write-up of the solutions. If you choose to do this, you cannot not simply copy all or part of another group member's write-up. (We will investigate this if we observe it.) You should still list your collaborators on the first page of your paper.
The goal of collaboration among students is simple. you can help each other learn. If what you do for another student simply lets them turn in the assignment without helping them learn in the process, this is not acceptable.
Problems due: Tuesday, 10/25, by end of class (or in CS432 box)
Note: Please write out your solution to Problem 2f on a separate piece of paper. We may want to make copies
of this to keep after we grade it. Thanks.
Gr-a) Write an algorithm to find a vertex v in a directed graph G where every other node in G is reachable from v.
Gr-b) Describe how you would update the DFS implementation for an undirected graph so that it determined
if the graph was acyclic.
Gr-c) Explain why an undirected graph G cannot have any cross or descendent edges.
Gr-d) Given an undirected graph G, the eccentricity of a node v is the largest of the shortest possible
distances from v to any other node in the graph. The minimum eccentricity in the graph is the graph radius
for G. All the nodes in G that have eccentricity equal to the graph radius form a set called the graph center
of G.
Describe (using pseudo-code) an efficient algorithm to find the graph center of a graph G, and describe its complexity.
Gr-e) A bipartite graph is a graph where the vertices may be divided into two subsets such that there is
no edge between any two vertices in the same subset. Write an algorithm to determine if a graph is bipartite, and
give its worst-case complextiy.
Gr-f) For a given undirected graph G, prove that the depth of a DFS tree cannot be smaller than the depth of the BFS tree.
Gr-g) Background: The exhaustive search algorithm given in the slides will find all possible unique paths from the start node in a graph G, and can easily be modified to find Hamilton cycles (a simple cycle that visits each node). However, you know the exhaustive search tree this approach explores is very large, and you decide to use a pruning method to avoid making a choice (and thus exploring a subtree that could not lead to a valid result. Pruning is a technique where you do some extra computation before visiting a new node; this computation might tell you not to visit that node, even if it hasn't been visited before. Thus the goal of computation is to determine, if possible, in advance if a path will lead to a dead-end.
Here's an example of pruning. Sometimes the path found so far may divide the set of unvisited nodes into two sets that are "cut off" from each other. For example, in the graph below, if the exhaustive search algorithm starts off choosing the path A-C-E then we can tell by looking that this will not lead to a solution, i.e. there cannot be a Hamilton Cycle that contains A-C-E. See why? This path has divided the graph into two parts: no path can connect B with any node in {D, F} without re-visiting a node that's already been visited.

If we implement this pruning strategy, the change in the code for exhaustive search might look like this:
if (!visit[v]&& !cutInTwo(adj,visit) ) exh_search_recurs(adj,v)
Question (3 parts):
First, Describe clearly a strategy for the cutInTwo() function. You can answer this by writing a few sentences
describing an approach that solves this problem.
Second, give an upper-bound on the time-complexity for one call to cutInTwo().
Third, discuss in a few sentences whether or not you think it would be cost effective to make this change
if you were using this exhaustive search strategy to find all Hamilton cycles found in large, moderately dense
graphs.