models of networks (synthetic networks or generative...

48
Models of networks (synthetic networks or generative models): Random, Small-world, Scale-free, Configuration model and Random geometric model By: Ralucca Gera, NPS Excellence Through Knowledge

Upload: others

Post on 10-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Models of networks(synthetic networks or generative models):Random, Small-world, Scale-free, Configuration model

and Random geometric model

By: Ralucca Gera, NPSExcellence Through Knowledge

Page 2: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

The world around us as a network

• What do social networks look like?Watch this video

• What categories do we have for networks?Random networks (normal degree distribution)Scale free (power-law degree distribution)

2

Page 3: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

The three papers for each of the models

• “On Random Graphs I” by Paul Erdos and AlfedRenyi in Publicationes Mathematicae (1958) Times cited: 3, 517 (as of January 1, 2015)

• “Collective dynamics of ‘small-world’ networks” by Duncan Watts and Steve Strogatz in Nature, (1998) Times cited: 24, 535 (as of January 1, 2015)

• “Emergence of scaling in random networks” by László Barabási and Réka Albert in Science, (1999)Times cited: 21, 418 (as of January 1, 2015)

3

Page 4: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Why understand the structure of networks?

• Applications such as epidemiology: Viruses propagate much faster in scale-free networks. Vaccination of random nodes in scale free does not work, but targeted vaccination is very effective

• Thus, we can create models that captures the structure which facilitates research: – Create fast networks of particular models can be quickly

and cheaply generated, instead of collecting and cleaning the data that takes time

– Promote understanding of the world around us: What effect does the degree distribution have on the behavior of the system?

Page 5: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Reference network: Regular Lattice

The 1-dimensional lattice is the Harary graph H(n,r) or the Circulant graph (1, 2, …, r)start with an n-cycle, and each vertex is adjacent to r/2 vertices to the left, and r/2 vertices to the right.

5Source: http://mathworld.wolfram.com/CirculantGraph.html

Page 6: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Reference network: Regular Lattice

6Source: http://mathworld.wolfram.com/CirculantGraph.html

a particular Circulant graph (1, 2, …, r):

Source: http://mathworld.wolfram.com/CirculantGraph.html

Page 7: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Reference network: Regular Lattice

• The higher dimensions are generalizations of these. An example is a hexagonal lattice is a 2-dimensional lattice:graphene, a single layer of carbon atoms with a honeycomb latticestructure.

7Source: http://phys.org/news/2013-05-intriguing-state-previously-graphene-like-materials.html

Page 8: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

ERDŐS-RÉNYIRANDOM GRAPHS

Page 9: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Random graphs (Erdős-Rényi , 1959)

• RG is a model in which some specific set of parameter takes fixed values, and the network is created at random using these values.

• Two main examples:– G(n,p): fix n and probability p of the edges

between vertices. The number of edges is not fixed. This is the default construction.

– G(n, m): fix n and m

– The mean value of edges:

9

Page 10: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

G(n,m)

• To make a random network: take n nodes, m unlabeled edges, and put the edges down randomly between the n vertices

• Put the graph in a box, make another one and put it in the box, and another one…

• Pull one network at random out of the box and it will have a Normal Degree Distribution (classic degree distribution): almost everyone has the same number of friends on average

10

Page 11: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

G(n,m)

Method two and equivalent to the first:• To make a random network:

– take n nodes, – m pairs at random– place the edges between the randomly chosen nodes

• The average degree: , where is often used to denote the degree of vertex i in complex networks (enumerate the vertices, 1, 2, …)

11

Page 12: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

G(n,p)

• To make a random network: – take n nodes, – A fixed probability p– Attach edges at random to the nodes, with the

probability p

12

Page 13: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Degree distribution is Normal

13

Both for G(n,p) and G(n,m)

Page 14: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Erdős-Rényi random networks

• There might be some that are a bit different that don’t have this degree distribution, but there are so few of them, that you will not pull one out of this box

• The universe doesn’t produce these (they are made by us, they are mathematically constructed) rather scale-free

• We will construct them using Gephi and NetworkX. For Gephi you will need the plug-in. We will practice with NetworkX since there are more synthetic models and classes available in NetworkX

14

Page 15: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

• ER graphs are models of a network in which some specific set of parameters take fixed values, but the construction of the network is random (see below in Gephi)

15

Generating Erdős-Rényi random networks.

Page 16: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Erdős-Rényi

16

Page 17: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Erdős-Rényi random networks

17

Reference for python: http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs.erdos_renyi_graph.html#networkx.generators.random_graphs.erdos_renyi_graph

Page 18: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

WATTS-STROGATZSMALL WORLD GRAPHS(1998)

Page 19: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Small worlds, between perfect order and chaos

19

the first graph is completely ordered (probability p =0), the graph in the middle is a "small world" graph (0 < p < 1), the graph at the right is complete random (p=1).

Source: http://www.bordalierinstitute.com/target1.html

Page 20: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Small world models

• Duncan Watts and Steven Strogatz small world model: a few random links in an otherwise structured graph make the network a small world: the average shortest path is short

regular lattice:my friend’s friend isalways my friend

small world:mostly structuredwith a few randomconnections

random graph:all connectionsrandom

Source: Watts, D.J., Strogatz, S.H. (1998) Collective dynamics of 'small-world' networks. Nature 393:440-442.

Page 21: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

small worlds

Small worlds– a friend of a friend is also frequently a friend

(clustering coefficient)– but only small number of hops separate any

two people in the world (small average path)

Arnold Schwarzenegger. – thomashawk, Flickr; http://creativecommons.org/licenses/by-nc/2.0/deed.en

Page 22: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Watts-Strogatz

22

Page 23: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Watts-Strogatz networks

23

http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs.watts_strogatz_graph.html#networkx.generators.random_graphs.watts_strogatz_graph

Page 24: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

PREFERENTIAL ATTACHMENT MODEL (WE WILL CONSIDER THE BARABASI-ALBERT EXAMPLE)

Page 25: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Scale-free

• Scale-free networks are a type of small world networks.

• They have – A power-law degree distribution:

– Static or evolutionary• One way to create them is through preferential

attachment, but it is not the only way. • We will particularly look at Barabasi-Albert type

(one of the most common ones)

Page 26: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Power law networks

• Many real world networks contain hubs: highly connected nodes

• Usually the distribution of edges is extremely skewed

many nodes with small degree

fat tail: a few nodes with a very large degree

no “typical” degree

Degree (number of edges)

num

ber o

f nod

es o

f tha

t deg

ree

Page 27: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

But is it really a power-law?

• A power-law will appear as a straight line on a log-log plot: let be the count of vertices of degree k.

ln ln

• A deviation from a straight line could indicate a different distribution:– exponential– lognormal

log of the degree

Log

of n

umbe

r of n

odes

of t

hat d

egre

e

Page 28: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Network growth & resulting structure

• random attachment: new node picks any existing node to attach to

• preferential attachment: new node picks from existing nodes according to their degrees (high preference for high degree)

http://projects.si.umich.edu/netlearn/NetLogo4/RAndPrefAttachment.html

Page 29: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Scale Free networks

• One example is the one introduced by Barabasi-Albert based on preferential attachment:– Start with a small set of nodes ( ) and no edges– Attach new nodes one at the time;

• each with the same fixed number of new edges, attaching to the existing ones in the network, with preference for high degrees (once the high degrees appear)

https://www.youtube.com/watch?v=5YdkhWB_uYQThis is not the only way to get scale–free networks!

29

Page 30: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Barabasi-Albert

30

Page 31: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Barabasi-Albert

31

Page 32: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Generating Barabasi-Albert networks

32

http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs.barabasi_albert_graph.html#networkx.generators.random_graphs.barabasi_albert_graph

Page 33: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Modified BA

• Many modifications of this model exists, based on:– Nodes “retiring” and losing their status– Nodes disappearing (such as website going down)– Links appearing or disappearing between the existing

nodes (called internal links)– Fitness of nodes (modeling newcomers like Google)

• Most researchers still use the standard BA model when studying new phenomena and metrics. Why? It is a simple model, and it was the first model that brought in growth (as well as preferential attachment)

33

Page 34: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

The Malloy Reed Configuration model

Page 35: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

The configuration model

• A random graph model created based on Degree sequence of choice (can be scale free)

• Maybe more than degree sequence is needed to be controlled in order to create realistic models35

Page 36: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

The Random Geometric model

Page 37: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Random Geometric Model

• Again the connections are created at random, but based on proximity rather than preferential attachment (such as ad hoc networks)

• Recall that BA was introduced based on the data obtained from the Web, where physical proximity is irrelevant.

• But if one would want to model something like the Internet, then proximity is relevant

• There is no perfect model for the world around us, not even for specific types of networks

• No model has been introduced for the Internet37

Page 38: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

An example of a random geometric

38https://www.youtube.com/watch?v=NUisb1-INIE

Page 39: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

A zoo of complex networks

Page 40: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Random, Small-World, Scale-Free

40http://noduslabs.com/radar/types-networks-random-small-world-scale-free/

Man made,“large world”:

Scale Free networks:1. High degree heterogeneity2. Various levels of modularity3. Various levels of randomness

Page 41: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Networks and their degree distributions

We tend to characterize networks by their degree distributions:

– Random graphs iff Poisson degree distribution– Scale free iff power-law degree distribution.But they are not! Rather:– If G is a random graphs, then G has Poisson degree

distribution– If G is scale free, then G most probably has a

power-law degree distribution.– If G was constructed using preferential attachment,

then G has a power-law degree distribution.41

Page 42: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

16

54

6367

2

94

number ofnodes found

Power-law graph

Page 43: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

93

number ofnodes found

13

711

1519

Poisson distribution

Page 44: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Power-law networks are robust to random breakdown

Page 45: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

But are especially vulnerable to targeted attack

• Targeting and removing hubs can quickly break up the network

Page 46: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

mike

In social networks, it’s nice to be a hub

Page 47: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

But it depends on what you’re sharing…

Page 48: Models of networks (synthetic networks or generative models)faculty.nps.edu/...SyntheticModelsComplexNetworks.pdf · •“Collective dynamics of ‘small-world’ networks” by

Python

• References to the classes that exist in python:http://networkx.lanl.gov/reference/generators.html

48