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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Dept</strong>. <strong>Computer</strong> <strong>Science</strong><br />

<strong>Networks</strong> <strong>and</strong> <strong>Graphs</strong><br />

<strong>VU</strong> <strong>University</strong> Amsterdam 03.07.2013<br />

Part I<br />

BE SURE THAT YOUR HANDWRITING IS READABLE<br />

1a Let G denote a simple graph with n > 1 vertices <strong>and</strong> m edges. For each of the following mathematical<br />

statements, (1) translate the statement into common English <strong>and</strong> (2) tell whether it is true or false.<br />

1. ω(G) = 1 ⇒ ∀u ∈ V (G) : δ(u) > 0<br />

2. ∀u ∈ V (G) : δ(u) > 0 ⇒ ω(G) = 1<br />

3. ∑ v∈V (G) δ(v) = 2m<br />

4. ∀H ⊆ G : |E(H)| ≤ m<br />

5. |{(u,v)|∃(u,v) − path}| = 0 ⇒ ω(G) = n<br />

10pt<br />

1. ω(G) = 1 ⇒ ∀u ∈ V (G) : δ(v) > 0: If G is connected, then each vertex in G has at least degree 1.<br />

True.<br />

2. ∀u ∈ V (G) : δ(v) > 0 ⇒ ω(G) = 1: If each vertex in G has at least degree 1, then G is connected.<br />

False.<br />

3. ∑ v∈V (G) δ(v) = 2m: The sum of all vertex degress is equal to twice the number of edges. True.<br />

4. ∀H ⊆ G : |E(H)| ≤ m: Each subgraph of G has the same or less number of edges than G. True<br />

5. |{(u,v)|∃(u,v) − path}| = 0 ⇒ ω(G) = n: If the number of paths between any two vertices in G is<br />

zero, then G consists of n components. True.<br />

2 Prove that if two graphs have the same degree sequence, they do not also need to be isomorphic. 6pt<br />

See Figure 2.4 for examples.<br />

3a Consider the original Köningsberg bridge graph, shown below. Modify the graph such that it becomes<br />

Eulerian by (1) deleting two edges, (2) adding two edges, <strong>and</strong> (3) adding an edge <strong>and</strong> deleting<br />

an edge.<br />

6pt<br />

(1) delete 〈n,w〉 <strong>and</strong> 〈s,e〉; (2) add 〈n,e〉 <strong>and</strong> 〈s,w〉; (3) add 〈n,s〉 <strong>and</strong> delete 〈w,e〉.<br />

3b Apply Fleury’s algorithm to find an Euler tour in the following graph.<br />

6pt


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


6b Provide a minimal spanning tree T for the graph from (a). Compared to the tree found in (a), T ’s<br />

weight will be the same or less. Why is that so?<br />

T consists of the edges 〈1,2〉,〈1,5〉,〈2,6〉,〈4,6〉,〈3,4〉. By construction, a shortest-path tree may<br />

contain paths that are shortest in distance to a specific node, but that contain edges that are simply<br />

not good for all nodes. In our example, the edge 〈2,3〉 is good for getting quickly from 3 to 1, but is<br />

not useful for all nodes.<br />

4pt<br />

7a Consider a real-world network G with 1000 vertices <strong>and</strong> 7500 edges. To which r<strong>and</strong>om network<br />

should G be compared?<br />

The basic idea is that G should be compared to an ER(n, p) network with n = 1000 vertices <strong>and</strong> the<br />

same number of edges. The average degree of an ER(n, p) network is p(n − 1), so that ∑δ(v) =<br />

n · p · (n − 1) = 2m. With n = 1000 <strong>and</strong> m = 7500, we have that p = 15,000/(1000 · 999) ≈ 0.015.<br />

7b Assume that the clustering coefficient of G from (a) is equal to 0.05. Is this high? Be sure to explain<br />

your answer.<br />

Yes, it’s high. We should compare G to an ER(1000,0.015) network, for which we know that the<br />

clustering coefficient is equal to 0.015. That of G is more that three times this value.<br />

6pt<br />

4pt<br />

8a Consider a Watts-Strogatz graph WS(n,k, p). Explain what the parameters n, k, <strong>and</strong> p st<strong>and</strong> for.<br />

n is the total number of nodes; k is the initial degree of each node, <strong>and</strong> p is the probability that an<br />

edge will be rewired after connecting a vertex to its k/2 left-h<strong>and</strong> <strong>and</strong> k/2 right-h<strong>and</strong> neighbors.<br />

8b What will happen to the average path length in a WS(n,k, p) graph when p increases? And what<br />

about the clustering coefficient?<br />

The average path length will drop rapidly (virtually exponentially), while the clustering coefficient<br />

will also drop, but much more gradually.<br />

8c Prove that for any two vertices u <strong>and</strong> v in a WS(n,k, p) graph, the length of a shortest path between<br />

u <strong>and</strong> v is less or equal than n/k.<br />

The worst case is when u <strong>and</strong> v belong to a WS(n,k,0) graph, <strong>and</strong> are placed opposite each other on<br />

the ring that is used to construct the graph. Vertex u is joined with its k/2 left-h<strong>and</strong> neighbors, <strong>and</strong><br />

those neighbors are joined with their left-h<strong>and</strong> neighbors, <strong>and</strong> so on. As a consequence, it will take<br />

less than (n/2)/(k/2) = n/k “hops” to reach v from u.<br />

3pt<br />

4pt<br />

8pt<br />

9a Give the definition of betweenness centrality <strong>and</strong> an informal description of what it tries to measure.<br />

If S(x,u,y) is the collection of shortest paths between x <strong>and</strong> y that passes through u (u ≠ x ≠ y),<br />

<strong>and</strong> S(x,y) is the collection of all shortest paths between x <strong>and</strong> y, the betweenness centraility of u is<br />

|S(x,u,y)|<br />

defined as ∑ u≠x≠y |S(x,y)|<br />

. It tries to capture the importance of vertex u by considering the effect on<br />

information flow through the network when u is removed.<br />

9b Compute the betweenness centrality for vertex 2 in the graph from (6a). Explain your answer.<br />

The trick is that we simply need to count the number of shortest paths on which vertex 2 lies for any<br />

pair of vertices, out of the total number of shortest paths for such a pair.<br />

1 2 3 4 5 6<br />

1 - - 1/1 1/1 0/1 1/1<br />

2 - - - - - -<br />

3 - - - 0/1 0/1 1/1<br />

4 - - - - 1/2 0/1<br />

5 - - - - - 1/1<br />

6 - - - - - -<br />

which leads a betweenness centrality of 6.5.<br />

9c Consider a tree with n vertices {1,2,...,n} in which vertex 1 is joined to all other vertices. What is<br />

the betweenness centrality of vertex 1?<br />

Simply the number of triangles at 1, which is equal to ( n−1) 2 .<br />

6pt<br />

6pt<br />

3pt<br />

3


Final grade: (1) Add, per part, the total points. (2) Let T denote the total points for the midterm exam<br />

(0 ≤ T ≤ 50); D1 the total points for part I; D2 the total points for part II. The final number of points E is<br />

equal to max{T,D1} + D2.<br />

4

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

Saved successfully!

Ooh no, something went wrong!