info 2950, lecture 17 - cornell university

Post on 28-Jul-2022

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Prob Set 5: due Wed eve 11 Apr 2018

Info 2950, Lecture 17 29 Mar 2018

https://en.wikipedia.org/wiki/Zachary's_karate_club

“A social network of a karate club was studied by Wayne W. Zachary for a period of three years from 1970 to 1972. The network captures 34 members of a karate club, documenting 78 pairwise links between members who interacted outside the club. During the study a conflict arose between the administrator and instructor , which led to the split of the club into two. Half of the members formed a new club around the instructor, members from the other part found a new instructor or gave up karate. Based on collected data Zachary assigned correctly all but one member of the club to the groups actually joined after the split.”

https://en.wikipedia.org/wiki/Zachary's_karate_club

“A social network of a karate club was studied by Wayne W. Zachary for a period of three years from 1970 to 1972. The network captures 34 members of a karate club, documenting 78 pairwise links between members who interacted outside the club. During the study a conflict arose between the administrator and instructor , which led to the split of the club into two. Half of the members formed a new club around the instructor, members from the other part found a new instructor or gave up karate. Based on collected data Zachary assigned correctly all but one member of the club to the groups actually joined after the split.”

[34] [1]

34

1

https://en.wikipedia.org/wiki/Zachary's_karate_club

“A social network of a karate club was studied by Wayne W. Zachary for a period of three years from 1970 to 1972. The network captures 34 members of a karate club, documenting 78 pairwise links between members who interacted outside the club. During the study a conflict arose between the club president [34] and instructor [1], which led to the split of the club into two. Half of the members formed a new club around the instructor, members from the other part found a new instructor or gave up karate. Based on collected data Zachary assigned correctly all but one member of the club to the groups actually joined after the split.”

Easley/Kleinberg fig 3.13:Could the boundaries of the two subclubs be predicted from the network structure?

4933

121

Easley/Kleinberg fig 3.14a

use “Edge betweenness”= # shortest length paths through edgeas splitting criterion

1

Easley/Kleinberg fig 3.14a

use “Edge betweenness”= # shortest length paths through edgeas splitting criterion

12

5

1

Easley/Kleinberg fig 3.14a

use “Edge betweenness”= # shortest length paths through edgeas splitting criterion

12

5

1

Easley/Kleinberg fig 3.14a

use “Edge betweenness”= # shortest length paths through edgeas splitting criterion

12

5

x

Easley/Kleinberg p.78

Which are the important vertices?Which are the important edges?

Which play a central rolein mediating communication?

Use edge betweenness and vertex betweenness:

those with the mostshortest length paths going through themmay be most “central” to the network.

Easley/Kleinberg p.78 To consider centrality for paths starting from A,rearrange to put A at the top (will have to repeatfor each of the nodes, so an O(N2) algorithm)

A

A

First count the number ofshortest length paths from Ato every other vertex,level by levelstarting from the top

First count the number ofshortest length paths from Ato every other vertex,level by levelstarting from the top

3 3

22

6

1

1 111

Then count the number ofshortest length paths emanatingfrom A through each edge,level by level starting from the bottom

(Number of shortestlength paths from Ato each other vertexnow labelled in blue)

3 3

22

6

1

1 111

Then count the number ofshortest length paths emanatingfrom A through each edge,level by level starting from the bottom

(Number of shortestlength paths from Ato each other vertexnow labelled in blue)

(The total number ofshortest length pathsfrom A is 10, i.e., thenumber of other vertices)

(from Rosen,10.6)

A weighted graph is a graph such that each edge ehas an associated real number w(e) called the weight of the edge.

Given a graph with weights on each of its edges,we want to determine a spanning tree with the smallest total weight

This is called a minimal spanning tree.

The total weight of a tree (or any graph) is the sum of the weights of its edges.

Here we consider a greedy algorithm, Kruskal’s Algorithm,to find the minimal spanning tree.

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

Kruskal’s AlgorithmFind minimal spanning tree

Initialize T = (V, E):V = {vertices of G}E = {}

1. Take an edge e ∈ G such that w(e) is minimal If E ∪ e is a forest, add e to E2. Remove e from G.3. If |T| == n − 1: stop else: go to step 1 Prim’s algorithm: 1. -> If E ∪ e is a tree, …

[i.e., keep it connected all stages, edgesadded in different order but same final result] try it

maps.google.com

Shortest Path Algorithm

Greedy algorithm due to Dijkstra (1959)

shortest path from a to z?

start from vertex a, -> find nearest vertex.then look at paths through thosetwo with one additional edge, -> find second nearest vertex to a.then look at paths through thosethree with one additional edge, -> find third nearest vertex to a

and so on, until reach zRosen 10.6 fig.3 p.710

Start from {a}, two paths: (a,b), (a,d)

Start from {a}, two paths: (a,b), (a,d)(a,d) is shortest

distance (a,d) = 2

From {a,d}, two paths: (a,b), (a,d,e)

Start from {a}, two paths: (a,b), (a,d)(a,d) is shortest

distance (a,d) = 2

From {a,d}, two paths: (a,b), (a,d,e)

Start from {a}, two paths: (a,b), (a,d)(a,d) is shortest

distance (a,d) = 2distance (a,b) = 4

(a,b) is shortest

From {a,d}, two paths: (a,b), (a,d,e)

From {a,b,d}, three paths: (a,b,c), (a,b,e), (a,d,e)

Start from {a}, two paths: (a,b), (a,d)(a,d) is shortest

distance (a,d) = 2distance (a,b) = 4

(a,b) is shortest

From {a,d}, two paths: (a,b), (a,d,e)

From {a,b,d}, three paths: (a,b,c), (a,b,e), (a,d,e)

Start from {a}, two paths: (a,b), (a,d)

distance (a,e) = 5

(a,d,e) is shortest

(a,d) is shortest

distance (a,d) = 2distance (a,b) = 4

(a,b) is shortest

From {a,d}, two paths: (a,b), (a,d,e)

From {a,b,d}, three paths: (a,b,c), (a,b,e), (a,d,e)

From {a,b,d,e}, two paths: (a,b,c), (a,d,e,z)

Start from {a}, two paths: (a,b), (a,d)

distance (a,e) = 5

(a,d,e) is shortest

(a,d) is shortest

distance (a,d) = 2distance (a,b) = 4

(a,b) is shortest

From {a,d}, two paths: (a,b), (a,d,e)

From {a,b,d}, three paths: (a,b,c), (a,b,e), (a,d,e)

From {a,b,d,e}, two paths: (a,b,c), (a,d,e,z)

Start from {a}, two paths: (a,b), (a,d)

(a,d,e,z) is shortestdistance (a,z) = 6distance (a,e) = 5

(a,d,e) is shortest

(a,d) is shortest

distance (a,d) = 2distance (a,b) = 4

(a,b) is shortest

top related