14.03.2015 Views

Dept. Computer Science Networks and Graphs VU University ...

Dept. Computer Science Networks and Graphs VU University ...

Dept. Computer Science Networks and Graphs VU University ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

4 Prove by induction that, for a given graph G, ∑ w∈V (G) δ(w) = 2 · |E(G)|. 10pt<br />

Prove this by induction on the number of edges. Clearly, when |E(G)| = 0 the theorem is true,<br />

as each vertex will have degree 0. Assume it holds for any graph with k > 1 edges <strong>and</strong> assume<br />

|E(G)| = k +1. Remove an arbitrary edge e = 〈u,v〉 from G. For the resulting graph G ∗ we know the<br />

theorem holds. Moreover, δ G ∗(u) = δ G (u) − 1, <strong>and</strong> likewise, δ G ∗(v) = δ G (v) − 1. As a consequence<br />

∑ w∈V (G) δ(w) = 2 + ∑ w∈V (G ∗ ) δ(w) = 2 + |E(G ∗ )| = 2 · (1 + |E(G ∗ )|) = 2 · |E(G)|.<br />

5a Can a directed tree with n > 1 vertices be strongly connected? Explain your answer.<br />

No. Strongly connected implies that for any two vertices u <strong>and</strong> v there exists a directed (u,v)-path<br />

as well as a directed (v,u)-path. In a directed tree, any two vertices are connected through a single<br />

path in the underlying undirected graph. Every edge in that path will have a single direction, making<br />

it impossible for any orientation to be strongly connected.<br />

5b Prove that if a directed graph with n > 1 vertices is strongly connected, every vertex will have a<br />

degree larger than 1.<br />

Prove by contradiction. If δ(v) = 0 then G is not even connected. Let δ(v) = 1, <strong>and</strong> adjacent to u. We<br />

either have (1) the arc 〈u,v〉 ⃗ or (2) the arc 〈v,u〉. ⃗ In (1) u cannot be reached from v; in (2) v cannot<br />

be reached from u, so that G can never be strongly connected. Therefore, our assumption that there<br />

may be a vertex with degree less than 2 is false.<br />

5c Consider a strongly connected directed graph G <strong>and</strong> its underlying undirected graph G ∗ . Prove that<br />

λ(G ∗ ) ≥ 2.<br />

Prove by contradiction. If λ(G ∗ ) ≤ 1, then there exists an edge e such that its removal will make<br />

G ∗ become disconnected with two components G ∗ 1 <strong>and</strong> G∗ 2 . It is impossible to assign a direction to e<br />

such that each vertex in G ∗ 1 can reach a vertex in G∗ 2 in G, or vice versa. Hence, λ(G∗ ) ≥ 2.<br />

4pt<br />

4pt<br />

4pt<br />

Part II<br />

6a Compute for the following graph all the shortest paths to vertex 1 using Dijkstra’s algorithm. Be sure<br />

to make clear how you came to your answer.<br />

6pt<br />

9<br />

6<br />

4<br />

14<br />

6<br />

2<br />

1 9 11<br />

2<br />

3<br />

7<br />

5<br />

10<br />

15<br />

Dijkstra proceeds in a number of steps. Let S t (u) denote the set of vertices for which shortest paths<br />

to vertex u have been found after t ≥ 0 steps. Set S 0 (u) = {u}. Let label (s,d) v attached to vertex v<br />

denote the distance d to u, <strong>and</strong> s being v’s next neighbor on the shortest path to u. Let L t (u) be the<br />

set of labels of vertices in S t (u), <strong>and</strong> ¯L t (u) labels of other nodes. We then have:<br />

1. S 1 (1) = {1}; L 1 (1) = {(1,0) 1 }; ¯L 1 (u) = {(1,9) 2 ,(−,∞) 3 ,(−,∞) 4 ,(1,7) 5 ,(1,14) 6<br />

2. S 2 (1) = {1,5}; L 1 (1) = {(1,0) 1 ,(1,7) 5 }; ¯L 1 (u) = {(1,9) 2 ,(5,22) 3 ,(−,∞) 4 ,(1,14) 6<br />

3. S 3 (1) = {1,2,5}; L 1 (1) = {(1,0) 1 ,(1,9) 2 ,(1,7) 5 }; ¯L 1 (u) = {(2,20) 3 ,(−,∞) 4 ,(2,11) 6<br />

4. S 4 (1) = {1,2,5,6}; L 1 (1) = {(1,0) 1 ,(1,9) 2 ,(1,7) 5 ,(2,11) 6 }; ¯L 1 (u) = {(2,20) 3 ,(6,20) 4<br />

5. S 5 (1) = {1,2,3,5,6}; L 1 (1) = {(1,0) 1 ,(1,9) 2 ,(2,20) 3 ,(1,7) 5 ,(2,11) 6 }; ¯L 1 (u) = {(6,20) 4<br />

6. S 6 (1) = {1,2,3,4,5,6}; L 1 (1) = {(1,0) 1 ,(1,9) 2 ,(2,20) 3 ,(2,20) 4 ,(1,7) 5 ,(2,11) 6 }; ¯L 1 (u) =<br />

{}<br />

2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!