Introduction to Computational Modeling of Social Systems Emergent

  • Slides: 25
Download presentation
Introduction to Computational Modeling of Social Systems Emergent Network Models Prof. Lars-Erik Cederman Center

Introduction to Computational Modeling of Social Systems Emergent Network Models Prof. Lars-Erik Cederman Center for Comparative and International Studies (CIS) Seilergraben 49, Room G. 2, lcederman@ethz. ch Nils Weidmann, CIS Room E. 3, weidmann@icr. gess. ethz. ch http: //www. icr. ethz. ch/teaching/compmodels Lecture, January 18, 2005

Today’s agenda • Overview: Emergent social forms • Emergent-network models • Graph theory •

Today’s agenda • Overview: Emergent social forms • Emergent-network models • Graph theory • Small Worlds • Scale-Free Networks • Repast’s network support • Net. IPD and Homework D 2

Emergent social forms 1. 2. 3. 4. Interaction patterns Property configurations Dynamic networks Actor

Emergent social forms 1. 2. 3. 4. Interaction patterns Property configurations Dynamic networks Actor structures 3

1. Emergent interaction patterns actor actor • Models of “emergent order” producing configurations •

1. Emergent interaction patterns actor actor • Models of “emergent order” producing configurations • Axelrod (1984, chap. 8): “The structure of cooperation” actor 4

2. Emergent property configurations • Models of “emergent structure” constituted as property configruations •

2. Emergent property configurations • Models of “emergent structure” constituted as property configruations • Example: Schelling’s segregation model; Carley 1991; Axelrod 1997 • See Macy 2002 for further references actor actor actor actor actor 5

3. Emergent dynamic networks • Most computational models treat networks as exogenous • Recent

3. Emergent dynamic networks • Most computational models treat networks as exogenous • Recent exceptions: frequency d-a degree d – Albert and Barabási’s scale-free networks – Economics and evolutionary game theory: e. g. Skyrms and Pemantle 6

4. Emergent actor structures • Computational models normally assume the actors to be given

4. Emergent actor structures • Computational models normally assume the actors to be given • Exceptions: – Axelrod’s model of new political actors – Axtell’s firm-size model – Geopolitical models in the Bremer & Mihalka tradition • Emergence? 7

Elementary graph theory 8 • Links (edges) and nodes (vertices), G=(E, V) – Uni/Bidirectional

Elementary graph theory 8 • Links (edges) and nodes (vertices), G=(E, V) – Uni/Bidirectional graphs – (In/Out) Degree of a node, degree distribution – Weighted edges A 43 B 2 E 5 3 2 D 23 10 G 1 F C 6 4 8 J 53 I 9 H K

Phase shift in random graphs 9 Erdös and Rényi 1959 Fraction of nodes in

Phase shift in random graphs 9 Erdös and Rényi 1959 Fraction of nodes in largest component 1 0 1 Average number of links per node

The small-world experiment 10 “Six degrees of separation” Sharon, MA Stanley Milgram Omaha, NE

The small-world experiment 10 “Six degrees of separation” Sharon, MA Stanley Milgram Omaha, NE

Between order and randomness Watts and Strogatz’s Beta Model 11

Between order and randomness Watts and Strogatz’s Beta Model 11

Two degree distributions p(k) log p(k) 12 log p(k) log k Normal distribution k

Two degree distributions p(k) log p(k) 12 log p(k) log k Normal distribution k log k Power law k

Scale-free networks • Barabási and Albert’s 1999 model of the Internet: • Constantly growing

Scale-free networks • Barabási and Albert’s 1999 model of the Internet: • Constantly growing network • Preferential attachments: – p ( k) = k / i ki 13

Creating nodes and edges • Nodes 14 Node node. A = new Default. Node(“A”);

Creating nodes and edges • Nodes 14 Node node. A = new Default. Node(“A”); Node node. B = new Default. Node(“B”); A Edge • Edge (hand coding) Edge edge = new Default. Edge(node. A, node. B); node. A. add. Out. Edge(edge. AB); node. B. add. In. Edge(edge. AB); Direction B • Edge (simplified way) Edge edge = Edge. Factory. create. Edge(node. A, node. B); • Edges can also labeled and given a strength • Node and Edge are interfaces and specialized (agent) classes can easily be implemented

Node accessors • add. In. Edge(Edge) and add. Out. Edge(Edge) Add an in or

Node accessors • add. In. Edge(Edge) and add. Out. Edge(Edge) Add an in or out edge to the node • remove. In. Edge(Edge), remove. Out. Edge(Edge) Removes the specified edge from the list of in or out edges • get. In. Edges() and get. Out. Edges() Gets an Array. List of edges going in or out from the node • has. Edge. From(Node) and has. Edge. To(Node) Returns true if the node has an edge from or to the specified node, false otherwise • get. Node. Label() and set. Node. Label(String) 15

