CS331 Advanced Data Structures – Spring 2016 Due: March 30

advertisement
CS331 Advanced Data Structures – Spring 2016
Homework 6 – 35 points
Due: March 30
1. (10 points) Identify all of the articulation points and biconnected components in graph 1.
Specify the LOW values for each vertex at the end of the algorithm, assuming that vertices
are stored in alphabetic order in adjacency lists and the DFS starts at vertex A.
2. (10 points)
(a) Assuming that the vertices of graph 2 are stored in alphabetical order in the adjacency
lists, specify depth-first pre-order and post-order numbers for all vertices, starting at
vertex A.
(b) Determine all connected components of graph 2.
(c) Is there a single edge we can add to graph 2 to make it strongly connected? If so, specify
this edge; if not, explain why.
3. (10 points) Consider the graph below which consists of n square-groups of nodes.
g
g
g
g
g
g
g
g
g ···
g
g
g
g
1
2
3
4
g
g
g
g
n
(a) How many biconnected components are in this graph? How many articulation points?
(b) What is the maximum number of edges that can be added without changing the number
of biconnected components? Explain your answer
(c) What is the minimum number of edges that need to be added to make the graph biconnected? Specify all sets of edges that work.
4. (5 points) Suppose we have an undirected cycle graph consisting of n nodes.
(a) If we randomly convert each edge to a directed edge, what is the probability that the
graph is strongly connected?
(b) Suppose we add k < n extra directed edges to the original graph, all leaving vertex 0
and ending on k different vertices. Redo part (a) with these added edges. HINT: start
with small values of k and see if you see a pattern. Then use this to prove a general
formula. Your formula should also apply to the original graph where k = 0.
Graph 1
Graph 2
A
B
C
D
E
F
G
H
I
J
HH @
@
HH @
@
@
H@
HH
@
@
@
@ @
@
H
B
C D
@
I
@
6
6@
@
@
?
@
R @
@
- E
- F
A
I
K
I
@
@
@
?
?
@
- H - J
G
Download