Download presentation
Presentation is loading. Please wait.
Published byAlban Wilkerson Modified over 9 years ago
1
Introduction to Computational Modeling of Social Systems Prof. Lars-Erik Cederman Center for Comparative and International Studies (CIS) Seilergraben 49, Room G.2, lcederman@ethz.chlcederman@ethz.ch Nils Weidmann, CIS Room E.3, weidmann@icr.gess.ethz.chweidmann@icr.gess.ethz.ch http://www.icr.ethz.ch/teaching/compmodels Lecture, January 18, 2005 Emergent Network Models
2
2 Today’s agenda Overview: Emergent social forms Emergent-network models Graph theory Small Worlds Scale-Free Networks Repast’s network support NetIPD and Homework D
3
3 Emergent social forms 1.Interaction patterns 2.Property configurations 3.Dynamic networks 4.Actor structures
4
4 1. Emergent interaction patterns actor Models of “emergent order” producing configurations Axelrod (1984, chap. 8): “The structure of cooperation”
5
5 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
6
6 3. Emergent dynamic networks Most computational models treat networks as exogenous Recent exceptions: –Albert and Barabási’s scale-free networks –Economics and evolutionary game theory: e.g. Skyrms and Pemantle frequency degree d d-d-
7
7 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?
8
8 Elementary graph theory Links (edges) and nodes (vertices), G=(E, V) –Uni/Bidirectional graphs –(In/Out) Degree of a node, degree distribution –Weighted edges B A C K J D I HG F E 2 43 3 2 23 8 10 1 5 53 4 9 6
9
9 Phase shift in random graphs 01 Fraction of nodes in largest component Average number of links per node 1 Erdös and Rényi 1959
10
10 The small-world experiment Stanley Milgram Sharon, MA Omaha, NE “Six degrees of separation”
11
11 Between order and randomness Watts and Strogatz’s Beta Model
12
12 Two degree distributions p(k) k k Normal distributionPower law log p(k) log k log p(k) log k
13
13 Scale-free networks Barabási and Albert’s 1999 model of the Internet: Constantly growing network Preferential attachments: –p(k) = k / i k i
14
14 Creating nodes and edges Nodes Node nodeA = new DefaultNode(“A”); Node nodeB = new DefaultNode(“B”); Edge (hand coding) Edge edge = new DefaultEdge(nodeA, nodeB); nodeA.addOutEdge(edgeAB); nodeB.addInEdge(edgeAB); Edge (simplified way) Edge edge = EdgeFactory.createEdge(nodeA, nodeB); Edges can also labeled and given a strength Node and Edge are interfaces and specialized (agent) classes can easily be implemented A B Edge Node Direction
15
15 Node accessors addInEdge(Edge) and addOutEdge(Edge) Add an in or out edge to the node removeInEdge(Edge), removeOutEdge(Edge) Removes the specified edge from the list of in or out edges getInEdges() and getOutEdges() Gets an ArrayList of edges going in or out from the node hasEdgeFrom(Node) and hasEdgeTo(Node) Returns true if the node has an edge from or to the specified node, false otherwise getNodeLabel() and setNodeLabel(String)
16
16 Edge accessors getFrom() and getTo() Gets the node that this edge comes from or goes to setFrom(Node) and setTo(Node) Sets the from or to node getStrength() and setStrength(double) Gets/sets the strength of this edge getType() and setType(String) Gets the type of this edge getLabel() and setLabel(String) Gets/sets the label for this edge Typically distance or similarity To encode the type of relationship, e.g. a marriage
17
17 NetUtilities Contains some useful static methods for computing statistics or rearranging a network, e.g. calcDensity(List) Calculates density (ratio of arcs in network to maximum possible number of arcs) of passed network hasSelfLoops(List) Returns a boolean indicating whether the network contains self-loops (links from i -> i) randomRewire(ArrayList, 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.
18
18 Displaying networks Network2DDisplay : similar to any other display: public void buildModel() { GraphLayout layout = new DefaultGraphLayout(agentList, 500, 500); Network2DDisplay display = new Network2DDisplay(layout); dsurf.addDisplayableProbeable(display, "Display"); addSimEventListener(dsurf); dsurf.display(); } public void step() { dsurf.updateDisplay(); } Contains the list of nodes
19
19 Displaying nodes and edges Every node and edge must implement the Drawable2DNode and DrawableEdge interfaces Default implementations: –DefaultDrawableNode –DefaultDrawableEdge Can be parameterized with customized drawing code: NetworkDrawable (e.g. RectNetworkItem, OvalNetworkItem )
20
20 Graph layout By default ( DefaultGraphLayout ), nodes are positioned according to the x/y coordinates CircularGraphLayout position them on a circle Need to call layout.updateLayout() in step method.
21
21 Graph layout (cont.) FruchGraphLayout attempts to minimize the overall length of the edges according to their strength (spring-based simulation) Can be slow graphLayout = new FruchGraphLayout(...); Controller c = (Controller)getController(); c.addStopListener(graphLayout); c.addPauseListener(graphLayout); c.addExitListener(graphLayout)
22
22 Charting As usual, but using NetSequenceGraph Contains predefined statistics:
23
23 Data importing and exporting Import: NetworkFactory List list = NetworkFactory.getNetwork( “network.dl”, NetworkFactory.DL, MyNode.class, MyEdge.class, NetworkFactory.BINARY); Export: NetworkRecorder NetworkRecroder recorder = new NetworkRecorder( NetworkRecroder.BINARY, “network.dl”, this); recorder.record(nodeList, "tick: " + getTickCount(),NetworkRecorder.BINARY); recorder.write();
24
24 Homework D Download and install the NetIPD model from the course website (www.icr.ethz.ch/teaching/compmodels/models/netipd).www.icr.ethz.ch/teaching/compmodels/models/netipd The model extends the IPD introduced in the RePast 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. D1) 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 200th step against the value of beta. D2) 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? D3) What is your explanation for the results‘ variation with beta?
25
25 Submission format Exercise D1 One file plot. (graphics or PDF) with your plot Exercise D2 One file called d2. (text or PDF) with your answer Exercise D3 One file called d3. (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. weidmann@icr.gess.ethz.ch
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.