Turn in solutions to these problems. (Below they're marked
with this image: )
Important: Put the answer to each question on a separate sheet of paper (or one problem on front and another on the back). This is to make grading easier for us.
Collaboration Rules for This Assignment:
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) When DFS is executed on an undirected graph G, explain why
there will not be 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 Python or very clear pseudo-code) an efficient
algorithm to find the graph center of a graph G, and describe its
complexity. (Note: we strongly urge you to make use of algorithms
studied in this section, and not to re-invent the wheel.)
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 complexity. Also, make your algorithm assign a
subset number (0 or 1) to each vertex. (Note: we strongly urge you to
make use of algorithms studied in this section, and not to re-invent
the wheel.)
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. (Clearly state your proof strategy or technique.)