Models of networks lab Cocalc for Python Use
Models of networks -- lab --
Cocalc for Python • Use https: //cocalc. com/ instead of downloading python • Create an account and send me an email: rgera@nps. edu to add you to the project 2
Co. Calc for Python (2) • There are three files • Open “create synthetic networks” 3
The world around us as a network • What categories do we have for networks? ØRandom networks (normal degree distribution) ØScale free (power-law degree distribution) 4
ERDŐS-RÉNYI RANDOM GRAPHS
Random graphs (Erdős-Rényi , 1959) • 6
Generating Erdős-Rényi random networks Reference for python: http: //networkx. lanl. gov/reference/generated/networkx. generators. random_graphs. erdos_r enyi_graph. html#networkx. generators. random_graphs. erdos_renyi_graph 7
WATTS-STROGATZ SMALL WORLD GRAPHS (1998)
Small worlds, between perfect order and chaos 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/target 1. html 9
Generating Watts-Strogatz networks http: //networkx. lanl. gov/reference/generated/networkx. generators. random_graphs. watts_strogatz_graph. html#networkx. generators. random_graphs. watts_strogatz_ graph 10
PREFERENTIAL ATTACHMENT MODEL (WE WILL CONSIDER THE BARABASI-ALBERT EXAMPLE)
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/Net. Logo 4/RAnd. Pref. Attachment. html
Scale Free networks • 13
Generating Barabasi-Albert networks http: //networkx. lanl. gov/reference/generated/networkx. generators. random_gra phs. barabasi_albert_graph. html#networkx. generators. random_graphs. baraba si_albert_graph 14
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) 15
The Malloy Reed Configuration model
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 models 17
A zoo of complex networks
Random, Small-World, Scale-Free Scale Free networks: 1. High degree heterogeneity 2. Various levels of modularity 3. Various levels of randomness Man made, “large world”: 19 http: //noduslabs. com/radar/types-networks-random-small-world-scale-free/
Python • References to the classes that exist in python: http: //networkx. lanl. gov/reference/generators. html 20
- Slides: 20