

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


ECS122A: Algorithm Design and Analysis Homework Assignment #5 Solutions
Therefore, by |V | − 1 tests, we can eliminate all but one vertex. The second step of the algorithm is to make sure this one is a sink. It takes |V | − 1 tests for edges coming in (in-degree), and |V | − 1 tests for edges going out (out-degree). The run time of the algorithm is then |V | − 1 + |V | − 1 + |V | − 1 = 3|V | − 3 = O(|V |).
∑
e∈E
biebTej =
∑
e∈E
biebje.
Then,
Here is what BBT^ contains
BBT^ (i, j) =
{ degree of i = in-degree + out-degree if i = j −(# edges connecting i and j) if i 6 = j
The count for the number of edges between the two vertices includes in either direction, so it can be 0, 1 or 2. Here is an interesting property of the Laplacian BBT^. Let Gu be an undirected graph, and let G be a directed graph gotten from Gu by putting arrows on Gu’s edges in any way you like. Let BBT be the Laplacian matrix of G. Then the null of connected components of Gu is the dimension of the null space of the matrix BBT^ , i.e., the number of linearly independent vectors x satisfying BBT^ x = 0.
1 2 3
4 5 6
Q: 3 5 6 4 2
Q: u t y w x s r v
Solution: the result of running DFS. See Fig ??