851-0585-04L – Modeling and Simulating Social Systems with MATLAB 03.08.2018 851-0585-04L – Modeling and Simulating Social Systems with MATLAB Lecture 7 – Simulations with Networks Karsten Donnay and Stefano Balietti Chair of Sociology, in particular of Modeling and Simulation © ETH Zürich | © ETH Zürich |
Schedule of the course Introduction to MATLAB 03.08.2018 Schedule of the course Introduction to MATLAB 24.09. 01.10. 08.10. 15.10. 22.10. 29.10. 05.11. 12.11. 19.11. 26.11. 03.12. 10.12. 17.12. Introduction to social-science modeling and simulations Working on projects (seminar thesis) Handing in seminar thesis and giving a presentation
Schedule of the course Different ways of Introduction to MATLAB 03.08.2018 Schedule of the course Different ways of Representing space Introduction to MATLAB 24.09. 01.10. 08.10. 15.10. 22.10. 29.10. 05.11. 12.11. 19.11. 26.11. 03.12. 10.12. 17.12. Dynamical Systems (no-space) Cellular Automata (grid) Networks (graphs) Working on projects (seminar thesis) Continuous Space (…) Handing in seminar thesis and giving a presentation
Goals of Lecture 7: students will Consolidate knowledge acquired during lecture 6, through brief repetition of the main points Translate a research question into a simple model of simulation on networks Get a firm grasp in algorithms to generate different network topologies Review a custom implementation of algorithms to efficiently: Generate different networks topologies Compute statistical properties Run a simple simulation of the emergence of giant component in a random network
Repetition: Definition of Graph 03.08.2018 Repetition: Definition of Graph A graph consists of two entities: Nodes (vertices): N Links: L Edge: undirected link Arc: directed link The graph is defined as G = (N,L) Source: Batagelj
Repetition: Networks Topologies Random: Small average path length Small clustering coefficient (in general) Small World: High clustering coefficient Scale Free: Slightly smaller average path length Highest clustering coefficient
Repetition: Networks Topologies Random: Small average path length Small clustering coefficient (in general) Small World: High clustering coefficient Scale Free: Slightly smaller average path length Highest clustering coefficient Homegeneous (Exponential) Degree Distr. Power Law Degree Distr.
Examples of different network topologies 03.08.2018 Examples of different network topologies Differences between an exponential network—a U.S. roadmap and a scale-free network—an air- line routing map. On the roadmap, the nodes are cities that are connected by highways. This is a fairly uniform network: each major city has at least one link to the highway system, and there are no cities served by hundreds of highways. The airline routing map dif- fers drastically from the roadmap. The nodes of this network are airports connected by direct flights among them. There are a few hubs on the airline routing map, including Chicago, Dallas, Denver, Atlanta, and New York, from which flights depart to almost all other U.S. airports. The vast majority of airports are tiny, appearing as nodes with one or a few links connecting them to one or sev- eral hubs. Source: Wang (2003)
From a problem to a scientific answer Observation: The role of social networks in shaping the public opinion is becoming increasingly more important
From a problem to a scientific answer Question: How easy is to be manipulated in a social network? Vs.
From a problem to a scientific answer Literature Review: Was the problem already treated?
From a problem to a scientific answer Literature Review: How existing models can be improved? ?
From a problem to a scientific answer Creating a new model Let us assume ‘informed’ agents Let us consider networks How easily can the opinion of other persons be drifted in online social netwrks? https://github.com/msssm/Informed_Agents
From a problem to a scientific answer Results Let us assume ‘informed’ agents Let us consider networks https://github.com/msssm/Informed_Agents
How to generate random, realistic graphs? 03.08.2018 Generators How to generate random, realistic graphs? Probabilistic generators Degree-based generators Process-based generators Recursive/self-similar generators
Probabilistic Generators: Erdos-Renyi Algorithm: Start with a number of nodes n (fully not connected) Define probability of connection P For all the possible couples of nodes a link is created with probability P The average number of links is given by: p*n*(n-1)/2 The greater P the higher the average degree of the network
Probabilistic Generators: Erdos-Renyi random graph – 100 nodes, avg degree = 2 Fascinating properties (phase transition) But: unrealistic (Poisson degree distribution != power law)
E-R model & Percolation Pc The formation of the Giant Component is not a smooth process. It emerge all of sudden when p > 1/n This phenomenon is called 1st order phase-transition 1 N->infty K K0 K = avg(k) Pc = Prob( there is a giant connected component)
Graphs: Laws and patterns (C) 2010, C. Faloutsos Graphs: Laws and patterns Are real graphs random? If we look at the data the answer most of the time is: NO!! count count k degree degree k
Degree-based generators Figure out the degree distribution (eg., ‘Zipf’) Assign degrees to nodes Put edges, so that they match the original degree distribution
Process-based: Preferential attachment Algorithm: Start with a random connected graph At each time step create a new node and attach it to the others with probability: Ki = degree of node i That is: if a node has many links, it will get more in the future…
Process-based: Preferential attachment Generates power-law tails (richer-get-richer) The degree distribution is a power law of the form: P(K) ~ k-3
Process-based: Preferential attachment Generates power-law tails (richer-get-richer) The degree distribution is a power law of the form: P(K) ~ k-3 But still, it does not reproduce the property of shrinking diameter in real evolving networks…
Get the lecture files from GitHub 03.08.2018 Get the lecture files from GitHub Lecture files are also available on a GitHub repository: git@github.com:msssm/lectures_files.git
Get the lecture files from GitHub 03.08.2018 Get the lecture files from GitHub If you have already uploaded your public key in GitHub (see live presentation), You can dowload the latest lecture files with the following command in GIT Bash to stay updated: git clone git@github.com:msssm/lectures_files.git git pull
Lecture Files Generate Compute: Export to file: Random Networks 03.08.2018 Lecture Files Generate Random Networks Small World Networks Scale Free Networks Compute: Average Path Length Clustering Coefficient Export to file: Parse an adjacency matrix and create an arc list Write a cell array as a csv file
03.08.2018 Lecture Files Simulate the emergence of the giant component in a random network (files online in .zip archive). emergence.m emergence_video.m emergence_smooth.m See live demo.
R and Matlab integration to plot nice graphs (igraph library) 03.08.2018 R igraph R and Matlab integration to plot nice graphs (igraph library) https://github.com/tconring/Arabian-Spring
Social Network Analysis Mailing List: 03.08.2018 SOCNET Mailing List Social Network Analysis Mailing List: http://www.insna.org/pubs/socnet.html
Network Analysis Literacy Talk Tomorrow 03.08.2018 Network Analysis Literacy Talk Tomorrow Why Pretty Woman is a good recommendation for somebody who loves Star Wars V. ? Prof. Katharina Zweig (Technical University Kaiserslautern, Germany) Tuesday, 13 Nov 2012, 11.00-12.00 ETH Zürich, Main Building, HG E 22 http://www.sg.ethz.ch/
03.08.2018 References Jure Leskovec, Deepayan Chakrabarti, Jon M. Kleinberg, Christos Faloutsos: Realistic, Mathematically Tractable Graph Generation and Evolution, Using Kronecker Multiplication. PKDD 2005: 133-145 Xiao Fan Wang and Guanrong Chen Complex Networks: Small- World, Scale-Free and Beyond Damon Centola, The Spread of Behavior in an Online Social Network Experiment. Science, Vol. 329 no. 5996 pp. 1194-1197 (2010) Duncan J. Watts, Steven H. Strogatz, Collective dynamics of 'small- world' networks. Nature 393, 440-442 (4 June 1998) Laszlo Barabasi, Scale-Free Networks: A Decade and Beyond. cience 24 July 2009: Vol. 325 no. 5939 Laszlo Barabasi web site: http://nd.edu/~alb/
References About the KONY phenomenon: 03.08.2018 References About the KONY phenomenon: http://invisiblechildren.com/kony/ http://globalspin.blogs.time.com/2012/03/19/kony-2012-mobs- takedowns-and-meltdowns-but-very-little-truth/?xid=newsletter- europe-weekly http://www.youtube.com/watch?v=Y4MnpzG5Sqc
03.08.2018 Projects Today, there are no exercises. Instead, you can work on your projects and we will supervise you.