/
Models of networks (synthetic networks or generative models Models of networks (synthetic networks or generative models

Models of networks (synthetic networks or generative models - PowerPoint Presentation

startse
startse . @startse
Follow
355 views
Uploaded On 2020-06-23

Models of networks (synthetic networks or generative models - PPT Presentation

Prof Ralucca Gera Applied Mathematics Dept Naval Postgraduate School Monterey California rgeranpsedu Excellence Through Knowledge Learning Outcomes I dentify network models and explain their structures ID: 784467

degree random network networks random degree networks network nodes graph networkx model small probability edges node models world graphs

Share:

Link:

Embed:

Download Presentation from below link

Download The PPT/PDF document "Models of networks (synthetic networks o..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

Models of networks

(synthetic networks or generative models)

Prof. Ralucca Gera, Applied Mathematics Dept.Naval Postgraduate SchoolMonterey, Californiargera@nps.edu

Excellence Through Knowledge

Slide2

Learning Outcomes

Identify network models and explain their structures;Contrast networks and synthetic models;Understand how to design new network models (based on the existing ones and on the collected data)Distinguish methodologies used in analyzing networks.

Slide3

The world around us as a network

What do social networks look like?Watch this videoSynthetic models are used as reference/null models to compare and understand the structure of complex networks:E-R Random networks (normal degree distribution)Scale free (power-law degree distribution)Small worldVideo: https://www.youtube.com/watch?v=QUWds9gt6aE3

Slide4

The three papers for each of the models

“On Random Graphs I” by Paul Erdős and Alfed Renyi 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)

4

Slide5

Why care?

Epidemiology: A virus propagates much faster in scale-free networks.Vaccination of random nodes in scale free does not work, but targeted vaccination is very effectiveCreate synthetic networks to be used as null models: What effect does the degree distribution alone have on the behavior of the system? (answered by comparing to the configuration model)Create networks of different sizesNetworks of particular sizes and structures can be quickly and cheaply generated, instead of collecting and cleaning the data that takes time

Slide6

Reference network: Regular Lattice

The 1-dimensional lattice is the Harary graph H(n,r) or the Circulant graph start with an n-cycle, and each vertex is adjacent to r/2 vertices to the left, and r/2 vertices to the right. 6Source: http://mathworld.wolfram.com/CirculantGraph.html

Slide7

Reference network: Regular Lattice

7Source: http://mathworld.wolfram.com/CirculantGraph.htmla particular Circulant graph

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

Slide8

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 lattice structure.8Source: http://phys.org/news/2013-05-intriguing-state-previously-graphene-like-materials.html

Slide9

9

Erdős-Rényi Random Graphs(1959)

Slide10

Random graphs (Erdős-Rényi

, 1959)ERmodel : created at random with fixed parametersG(n, m): fix n (node count) and m (edge count)G(n,p): fix n and probability p of the edge existence between vertices (m is not fixed)The mean value of edges:

The average degree The distribution of finding a node of degree is binomial:Constructing using Gephi need Gephi’s plug-in. NetworkX has more synthetic models and classes

 

10

Slide11

Creating G(n,m)

To make a random network : take n nodes, m unlabeled edges randomly placed between the n verticesPut 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 11

Slide12

Creating G(n,m) – method 2

Method two and equivalent to the first:To make a random network : take n nodes, m pairs of nodes at random to form edges,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, …)

 12

Slide13

Creating G(n,p)

To create a random network : take n nodes, A fixed probability for the whole graphAttach edges at random to the nodes, with the probability p 13

Degree distribution for both for and  

Slide14

Results about E-R graphs:

14Degree distribution: BinomialAverage path is small compared to n: , where is the average degreeComparable to the of the observed networks

Clustering coefficient is small: (The probability that two neighbors of a node are connected is equal to the probability of any two random nodes being connected)However observed networks have high clustering. 

Slide15

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 ER(n,p)

Slide16

Generating Erdős-Rényi

ER(n,m) 16

Slide17

Generating Erdős-Rényi

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

Slide18

18

The Random Geometric model

Slide19

Random Geometric Model

Again the connections are created at random, but based on proximity (such as ad hoc networks)Proximity is relevant: for each node , the edge is created with a probability if , for given fixed distance r.There is no perfect model for the world around us, not even for specific types of networks

 19

Slide20

An example of a random geometric

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

Slide21

Creating it in Python

21https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.generators.geometric.random_geometric_graph.html#networkx.generators.geometric.random_geometric_graph

Slide22

22

The Malloy Reed Configuration model(1995)

Slide23

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 models23

Slide24

The MR configuration model

A random graph model created based on a degree sequence of choice: 4, 3, 2, 2, 2, 1, 1, 124Step 1:Step 2:Or thisstep 2:

Slide25

Mathematical properties

Let and be two nodes. Expectation of to be an edge : Pick an edge out of the m edges in G: the probability that the left end node is i is (its degree), and the probability that the right end node is j, is ), and so:

(used 2m since each edge is counted from each of its two ends)Expectation of a multi edge Given that then the probability that it will be an edge again is

, and so the probability of both happening is

w

hich simplifies to:

 

25

Slide26

Mathematical properties (parallel edges)

Average degree: and the average of their squares:

Then, the expected number of parallel edges is: 26http://tuvalu.santafe.edu/~aaronc/courses/5352/csci5352_2017_L4.pdf

Slide27

Mathematical properties (loops)

1. Recall that for parallel edges, Thus the expectation of a loop

2. And the equation on the previous page simplifies to the expected number of loops being Conclusion: Since the variables in the equation in 2. above are constant with respect to the size of the network,  only a small fraction of edges are loops or parallel edges

 

27

http://tuvalu.santafe.edu/~

aaronc/courses/5352/csci5352_2017_L4.pdf

o

ne edge of node

has been used

 

Slide28

Generating it in Python

28https://networkx.github.io/documentation/networkx-1.10/reference/generated/networkx.generators.degree_seq.configuration_model.html

Slide29

29

Part 2

Slide30

Coding it in CoCalc

Go to www.CoCalc.com and create an account using your NPS email Create your new folder to copy the codeOpen “MA4404-2019” folder to copy its contents to your new folder.30

Slide31

Copy contents to NEW folder

31

Slide32

Make a copy

Choose “CreateSyntheticNetworks.ipynb”Notice projects, folders & files32

Slide33

Create ER networks

33

Slide34

34

Watts-StrogatzSmall World Graphs(1998)

Slide35

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 (one type of structure):my friend’s friend isalways my friendsmall world:mostly structuredwith a few randomconnections

random graph:

all connections

h

appen at

random

Source: Watts, D.J.,

Strogatz

, S.H

. (

1998) Collective dynamics of 'small-world' networks. Nature 393:440-442.

Slide36

Small worlds, between

order and chaosthe graph on the left has order (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.htmlHigh clustering: .75High average path:

 Low clustering: p (probability)Low average path:  Small worlds

Slide37

Avg

path and avg clustering  37https://pdfs.semanticscholar.org/8c4c/455de44fa99e73e79d6fddf008ca6ae0f9aa.pdf

Variations of

avg

path and clustering as a function of the rewiring probability

p

Slide38

Generating Watts-Strogatz WS (n, k, alpha)

38Alpha is the rewiring probability

Slide39

Generating Watts-Strogatz networks

39http://networkx.lanl.gov/reference/generated/networkx.generators.random_graphs.watts_strogatz_graph.html#networkx.generators.random_graphs.watts_strogatz_graph.15 is the rewiring probability

Slide40

40

Barabási-AlbertScale free model (1999)

Slide41

Network growth & resulting structure

Random attachment: new node picks any existing node to attach toPreferential/fitness attachment: new node picks from existing nodes according to their degrees/fitness (high preference for high degree/fitness)http://projects.si.umich.edu/netlearn/NetLogo4/RAndPrefAttachment.html

Slide42

Scale-free

Scale-free networks are a type of small worldWhether static or evolutionary, they have A power-law degree distribution: Common ways to grow the network: Preferential attachment based on degree (for Barabási-Albert type the probability of attachment

, where is the degree of node ).Preferential attachment based on fitness (preassigned values).  

Slide43

Power law networks

Many real world networks contain hubs: highly connected nodesUsually 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 node

Degree (number

of

edges)

number of nodes

of that degree

Slide44

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.

A deviation from a straight line could indicate a different distribution:exponentiallognormal 

log of the degree

Log of number of nodes of that

degree

Slide45

Fitting distributions

45Node (frame) and edge (inset) counts of European Airline Transportation Network's layers with distribution fitting.http://faculty.nps.edu/rgera/ANGEL.html

Slide46

Fitting distributions

46European Airline Transportation Network's multilayer network:Degree histogram of the multiplexes with the log scale in the inset. Upper right: average shortest path, lower right: centrality coefficient, per nodehttp://faculty.nps.edu/rgera/ANGEL.html

Slide47

Scale Free networks

One example is introduced by Albert Laslo Barabási and Reka Albert (BA model) as a degree based preferential attachment :Start with a small set of nodes () and random edgesAttach new nodes one at the time;each with the same fixed number of new edges, attaching to the existing nodes in the network, with preference for high degrees (once the high degrees appear)https://www.youtube.com/watch?v=5YdkhWB_uYQNetwork growth (measured by node count).Not the only way to get scale–free networks! 47

Slide48

Generating Barabasi-Albert

48

Slide49

Generating Barabasi-Albert networks

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

Slide50

Modified BA

Many modifications of this model exists, based on:Nodes “retiring” and losing their status/outdatedNodes 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. It is a simple model (allows consistent research) that has growth and preferential attachmentOne can add more conditions to this basic model, in order to mimic reality50

Slide51

51

A zoo of complex networks

Slide52

Random, Small-World, Scale-Free

52http://noduslabs.com/radar/types-networks-random-small-world-scale-free/Man made,“large world”:Scale Free networks:High degree heterogeneityVarious levels of modularityVarious levels of randomness

Slide53

Main References

Newman “The structure and function of complex networks” (2003)Estrada “The structure of complex Networks” (2012)Barabasi “Network Science” (online: http://barabasi.com/networksciencebook/)References to the classes that exist in python:http://networkx.lanl.gov/reference/generators.html53

Slide54

Back to coding in CoCalc

54