1 / 44

SI 614 Basic network concepts and intro to Pajek

SI 614 Basic network concepts and intro to Pajek. Lecture 2 Instructor: Lada Adamic. Outline. Basic network metrics Bipartite graphs Graph theory in math Pajek. Network elements: edges. Directed (also called arcs) A -> B A likes B, A gave a gift to B, A is B’s child Undirected

Download Presentation

SI 614 Basic network concepts and intro to Pajek

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SI 614Basic network concepts and intro to Pajek Lecture 2 Instructor: Lada Adamic

  2. Outline • Basic network metrics • Bipartite graphs • Graph theory in math • Pajek

  3. Network elements: edges • Directed (also called arcs) • A -> B • A likes B, A gave a gift to B, A is B’s child • Undirected • A <-> B or A – B • A and B like each other • A and B are siblings • A and B are co-authors • Edge attributes • weight (e.g. frequency of communication) • ranking (best friend, second best friend…) • type (friend, relative, co-worker) • properties depending on the structure of the rest of the graph: e.g. betweenness

  4. 2 2 2 Louise Ada Lena 1 1 Adele 1 1 Marion 2 1 2 1 2 Jane 2 2 1 2 2 Frances Cora 1 2 1 2 1 Eva Maxine Mary 1 1 1 2 2 1 Anna Ruth 1 1 Edna 1 Robin Betty Martha 2 1 1 2 2 2 2 2 2 2 2 1 Jean 1 1 1 Laura Alice 1 2 Hazel Helen Hilda 1 2 1 Ellen 2 Ella Irene Directed networks • girls’ school dormitory dining-table partners (Moreno, The sociometry reader, 1960) • first and second choices shown

  5. Edge weights can have positive or negative values • One gene activates/inhibits another • One person trusting/distrusting another • Research challenge: How does one ‘propagate’ negative feelings in a social network? Is my enemy’s enemy my friend? Transcription regulatory network in baker’s yeast

  6. i i i Adjacency matrices • Representing edges (who is adjacent to whom) as a matrix • Aij = 1 if node i has an edge to node j = 0 if node i does not have an edge to j • Aii = 0 unless the network has self-loops • Aij = Aji if the network is undirected,or if i and j share a reciprocated edge j j Example: 2 3 A = 1 4 5

  7. Adjacency lists • Edge list • 2 3 • 2 4 • 3 2 • 3 4 • 4 5 • 5 2 • 5 1 • Adjacency list • is easier to work with if network is • large • sparse • quickly retrieve all neighbors for a node • 1: • 2: 3 4 • 3: 2 4 • 4: 5 • 5: 1 2 2 3 1 4 5

  8. Nodes • Node network properties • from immediate connections • indegreehow many directed edges (arcs) are incident on a node • outdegreehow many directed edges (arcs) originate at a node • degree (in or out)number of edges incident on a node • from the entire graph • centrality (betweenness, closeness) indegree=3 outdegree=2 degree=5

  9. 2 Node degree from matrix values 3 1 • Outdegree = 4 5 A = example: outdegree for node 3 is 2, which we obtain by summing the number of non-zero entries in the 3rdrow • Indegree = A = example: the indegree for node 3 is 1, which we obtain by summing the number of non-zero entries in the 3rdcolumn

  10. Other node attributes • Homophily: tendency of like individuals to associate with one another • take your pick… • geographical location • function • musical tastes…

  11. Network metrics: degree sequence and degree distribution • Degree sequence: An ordered list of the (in,out) degree of each node • In-degree sequence: • [2, 2, 2, 1, 1, 1, 1, 0] • Out-degree sequence: • [2, 2, 2, 2, 1, 1, 1, 0] • (undirected) degree sequence: • [3, 3, 3, 2, 2, 1, 1, 1] • Degree distribution: A frequency count of the occurrence of each degree • In-degree distribution: • [(2,3) (1,4) (0,1)] • Out-degree distribution: • [(2,4) (1,3) (0,1)] • (undirected) distribution: • [(3,3) (2,2) (1,3)]

  12. Network metrics: connected components • Strongly connected components • Each node within the component can be reached from every other node in the component by following directed links B F G • Strongly connected components • B C D E • A • G H • F C A H D E • Weakly connected components: every node can be reached from every other node by following links in either direction • Weakly connected components • A B C D E • G H F B F G C A H D • In undirected networks one talks simply about ‘connected components’ E

  13. Network metrics: shortest paths • Shortest path (also called a geodesic path) • The shortest sequence of links connecting two nodes • Not always unique B 3 C • A and C are connected by 2 shortest paths • A – E – B - C • A – E – D - C A 2 1 3 D E 2 • Diameter: the largest geodesic distance in the graph • The distance between A and C is the maximum for the graph: 3 • Caution: some people use the term ‘diameter’ to be the average shortest path distance, in this class we will use it only to refer to the maximal distance

  14. Giant components and the web graph • if the largest component encompasses a significant fraction of the graph, it is called the giant component

  15. The bowtie model of the web • The Web is a directed graph: • webpages link to other webpages • The connected components tell us what set of pages can be reached from any other just by surfing (no ‘jumping’ around by typing in a URL or using a search engine) • Broder et al. 1999 – crawl of over 200 million pages and 1.5 billion links. • SCC – 27.5% • IN and OUT – 21.5% • Tendrils and tubes – 21.5% • Disconnected – 8% image: Mark Levene

  16. bipartite (two-mode) networks • edges occur only between two groups of nodes, not within those groups • for example, we may have individuals and events • directors and boards of directors • customers and the items they purchase • metabolites and the reactions they participate in

  17. going from a bipartite to a one-mode graph group 1 • One mode projection • two nodes from the first group are connected if they link to the same node in the second group • some loss of information • naturally high occurrence of cliques • Two-mode network group 2

  18. Now in matrix notation • Bij • = 1 if node i from the first group links to node j from the second group • = 0 otherwise • B is usually not a square matrix! • for example: we have n customers and m products i j B =

  19. Collapsing to a one-mode network i k • i and k are linked if they both link to j • Aik= j Bij Bkj • A= B BT • the transpose of a matrix swaps Bxy and Byx • if B is an nxm matrix, BT is an mxn matrix j=1 j=2 B = BT =

  20. Matrix multiplication • general formula for matrix multiplication Zij= k Xik Ykj • let Z = A, X = B, Y = BT = A = 1 1 = 1*1+1*1 + 1*0 + 1*0= 2 1 1 2

  21. Collapsing a two-mode network to a one mode-network • Assume the nodes in group 1 are people and the nodes in group 2 are movies • The diagonal entries of A give the number of movies each person has seen • The off-diagonal elements of A give the number of movies that both people have seen • A is symmetric 1 1 A = 1 1 2

  22. Networks of actors

  23. History: Graph theory • Euler’s Seven Bridges of Königsberg – one of the first problems in graph theory • Is there a route that crosses each bridge only once and returns to the starting point?

  24. Eulerian paths • If starting point and end point are the same: • only possible if no nodes have an odd degree • each path must visit and leave each shore • If don’t need to return to starting point • can have 0 or 2 nodes with an odd degree Eulerian path: traverse each edge exactly once Hamiltonian path: visit each vertex exactly once

  25. Bi-cliques (cliques in bipartite graphs) • Km,n is the complete bipartite graph with m and n vertices of the two different types • K3,3 maps to the utility graph • Is there a way to connect three utilities, e.g. gas, water, electricity to three houses without having any of the pipes cross? Utility graph K3,3

  26. Planar graphs • A graph is planar if it can be drawn on a plane without any edges crossing

  27. When graphs are not planar • Two graphs are homeomorphic if you can make one into the other by adding a vertex of degree 2

  28. Cliques and complete graphs • Kn is the complete graph (clique) with K vertices • each vertex is connected to every other vertex • there are n*(n-1)/2 undirected edges K5 K3 K8

  29. Peterson graph • Example of using edge contractions to show a graph is not planar

  30. Edge contractions defined • A finite graph G is planar if and only if it has no subgraph that is homeomorphic or edge-contractible to the complete graph in five vertices (K5) or the complete bipartite graph K3, 3. (Kuratowski's Theorem)

  31. graph density • Of the connections that may exist between n nodes • directed graph emax = n*(n-1) each of the n nodes can connect to (n-1) other nodes • undirected graphemax = n*(n-1)/2since edges are undirected, count each one only once • What fraction are present? • density = e/ emax • For example, out of 12possible connections, this graphhas 7, giving it a density of 7/12 = 0.583 • But it is more difficult for a larger networkto achieve the same density • measure not useful for comparing networks of different densities

  32. #s of planar graphs of different sizes 1:1 2:2 3:4 4:11 Every planar graph has a straight line embedding (homework exercise)

  33. Trees • Trees are undirected graphs that contain no cycles

  34. examples of trees • In nature • trees • river networks • arteries (or veins, but not both) • Man made • sewer system • Computer science • binary search trees • decision trees (AI) • Network analysis • minimum spanning trees • from one node – how to reach all other nodes most quickly • may not be unique, because shortest paths are not always unique • depends on weight of edges

  35. Using Pajek for exploratory social network analysis • Pajek – (pronounced in Slovenian as Pah-yek) means ‘spider’ • website: vlado.fmf.uni-lj.si/pub/networks/pajek/ • download application (free) • tutorials • lectures • data sets • Windows only (works on Linux via Wine) • can be installed via NAL in the student lab (DIAD) • helpful book: ‘Exploratory Social Network Analysis with Pajek’ by Wouter de Nooy, Andrej Mrvar and Vladimir Batagelj • first 2 chapters are required reading and on cTools

  36. Drop down list of networks opened or created with pajek. Active is displayed Drop down list of network partitions by discrete variables, e.g. degree, mode, label Drop down list of continuous node attributes, e.g. centrality, clustering coefficients Pajek interface things we’ll use right away things we’ll use later for clustering

  37. opening a network file click on folder icon to open a file Save changes to your network, network partitions, etc., if you’d like to keep them

  38. Working with network files in Pajek • The active network, partition, etc is shown on top of the drop down list Draw the network

  39. 2 Louise Ada 1 1 Cora Pajek data format *Vertices 26 1 "Ada" 0.1646 0.2144 0.5000 2 "Cora" 0.0481 0.3869 0.5000 3 "Louise" 0.3472 0.1913 0.5000 .. *Arcs 1 3 2 c Black .. *Edges 1 2 1 c Black .. number of vertices vertex x,y,z coordinates (optional) directed edges from Ada(1) to Louise(3) as choice “2” and color Black undirected edges between Ada(1) to Cora(2) as choice “1” and color Black

  40. Live demo of Pajek • Opening a network • Visualization • Essential measurements

  41. Final project guidelines • Work individually or in groups (up to 4 people) • Important dates • Feb. 13th Project proposals due (5%) • 1 page abstract & 5 minute class presentation • March 20th Project status report due (5%) • 3-6 pages of • result summaries (including figures and tables) • plan of remaining work • April 17th in class student presentations of results (5%) • April 24th final project reports due (25%) • 6-12 pages of • related work • main results • ‘future’ work/extensions

  42. Final Project • Option 1: Analyze a network • What it should be • More than just a measurement of the average shortest path, clustering coefficient, and degree distribution • An interpretation of measurement results • If applicable: • discovery of community or other structure • assortativity • motifs • weights, thresholds • longitudinal data (how the network changes over time) • Visualizations of all or part of the network that point out a particular feature • Qualitative comparison with other networks • What it should not be • a literature review • The data can be artificially generated or a real-world dataset • If you intend to work on data concerning human subjects, you may need to start an IRB application ASAP

  43. Final Project • Option 2: New network model • What it should be • Method for generating a network • e.g. preferential attachment • optimization wrt. different criteria • Analysis of resulting network • comparison with random graphs • how do attributes change depending on model parameters • What it should not be • an already thoroughly explored model

  44. Final Project • Option 3: Novel algorithm • What it should be • An algorithm to analyze the network • e.g. clustering or community detection algorithm • webpage ranking algorithm • OR a process that is influenced by the network • gossip spreading • games such as the prisoner’s dilemma • Analysis of algorithm on several different networks • What it should not be • an exact replica of an existing algorithm applied to a network where it has already been studied

More Related