Hussein was last spotted kissing a baby in Baghdad in April 2003, and then his trace went cold.
Designed a deck of cards, each card engraved with the images of the 55 most wanted.
shows the strong predictive power of networks.
underlies the need to obtain accurate maps of the networks we aim to study;
and the often heroic difficulties of the mapping process.
demonstrates the remarkable stability of these networks
shows that the choice of network we focus on makes a huge difference:
2005年9月1日,中情局内部关于猎杀本·拉登任务的布告栏上贴出了如下信息:由于关押囚犯的强化刑讯已经没有任何意义,“我们只能继续跟踪科威特”。
中情局自此开始了对科威特长达数年的跟踪,最终成功窃听到了他本·拉登之间的移动电话,从确定了他的位置并顺藤摸瓜找到了本·拉登在巴基斯坦的豪宅
,再经过9个月的证实、部署,于2011年5月1日由海豹突击队发动突袭、击毙本·拉登。
DUE TO INTERCONNECTIVITY
An important theme of this class:
we must understand how network structure affects the robustness of a complex system.
develop quantitative tools to assess the interplay between network structure and the dynamical processes on the networks, and their impact on failures.
We will learn that failures reality failures follow reproducible laws, that can be quantified and even predicted using the tools of network science.
NETWORKS AT THE HEART OF
[adj., v. kuh m-pleks, kom-pleks; n. kom-pleks] –adjective
Source: Dictionary.com
a scientific theory which asserts that some systems display behavioral phenomena that are completely inexplicable by any conventional analysis of the systems’ constituent parts. These phenomena, commonly referred to as emergent behaviour, seem to occur in many complex systems involving living organisms, such as a stock market or the human brain.
Source: John L. Casti, Encyclopædia Britannica
Behind each system studied in complexity there is an intricate wiring diagram, or a network, that defines the interactions between the component.
Graph theory: 1735, Euler
Social Network Research: 1930s, Moreno
Communication networks/internet: 1960s
Ecological Networks: May, 1979.
While the study of networks has a long history from graph theory to sociology, the modern chapter of network science emerged only during the first decade of the 21st century, following the publication of two seminal papers in 1998 and 1999.
The explosive interest in network science is well documented by the citation pattern of two classic network papers, the 1959 paper by Paul Erdos and Alfréd Rényi that marks the beginning of the study of random networks in graph theory [4] and the 1973 paper by Mark Granovetter, the most cited social network paper [5].
Both papers were hardly or only moderately cited before 2000. The explosive growth of citations to these papers in the 21st century documents the emergence of network science, drawing a new, interdisciplinary audience to these classic publications.
The architecture of networks emerging in various domains of science, nature, and technology are more similar to each other than one would have expected.
The human genome project, completed in 2001, offered the first comprehensive list of all human genes.
Terrorism is one of the maladies of the 21st century, absorbing significant resources to combat it worldwide.
Network thinking is increasingly present in the arsenal of various law enforcement agencies in charge of limiting terrorist activities.
Using social networks to capture Saddam Hussein
While the H1N1 pandemic was not as devastating as it was feared at the beginning of the outbreak in 2009, it gained a special role in the history of epidemics: it was the first pandemic whose course and time evolution was accurately predicted months before the pandemic reached its peak.
in the fall of 2010 in China, infecting over 300,000 phones each day, closely followed the predicted scenario.
The human brain, consisting of hundreds of billions of interlinked neurons, is one of the least understood networks from the perspective of network science.
The reason is simple:
Driven by the potential impact of such maps, in 2010 the National Institutes of Health has initiated the Connectome project, aimed at developing the technologies that could provide an accurate neuron-level map of mammalian brains.
Can one walk across the seven bridges and never cross the same bridge twice and get back to the starting place?
COMPONENTS OF A COMPLEX SYSTEM
network often refers to real systems
Language: (Network, node, link)
graph: mathematical representation of a network
Language: (Graph, vertex, edge)
The choice of the proper network representation determines our ability to use network theory successfully.
In some cases there is a unique, unambiguous representation. In other cases, the representation is by no means unique.
For example, the way we assign the links between a group of individuals will determine the nature of the question we can study.
If you connect individuals that work with each other, you will explore the professional network.
If you connect those that have a romantic and sexual relationship, you will be exploring the sexual networks.
If you connect individuals based on their first name (all Peters connected to each other), you will be exploring what?
%matplotlib inline
import matplotlib.pyplot as plt
import networkx as nx
Gu = nx.Graph()
for i, j in [(1, 2), (1, 4), (4, 2), (4, 3)]:
Gu.add_edge(i,j)
nx.draw(Gu, with_labels = True)
import networkx as nx
Gd = nx.DiGraph()
for i, j in [(1, 2), (1, 4), (4, 2), (4, 3)]:
Gd.add_edge(i,j)
nx.draw(Gd, with_labels = True, pos=nx.circular_layout(Gd))
nx.draw(Gu, with_labels = True)
nx.draw(Gd, with_labels = True, pos=nx.circular_layout(Gd))
import numpy as np
x = [1, 1, 1, 2, 2, 3]
np.mean(x), np.sum(x), np.std(x)
(1.6666666666666667, 10, 0.7453559924999299)
# 直方图
plt.hist(x)
plt.show()
from collections import defaultdict, Counter
freq = defaultdict(int)
for i in x:
freq[i] +=1
freq
defaultdict(int, {1: 3, 2: 2, 3: 1})
freq_sum = np.sum(freq.values())
freq_sum
6
px = [float(i)/freq_sum for i in freq.values()]
px
[0.5, 0.3333333333333333, 0.16666666666666666]
plt.plot(freq.keys(), px, 'r-o')
plt.show()
Aij=1 if there is a link between node i and j
Aij=0 if there is no link between node i and j
plt.figure(1)
plt.subplot(121)
pos = nx.nx.circular_layout(Gu) #定义一个布局,此处采用了spring布局方式
nx.draw(Gu, pos, with_labels = True)
plt.subplot(122)
nx.draw(Gd, pos, with_labels = True)
bipartite graph
(or bigraph) is a graph whose nodes can be divided into two disjoint sets U and V such that every link connects a node in U to one in V; that is, U and V are independent sets.
import numpy as np
edges = [('甲', '新辣道'), ('甲', '海底捞'), ('甲', '五方院'),
('乙', '海底捞'), ('乙', '麦当劳'), ('乙', '俏江南'),
('丙', '新辣道'), ('丙', '海底捞'),
('丁', '新辣道'), ('丁', '五方院'), ('丁', '俏江南')]
h_dic = {i:1 for i,j in edges}
for k in range(5):
print(k, 'steps')
a_dic = {j:0 for i, j in edges}
for i,j in edges:
a_dic[j]+=h_dic[i]
print(a_dic)
h_dic = {i:0 for i, j in edges}
for i, j in edges:
h_dic[i]+=a_dic[j]
print(h_dic)
0 steps {'俏江南': 2, '海底捞': 3, '麦当劳': 1, '新辣道': 3, '五方院': 2} {'丙': 6, '甲': 8, '乙': 6, '丁': 7} 1 steps {'俏江南': 13, '海底捞': 20, '麦当劳': 6, '新辣道': 21, '五方院': 15} {'丙': 41, '甲': 56, '乙': 39, '丁': 49} 2 steps {'俏江南': 88, '海底捞': 136, '麦当劳': 39, '新辣道': 146, '五方院': 105} {'丙': 282, '甲': 387, '乙': 263, '丁': 339} 3 steps {'俏江南': 602, '海底捞': 932, '麦当劳': 263, '新辣道': 1008, '五方院': 726} {'丙': 1940, '甲': 2666, '乙': 1797, '丁': 2336} 4 steps {'俏江南': 4133, '海底捞': 6403, '麦当劳': 1797, '新辣道': 6942, '五方院': 5002} {'丙': 13345, '甲': 18347, '乙': 12333, '丁': 16077}
def norm_dic(dic):
sumd = np.sum(list(dic.values()))
return {i : dic[i]/sumd for i in dic}
h = {i for i, j in edges}
h_dic = {i:1/len(h) for i in h}
for k in range(100):
a_dic = {j:0 for i, j in edges}
for i,j in edges:
a_dic[j]+=h_dic[i]
a_dic = norm_dic(a_dic)
h_dic = {i:0 for i, j in edges}
for i, j in edges:
h_dic[i]+=a_dic[j]
h_dic = norm_dic(h_dic)
print(a_dic)
{'海底捞': 0.2636544282409802, '俏江南': 0.17011696374819205, '五方院': 0.20624908818768029, '新辣道': 0.2861876476571226, '麦当劳': 0.07379187216602481}
B = nx.Graph()
users, items = {i for i, j in edges}, {j for i, j in edges}
for i, j in edges:
B.add_edge(i,j)
h, a = nx.hits(B)
print({i:a[i] for i in items} )
# {j:h[j] for j in users}
{'麦当劳': 0.036895936147322755, '海底捞': 0.13182721414423623, '俏江南': 0.08505848191154151, '五方院': 0.10312454403576717, '新辣道': 0.14309382376113222}
import networkx as nx
Gp = nx.DiGraph()
edges = [('a', 'b'), ('a', 'c'), ('b', 'd'), ('b', 'e'), ('c', 'f'), ('c', 'g'),
('d', 'h'), ('d', 'a'), ('e', 'a'), ('e', 'h'), ('f', 'a'), ('g', 'a'), ('h', 'a')]
for i, j in edges:
Gp.add_edge(i,j)
nx.draw(Gp, with_labels = True, font_size = 25, font_color = 'blue', alpha = 0.5,
pos = nx.kamada_kawai_layout(Gp))
#pos=nx.spring_layout(Gp, iterations = 5000))
steps = 11
n = 8
a, b, c, d, e, f, g, h = [[1.0/n for i in range(steps)] for j in range(n)]
for i in range(steps-1):
a[i+1] = 0.5*d[i] + 0.5*e[i] + h[i] + f[i] + g[i]
b[i+1] = 0.5*a[i]
c[i+1] = 0.5*a[i]
d[i+1] = 0.5*b[i]
e[i+1] = 0.5*b[i]
f[i+1] = 0.5*c[i]
g[i+1] = 0.5*c[i]
h[i+1] = 0.5*d[i] + 0.5*e[i]
print(i+1,':', a[i+1], b[i+1], c[i+1], d[i+1], e[i+1], f[i+1], g[i+1], h[i+1])
1 : 0.5 0.0625 0.0625 0.0625 0.0625 0.0625 0.0625 0.125 2 : 0.3125 0.25 0.25 0.03125 0.03125 0.03125 0.03125 0.0625 3 : 0.15625 0.15625 0.15625 0.125 0.125 0.125 0.125 0.03125 4 : 0.40625 0.078125 0.078125 0.078125 0.078125 0.078125 0.078125 0.125 5 : 0.359375 0.203125 0.203125 0.0390625 0.0390625 0.0390625 0.0390625 0.078125 6 : 0.1953125 0.1796875 0.1796875 0.1015625 0.1015625 0.1015625 0.1015625 0.0390625 7 : 0.34375 0.09765625 0.09765625 0.08984375 0.08984375 0.08984375 0.08984375 0.1015625 8 : 0.37109375 0.171875 0.171875 0.048828125 0.048828125 0.048828125 0.048828125 0.08984375 9 : 0.236328125 0.185546875 0.185546875 0.0859375 0.0859375 0.0859375 0.0859375 0.048828125 10 : 0.306640625 0.1181640625 0.1181640625 0.0927734375 0.0927734375 0.0927734375 0.0927734375 0.0859375
G = nx.DiGraph(nx.path_graph(10))
pr = nx.pagerank(G, alpha=0.9)
pr
{0: 0.06181813973848581, 1: 0.11515299000945314, 2: 0.1100340840842764, 3: 0.10714737750289352, 4: 0.10584740866489117, 5: 0.10584740866489117, 6: 0.10714737750289352, 7: 0.11003408408427638, 8: 0.11515299000945314, 9: 0.061818139738485794}
A path is a sequence of nodes in which each node is adjacent to the next one
- In a directed network, the path can follow only the direction of an arrow.
The distance (shortest path, geodesic path) between two nodes is defined as the number of edges along the shortest path connecting them.
If the two nodes are disconnected, the distance is infinity.
Diameter dmax is the maximum distance between any pair of nodes in the graph.
The path with the shortest length between two nodes (distance).
The average of the shortest paths for all pairs of nodes.
有向网络当中的dij数量是链接数量L的2倍
无向网络当中的dij数量是链接数量L
A path with the same start and end node.
洞在哪里?
洞在桥下!
has a path from each node to every other node and vice versa (e.g. AB path and BA path).
it is connected if we disregard the edge directions.
Strongly connected components can be identified, but not every node is part of a nontrivial strongly connected component.
万维网的蝴蝶结模型🎀 bowtie model
triangles 三角形 triplets 三元组
G1 = nx.complete_graph(4)
pos = nx.spring_layout(G1) #定义一个布局,此处采用了spring布局方式
nx.draw(G1, pos = pos, with_labels = True)
print(nx.transitivity(G1))
1.0
G2 = nx.Graph()
for i, j in [(1, 2), (1, 3), (1, 0), (3, 0)]:
G2.add_edge(i,j)
nx.draw(G2,pos = pos, with_labels = True)
print(nx.transitivity(G2))
# 开放三元组有5个,闭合三元组有3个
0.6
G3 = nx.Graph()
for i, j in [(1, 2), (1, 3), (1, 0)]:
G3.add_edge(i,j)
nx.draw(G3, pos =pos, with_labels = True)
print(nx.transitivity(G3))
# 开放三元组有3个,闭合三元组有0个
0.0
THREE CENTRAL QUANTITIES IN NETWORK SCIENCE
Fan Chung & Linyuan Lu, The average distance in random graphs with given expected degree,. PNAS, 19, 15879-15882 (2002).
A.-L.Barabási,R.Albert,H.Jeong Mean-field theory for scale-free random networks. Physica A 272, 173–187 (1999).
Controllability of Complex Networks
Liu Y Y, Slotine J J, Barabási A L. Nature, 2011, 473(7346): 167-173.