Emergent Network Models Prof. Lars-Erik Cederman Center for - - PowerPoint PPT Presentation

emergent network models
SMART_READER_LITE
LIVE PREVIEW

Emergent Network Models Prof. Lars-Erik Cederman Center for - - PowerPoint PPT Presentation

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,


slide-1
SLIDE 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.ch Nils Weidmann, CIS Room E.3, weidmann@icr.gess.ethz.ch http://www.icr.ethz.ch/teaching/compmodels Lecture, January 18, 2005

Emergent Network Models

slide-2
SLIDE 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
slide-3
SLIDE 3

3

Emergent social forms

1. Interaction patterns 2. Property configurations 3. Dynamic networks

  • 4. Actor structures
slide-4
SLIDE 4

4

  • 1. Emergent interaction patterns
  • Models of “emergent
  • rder” producing

configurations

  • Axelrod (1984, chap. 8):

“The structure of cooperation”

actor actor actor actor actor actor actor actor actor

slide-5
SLIDE 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 actor actor actor actor actor actor actor actor actor actor actor actor actor actor actor actor actor

slide-6
SLIDE 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-α

slide-7
SLIDE 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?
slide-8
SLIDE 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 H G F E 2 43 3 2 23 8 10 1 5 53 4 9 6

slide-9
SLIDE 9

9

Phase shift in random graphs

Erdös and Rényi 1959

Fraction of nodes in largest component

1 1

Average number

  • f links per node
slide-10
SLIDE 10

10

The small-world experiment

“Six degrees of separation”

Sharon, MA

Stanley Milgram

Omaha, NE

slide-11
SLIDE 11

11

Between order and randomness

Watts and Strogatz’s Beta Model

slide-12
SLIDE 12

12

Two degree distributions

p(k) p(k) k Normal distribution

log p(k) log k log p(k) log k

k Power law

slide-13
SLIDE 13

13

Scale-free networks

  • Barabási and Albert’s 1999

model of the Internet:

  • Constantly growing network
  • Preferential attachments:

– p(k) = k / Σi ki

slide-14
SLIDE 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

slide-15
SLIDE 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)
slide-16
SLIDE 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

slide-17
SLIDE 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.

slide-18
SLIDE 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

slide-19
SLIDE 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)

slide-20
SLIDE 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.

slide-21
SLIDE 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)

slide-22
SLIDE 22

22

Charting

  • As usual, but using NetSequenceGraph
  • Contains predefined statistics:
slide-23
SLIDE 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();

slide-24
SLIDE 24

24

Homework D

Download and install the NetIPD model from the course website (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?

slide-25
SLIDE 25

25

Submission format

Exercise D1 One file plot.<ext> (graphics or PDF) with your plot Exercise D2 One file called d2.<ext> (text or PDF) with your answer Exercise D3 One file called d3.<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
  • f your e-mail message.