• Save
Computational Social Science, Lecture 05: Networks, Part I
Upcoming SlideShare
Loading in...5
×
 

Computational Social Science, Lecture 05: Networks, Part I

on

  • 1,331 views

 

Statistics

Views

Total Views
1,331
Views on SlideShare
321
Embed Views
1,010

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 1,010

http://compsocialscience.org 1003
http://compsocialscience.com 7

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Computational Social Science, Lecture 05: Networks, Part I Computational Social Science, Lecture 05: Networks, Part I Presentation Transcript

  • Networks Part I Sharad Goel Columbia UniversityComputational Social Science: Lecture 5 February 22, 2013
  • High School Dating Network[ Bearman, Moody, & Stovel, 2004 ]Image by Mark Newman, via Easley & Kleinberg
  • Corporate E-mail Communication[ Adamic & Adar, 2004 ]via Easley & Kleinberg
  • “Internet map 2004” from Math Insighthttp://mathinsight.org/image/internet_map_jurvetson_2004
  • Networks/Graphs Nodes/verticespeople, organizations, webpages, computers Edgesrepresent connections between pairs of nodes
  • 2 5 11 14 9 6 2
  • 1 2 4 6 42 1 2 3 7 13
  • 31 2 5 4 1 2 3 4 5 6 7 7 1 0 1 0 1 0 0 0 6 2 1 0 1 0 1 0 0 3 0 1 0 0 1 0 0 4 1 0 0 0 1 0 0 5 0 1 1 1 0 1 1 6 0 0 0 0 1 0 0 7 0 0 0 0 1 0 0
  • 31 2 5 4 7 1 {2, 4} 6 2 {1, 3, 5} 3 {2, 5} 4 {1, 5} 5 {2, 3, 4, 6, 7} 6 {5} 7 {5}
  • 31 2 5 4 (1, 2) 7 (1, 4) 6 (2, 3) (2, 5) (3, 5) (4, 5) (5, 6) (5, 7)
  • 2 5 31 2 11 14 9 5 4 2 6 7 6 1 {2:2, 4:4} 2 {1:2, 3:5, 5:11} 3 {2:5, 5:1} 4 {1:4, 5:9} 5 {2:11, 3:1, 4:9, 6:6, 7:2} 6 {5:6} 7 {5:2}
  • 2 5 31 2 11 14 9 5 4 2 6 (1, 2, 2) 7 (1, 4, 4) 6 (2, 3, 5) (2, 5, 11) (3, 5, 1) (4, 5, 9) (5, 6, 6) (5, 7, 2)
  • Adjacency list  edge list(weighted) directed network Input Adjacency list Output Edge list
  • Adjacency list  edge list(weighted) directed network Map input: u {w1, …, wk} foreach wi: output (u, wi) Reduce pass
  • Edge list  adjacency list(weighted) undirected network Input Edge list Output Adjacency list
  • Edge list  adjacency list(weighted) undirected network Map input: (u, w) output: (u, w), key := u output: (w, u), key := w Reduce input: u, {w1, …, wk} identity
  • 31 2 5 4 7 6 Degree of node u # of edges incident on u
  • Edge list  node degrees undirected network Input Edge list Output Node degrees
  • Edge list  node degrees undirected network Map input: (u, w) output: (u, w), key := u output: (w, u), key := w Reduce input: u, {w1, …, wk} output: u, k
  • Edge list  degree distribution undirected network Input Edge list Output Degree distribution
  • Edge list  degree distribution undirected network Map input: (u, w) output: (u, w), key := u output: (w, u), key := w Reduce input: u, {w1, …, wk} output: u, k
  • Edge list  degree distribution undirected network Map input: u, k identity, key := k Reduce input: k, {u1, …, um} output: k, m
  • 31 2 5 4 7 6 Path Sequence of nodes with each consecutive pair connected by an edge
  • 31 2 5 4 7 6 Cycle Path with at least three edges with first and last nodes the same and all other nodes distinct
  • Connected GraphThere is a path between every pair of nodes
  • Connected GraphThere is a path between every pair of nodes
  • Connected Component A connected subset of nodes that is notcontained in any larger connected subset
  • DistanceLength of the shortest path between two nodes
  • DistanceLength of the shortest path between two nodes
  • Breadth-first Searchiteratively explore nodes one layer at a time
  • # initialize distancesdist = {}for u in G: dist[u] = NAdist [u1] = 0d=0periphery = { u1 }while len(periphery) > 0: # find nodes one step away from the periphery next_level = {} for u in periphery: next_level += { w for w in neighbors[u] if dist[w] == NA } # update distances d += 1 for u in next_level: dist[u] = d # update periphery periphery = next_level
  • BFS @ scale undirected network Input edge list, starting node u0 OutputDistance to all nodes from u0
  • BFS @ scale undirected networkInput: distances (u, d)1. join distances with edge list2. foreach (u, d, w) output (w, d+1) [ also output (u0, 0) ]3. group by w, and output min d