Edge accessors 16 • get. From() and get. To() Gets the node that this

Edge accessors 16 • get. From() and get. To() Gets the node that this edge comes from or goes to • set. From(Node) and set. To(Node) Sets the from or to node Typically distance or similarity • get. Strength() and set. Strength(double) Gets/sets the strength of this edge • get. Type() and set. Type(String) Gets the type of this edge • get. Label() and set. Label(String) Gets/sets the label for this edge To encode the type of relationship, e. g. a marriage

Net. Utilities Contains some useful static methods for computing statistics or rearranging a network,

Net. Utilities Contains some useful static methods for computing statistics or rearranging a network, e. g. • calc. Density(List) Calculates density (ratio of arcs in network to maximum possible number of arcs) of passed network • has. Self. Loops(List) Returns a boolean indicating whether the network contains self-loops (links from i -> i) • random. Rewire(Array. List, double prob) Returns a network of the same size and density as the passed network, but randomly "rewires" a fraction of the edges to randomly chosen target nodes. 17

Displaying networks 18 • Network 2 DDisplay: similar to any other display: Contains the

Displaying networks 18 • Network 2 DDisplay: similar to any other display: Contains the list of nodes public void build. Model() { Graph. Layout layout = new Default. Graph. Layout(agent. List, 500); Network 2 DDisplay display = new Network 2 DDisplay(layout); dsurf. add. Displayable. Probeable(display, "Display"); add. Sim. Event. Listener(dsurf); dsurf. display(); } public void step() { dsurf. update. Display(); }

Displaying nodes and edges • Every node and edge must implement the Drawable 2

Displaying nodes and edges • Every node and edge must implement the Drawable 2 DNode and Drawable. Edge interfaces • Default implementations: – Default. Drawable. Node – Default. Drawable. Edge • Can be parameterized with customized drawing code: Network. Drawable (e. g. Rect. Network. Item, Oval. Network. Item) 19

Graph layout • By default (Default. Graph. Layout), nodes are positioned according to the

Graph layout • By default (Default. Graph. Layout), nodes are positioned according to the x/y coordinates • Circular. Graph. Layout position them on a circle • Need to call layout. update. Layout() in step method. 20

Graph layout (cont. ) • Fruch. Graph. Layout attempts to minimize the overall length

Graph layout (cont. ) • Fruch. Graph. Layout attempts to minimize the overall length of the edges according to their strength (spring-based simulation) • Can be slow graph. Layout = new Fruch. Graph. Layout(. . . ); Controller c = (Controller)get. Controller(); c. add. Stop. Listener(graph. Layout); c. add. Pause. Listener(graph. Layout); c. add. Exit. Listener(graph. Layout) 21

Charting • As usual, but using Net. Sequence. Graph • Contains predefined statistics: 22

Charting • As usual, but using Net. Sequence. Graph • Contains predefined statistics: 22

Data importing and exporting • Import: Network. Factory List list = Network. Factory. get.

Data importing and exporting • Import: Network. Factory List list = Network. Factory. get. Network( “network. dl”, Network. Factory. DL, My. Node. class, My. Edge. class, Network. Factory. BINARY); • Export: Network. Recorder Network. Recroder recorder = new Network. Recorder( Network. Recroder. BINARY, “network. dl”, this); recorder. record(node. List, "tick: " + get. Tick. Count(), Network. Recorder. BINARY); recorder. write(); 23

Homework D Download and install the Net. IPD model from the course website (www.

Homework D Download and install the Net. IPD model from the course website (www. icr. ethz. ch/teaching/compmodels/netipd). The model extends the IPD introduced in the Re. Past tutorial to a network topology. It has three topologies implemented, with the first two (FRN and FRNE) described in (Cohen et al. , 1999). The third topology (PN) is a parametrized network and uses the „Beta“-parameter. D 1) Perform simulation runs with the PN topology for different values of beta (at least 10), ranging from 0 to 1. For each value, perform 50 runs of the model with different random seeds. Plot the percentage of runs where there is a TFT majority at the end of the 200 th step against the value of beta. D 2) Look at the implementation of the parametrized network. What topology described in the (Cohen et al. , 1999) paper does it resemble (a) for beta=0 and (b) for beta=1? D 3) What is your explanation for the results‘ variation with beta? 24

Submission format Exercise D 1 One file plot. <ext> (graphics or PDF) with your

Submission format Exercise D 1 One file plot. <ext> (graphics or PDF) with your plot Exercise D 2 One file called d 2. <ext> (text or PDF) with your answer Exercise D 3 One file called d 3. <ext> (text or PDF) with your answer Solutions should be sent by e-mail to weidmann@icr. gess. ethz. ch, with only the required files attached. Please do not put your answers directly in the text of your e-mail message. 25