Complex Networks Theory Notes
Complex Networks Theory Notes
798
672
977
606 1 539
202
823
588
930 329
120
68 312
510
144 430 926 946 394
906 57
258
659 699 187
425
605
451 612 988 688
860
629
383
386 842
594 679
306 301 719
180
117 192
735 891 251
496 761 56 361
972 872 300 746
432 309
43 712
462 670
838 899
437 472
897 111 281 87
46 691 883
890 412 470 232
30
622 868 997
827 948 175 968
596 488 759 366
706 566 749 960 886
453
664 962 919 878
935 152
851 324 789 516
685 19
316 223 873443 34 315
138 520 435646 266
252 235 649 711 517
83 903 933 139 846 969 724
762 797 263
297 785 467
49 427
254 748 351
914
865 773 271 597
414
105 219 951
779 194 805 970
159 807 647
179 610 352
888 143 415
754 150 959 741 804
487 922 729 777 945 814
546
177 330 864 651
713 359 21
308 155
953 48 221 166
887 840 514 683 106 422
31 955 799
319 989 967
570 979
94 191
269 645 981 637 334 186
491 421 454 917 591
796 905 782
806 658 340
613
404 525 973
896 717 726 74
908 336 124 923
188 17 705 829
54 207 122 907 755
671 465
682 787 833
298 565 701 58 976
267
966 413 676
376 937 357 198
551 375 916 129
484 22 326
971
292
702 615 898 677 920
964 924 408 495
581 769
656 881 821 574
475 556 695
661
60 730 680
480 557 478 912 483 205
325 763 956 249
189 770 673
742
53
178 562 904 751
540
463
505 247 687 206
812
608 947 185 311 665
439 396 893
541
140 616 110
163885 515 776
199 599
857 884 784
373 716 374
602
371
745 245 213
547 875
125 550 932 509 825
497 795 372
617 320
928 93 625 228
843 534 134 674 335
304 131
542 828 295
468 165
950 728
808 368
406
279 27
9 400
201
996 618 184 631
874 583
367 723
70
580 337 339
739 362 663 399
264 248
98 604 630
95 990 328
901 402
241 75
469 346 837
211 858 499 792
15 513 869 548 59 236
302 810
240 576 826
975 867 473
809
628
343 983
944 482 703
433 174 895 498
786 552 693 648 781 32 911
13 667 429
740
980 555 486
62 527 714 460
277 569 519
445 927 154 642
530 365 181 401
653 419 508 291 272 985
715 913 317
803 112
182 758 852 882 643
265 322 952 771 169 609
464 528 10
476 338 100
38 848 364
44 627 378 811
6
614 635
348 925
363 780 471
294 353 590
135
536 733
727 994
78 126 377 403 931
16 287 76 747
839 793 696
289 176 800 456
299 831 554 987 506
310 764
501 20 288 866
392 426 47
190 449 636 333 650
718 720
704 280 563
900 261 442 652 492 545
293 707 611 193 936 543
732 35 578 167 153
601 85 915 170 879 489 160
388 522
791 305 395 587
963
11
420 356 861 560 466
350 941 358 760 708 255
666
634 532 417 568
197 986 621 149
709 398 148 641
841 91 765
405 162 579
815 586 561
256 567
832 813 222
341 459
778 250 849
239 103 998 101
44061 409 118 285
217 452 698 984
360 553 381
801
303 918
234 296 675 870
92 86
481524 63 854 518
196 744
638 438 662
71 342 114
689
80 640
743 323 526 598 173
90 824
512 626
238 686 278 89
259 974 273 783 644
500 284
957 136
995 276 257 575 37 229
42 102 55 531 921 737 544
571 909 130
835 200 385
736 529
485 455 12 158 390 347 954
592 282 816 564 790 332
318 133 584 286 369
195
632 535 79 183 25
208 260 39 750
397 243 107
507 725
834 142
321 847 132 623 387 766
768 410 880
147 242
283 244 942 992 2
474 845
853 600 127 830 210 391 146 493
461 104 444 418
220
504 447 99 436
327 477
820 7 313 84 458
836 67 314
354
690 227 119 66 151 934
734 64 108 752 654
441 949 965 157
82 5 40 41 214
775 929
850
274 26 731 77
502 619 137 982 511 14
123 660 978 1000
231 558 156 33
355 331 537 721 772
844 237
767 822
490 262 45 991 577 428 141 993 503
999 756
36 855757
203 894669
958 69 700 607
29 692 121
856 172
96 407
216 344 910 523 268
389 697 876
225
585 657
889 161 97
233 307
204 28 678
171
88 212 446 450
681 589 559
4 684
961 224
788 51 349
128 694 494
226 862 633
424
859 794 818
892 738 379
145 549
722 50
246
940 411
3 573 47918
871 270 116 603
655
109
52 168
215 115
582
290 538
380
817 275 593
81 521
943 802 423
164
620 73
345
533 939
863
595 668
572 382
639
253384 113
624 431
370
ACC Coolen
Department of Mathematics
King’s College London
2
1 Introduction 4
7 Further topics 65
7.1 Watts-Strogatz and shifted-Poissonnian small-world networks . . . . . . . . . 65
7.2 Preferential attachment networks . . . . . . . . . . . . . . . . . . . . . . . . 67
7.3 Complexity – counting graphs . . . . . . . . . . . . . . . . . . . . . . . . . . 69
3
8 Appendices 72
8.1 Network software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.2 The Pearson correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.3 Properties of symmetric matrices . . . . . . . . . . . . . . . . . . . . . . . . 73
8.4 Diagonalisation of symmetric matrices . . . . . . . . . . . . . . . . . . . . . 75
8.5 Integral representation of the Kronecker δ-symbol . . . . . . . . . . . . . . . 76
8.6 The δ-distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.7 Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
8.8 The Lagrange method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9 Exercises 78
4
1. Introduction
The challenge of large data sets. In recent decades our ability to collect and store vast
amounts of quantitative data has increased dramatically. This includes socio-economic data,
such as social links between individuals or professional collaboration networks, consumer
preferences and commercial interactions, trade dependencies among corporations, credit
or insurance obligations between financial institutions. We have access to traffic data on
computer and telecommunication systems, satellite networks, the internet, electricity grids,
rail, road or air travel connections and distribution networks. We collect and process large
amounts of geological and meteorological data, data on sea levels, air and water pollution,
volcanic and seismic records, and sizes of polar and glacier ice sheets. Finally, we have seen
an explosion in recent years of biomedical data, such as experimental data on biochemical
processes and structures at cellular, subcellular and even molecular levels, the topologies
of complex composite signalling and information processing systems such as the brain or
the immune system, genomic and epigenetic data (gene expression levels, DNA sequences),
epidemiological data, and vast numbers of patient records with clinical information.
However, one tends to collect data for a reason. This reason is usually the desire to
understand the dynamical behaviour of the complex system that generated the data, to
predict with reasonable accuracy its future evolution and its response to perturbations or
interventions, or to understand how it was formed. We may want this for commercial gain,
to improve and optimise a system’s efficiency, to design effective regulatory controls, or
(in the case of medicine) to understand and cure diseases. For small and simple systems
the translation of observation into qualitative and quantitative understanding of design
and function is usually not difficult. In contrast, if we collect data on complex systems
with millions of nonlinearly interacting variables, just having a list of the parts and their
connections and observations of their collective patterns of behaviour is no longer enough to
understand how these systems work.
Networks as data reduction and visualisation tools. A first and useful step in modelling
structural data on complex many-variable systems is to visualise these systems as networks
or graphs. The idea is to represent each observed system component as a node in the
network, and each observed interaction between two components as a link between the
two corresponding nodes. Dependent upon one’s research domain, the nodes of such
networks may represent anything ranging from genes, molecules, or proteins (in biology), via
processors or servers (in computer science), to people, airports, power plants or corporations
(in social science or economics). The links could refer to biochemical reactions, wired
or wireless communication channels, friendships, financial contracts, etc. The price paid
for the complexity reduction is the loss of information. Limiting ourselves to a network
representation means that we only record which parts interact, and disregard how and when
they interact. However, the rationale is that the topology of the interactions between a
5
Figure 1. Neural networks, areas of the brain mapped using Golgi’s staining technique
by Ramon y Cajal around 1900. The nodes are brain cells (neurons), and the links are
coated fibres via which the neurone communicate electrical signals. The staining shows only
a tiny fraction of the links, in reality a neuron is connected on average to around 104 other
neurone. The topologies of these networks vary according to the brain area that is being
imaged, ranging from rather regular (in areas related to preprocessing of sensory signals) to
nearly amorphous (in higher cognitive areas).
system’s components should somehow be a fingerprint of its function, and that much can be
learned from the topologies of such networks alone.
For example, DNA contains the assembly instructions for large and complicated macro-
molecules called proteins. These proteins serve as building material for all the parts of the
cell, as molecular processing factories, information readers, translators, sensors, transporters
and messengers. They interact with each other by forming (temporary) complexes, which
are (meta)stable super-molecules formed of multiple proteins that attach to each other
selectively. Many experimental groups produce tables of molecular binding partners such
as that shown in Fig. 2. Network representations of these data have been very useful to
generate intuition on the possible relevance of individual nodes (i.e. proteins), and to suggest
functional modules. There are thousands of other examples of complex systems that tend to
be modelled as networks, of which a selection is shown in the various figures in this section.
6
Figure 2. Left: the data on human protein interactions (from HPRD data base), being
lists of pairs of protein species that have been observed to interact, together with codes of
each species and information on the experiments where interaction was observed. Each line
reports on one pair-interaction. This database contains some 70,000 reported interactions
(about half of the interactions believed to exist among human proteins). Right: the network
representation of the data on the left. Each protein is represented by a node, and each pair-
interaction (each line on the left) is represented by a link connecting the two nodes concerned.
Since interaction of two proteins is a symmetric property, this graph has nondirected links.
Figure 3. Gene regulation networks: here the nodes represent different genes in humans,
and the links (which now are directional) indicate the ability of individual genes (when
‘switched on’) to affect the extent to which other genes are activated. Here the links are
moreover ‘weighted’ (i.e. they carry a numerical value), indicated by solid arrows (positive
value, excitatory effect) or dashed arrows (negative value, inhibitory effect). The figure here
shows only a small subset of the genes – the true number of nodes is in the order of 20,000.
7
Figure 4. Graphical representation of the internet. Nodes represent the webpages and
links represent html jump instructions. In July 2014 it contained some 3.32 billion pages.
8
Figure 7. Main arteries of the oil and gas distribution network, and of the national
electricity power grid of the USA. Here one would be interested in questions related to
the network’s vulnerability against targeted attacks, and how to design networks to reduce
the damage done by such attacks.
10
Figure 8. Phylogenetic trees, constructed from genome similarity. Here the nodes
represent species of organisms, and links represent the most plausible evolutionary ancestor
relationships. Top: general phylogenetic tree showing the main organism families and their
genome lengths. Bottom: focus on different strains of human influenza.
11
Figure 10. Networks representing economic and financial relationships between the main
players in financial markets. It is now increasingly (and painfully) being realised by
regulators that the complex interconnected nature of the international financial system
means that new mathematical approaches are needed to understand, predict, and prevent
future financial crises. Top: the type of players required in models. Bottom: example of big
players and their dependencies and relations in the international banking network.
13
Figure 11. Immune networks. Nodes represent different ‘T-clones’ (families of immune cells
that coordinate the adaptive immune response to specific invaders). Links indicate that the
T-clones interact with a common B-clone (the B-clones actually trigger the destruction of
the invaders). In humans there are typically around 108 T-clones (i.e. nodes).
Figure 12. Simplified models of magnetic systems in statistical physics. Here the nodes
(of which there are of the order of 1024 ) represent sites on regular (2-dim or 3-dim) lattices,
occupied by atoms with intrinsic magnetic fields. The links indicate which pairs of magnetic
atoms are believed to be able to interact and exchange energy.
14
Figure 13. Mobility networks. These are very important in the modelling and prevention of
the spread of epidemics. Nodes are the main global population centres, and links represent
pairs of population centres with the most intensive traffic of people between them.
Note that network images in themselves are subjective. Different software tools will
use different protocols for deciding on the most appealing placements of nodes, and hence
generally will produce different visual representations of the same network (see e.g. Fig. 14).
It is perfectly fine to use graphical representations as intuitive aids, but we will need precise
mathematical descriptions when it comes to extracting information and testing hypotheses.
Figure 14. The two graphs shown here may look different, but are in fact topologically
identical. They differ only in the choices made for the placements of the nodes in the image
plane, i.e. in cosmetics.
This course will describe some of the mathematical and computational tools that have
been developed over the years to characterise and quantify network and graph topologies,
quantify the complexity of large networks, identify modules in networks, and to understand
the resilience of processes on networks against node or link removal. We also study how to
define and generate synthetic networks with controlled topological features.
15
6• 6•
'$ A
K A
A
5 A
5
•?@
3 A
• •@3 A•
&%
I 6
@ @
@ 4 @ 4
@ • - •A •7
- •
@ •A •7
2 A 2 A
1•
U
A
•8 1•
A
•8
V = {1, 2, 3, 4, 5, 6, 7, 8} V = {1, 2, 3, 4, 5, 6, 7, 8}
E = {(2, 1), (3, 2), (4, 2), (5, 2), (3, 3), E = {(2, 1), (1, 2), (3, 2), (2, 3), (4, 2), (2, 4),
(5, 4), (7, 4), (8, 4), (6, 5)} (5, 2), (2, 5), (5, 4), (4, 5), (7, 4),
(4, 7), (8, 4), (4, 8), (6, 5), (5, 6)}
Figure 15. Left: example of a directed graph. It is not simple, since it has a self-link (3, 3)
(note that in principle we could leave out arrows when drawing self-links, since there are
reciprocal by definition). Right: example of a simple non-directed graph.
• Conventions: in drawing graphs we use the following conventions, see e.g. Fig 15
(i) a node i is represented by a small filled circle
(ii) in directed graphs a link (i, j) is drawn as an arrow from node j to node i
(iii) in simple non-directed graphs a link (i, j), which in such graphs is always
accompanied by a link (j, i), is drawn as a line segment between nodes i and j
(iv) a self-interaction (i, i) is drawn by a small circle that starts at i and ends at i
16
In situations where in the context of the problem at hand it is clear that we have only non-
directed graphs, we leave out the explicit mentioning of both (i, j) and (j, i) and simple give
In these lectures we will limit ourselves to non-weighted graphs, i.e. we will not consider
graphs in which links carry a numerical value to represent their sign or strength. We consider
links to be binary objects: they are either present or absent.
@ Aij = 1 @
i
@
@ • @
•@ j
@ @
@ @
@ @
• Consequence: a simple N -node graph has an N ×N adjacency matrix with zero diagonal
elements, i.e. Aii = 0 ∀i ∈ {1, . . . , N }.
• Consequence: a nondirected N -node graph has a symmetric N × N adjacency matrix,
i.e. Aij = Aji ∀(i, j) ∈ {1, . . . , N }2 .
• Consequence: a directed N -node graph has a nonsymmetric N × N adjacency matrix,
i.e. ∃(i, j) ∈ {1, . . . , N }2 such that Aij 6= Aji .
17
We can verify that the two network examples of Fig 15 correspond to the following two
adjacency matrices:
6•
0 0 0 0 0 0 0 0
'$ A
K
A
5 1 0 0 0 0 0 0 0
?3
• A
•
0 1 1 0 0 0 0 0
&%
I
@ 6
@ 0 1 0 0 0 0 0 0
A=
@ 4
• •A •7
@ - -
0 1 0 1 0 0 0 0
2 0 0 0 0 1 0 0 0
A
U
A
•8
0 0 0 1 0 0 0 0
1•
corresponds to 0 0 0 1 0 0 0 0
6•
0 1 0 0 0 0 0 0
A
A
5 1 0 1 1 1 0 0 0
•@3 •A
0 1 0 0 0 0 0 0
@ 0 1 0 0 1 0 1 1
A=
@ 4
• •A •7
@
0 1 0 1 0 1 0 0
2 0 0 0 0 1 0 0 0
A
•8
A 0 0 0 1 0 0 0 0
1•
corresponds to 0 0 0 1 0 0 0 0
We observe indeed that the second adjacency matrix is symmetric (as it corresponds to a
non-directed graph), in contrast to the first.
• Definition: a closed path (or cycle) is a path that starts and ends at the same node, so
k−1
Y
Ai` i`+1 = 1 with i1 = ik if the graph contains (7)
`=1
the cycle i1 → ik−1 → . . . → i2 → i1
k−1
Y
Ai` i`+1 = 0 with i1 = ik if it does not (8)
`=1
• Definition: a simple cycle in a graph is one that contains no repeated vertices or edges,
i.e. k−1
`=1 Ai` i`+1 = 1 with i1 = ik and all node labels in {i1 , . . . , ik−1 } are nonidentical.
Q
We can also ask whether there is any path of a specified length from a given initial node
j to a specified target node i. Now we do not care what exactly are the intermediate nodes
visited in between i and j. We are obviously interested in the presence or absence of paths
of length 2 or more, since having a path of length 1 means simply that Aij = 1 (which can
be read off directly from the adjacency matrix):
N
X N
X k−1
Y
... Aii1 Ai` i`+1 Aik j > 0 ⇔ there exists at least one path of (9)
i1 =1 ik =1 `=1 length k + 1 f rom node j to node i
N
X N
X k−1
Y
... Aii1 Ai` i`+1 Aik j = 0 ⇔ there exists no path of (10)
i1 =1 ik =1 `=1 lenght k + 1 f rom node j to node i
19
But since the summations over the indices {i1 , . . . , ik } in the latter formulae are equivalent to
doing matrix multiplications, we can simplify these formulae. We remember the definitions
of matrix multiplication and powers of matrices, e.g.
N N
(A0 )ij = δij , (Ak+1 )ij = (Ak )ir Arj
X X
(AB)ij = Air Brj ,
r=1 r=1
(with the Kronecker δ-symbol, defined as δii = 1 for all i and δij = 0 for all index pairs
i 6= j), and we conclude from these that the following is true
(Ak+1 )ij > 0 ⇔ there exists at least one path (11)
of lenght k + 1 f rom node j to node i
(Ak+1 )ij = 0 ⇔ there exists no path (12)
of lenght k + 1 f rom node j to node i
This shows already the benefit of working with adjacency matrices as opposed to the sets
(V, E) of nodes and links; for large N it would become painful to trace lines in images or
match entries in sets of index pairs, but instead we can simply do matrix multiplication.
Finally, the last step will not come as a surprise. If we don’t care about path lengths
but only ask about connectivity, we may write
(Ak+1 )ij > 0 ⇔ there exists at least one path f rom j to i
X
(13)
k≥0
k≥0
For instance, the red graph below has V 0 = {1, 2, 4, 5, 6} and E 0 = {(1, 2), (2, 1), (1, 5), (5, 1),
(4, 5), (5, 4), (4, 6), (6, 4)}, and is clearly a subgraph of the one at the top of page 15.
20
• Definition: the connected components of a graph G are the largest sub-graphs of G such
that for each subgraph there exists a path between all vertices within the subgraph.
For instance, the graph in black on the left has the connected components shown in blue
and red on the right:
In this graph we all cliques of size 2, 3 and 4 shown respectively in purple, green and pink.
Note: the immune networks in Figure 11 consist strictly of connected cliques.
21
• Definition: a bipartite graph G is one in which the vertices can be divided into two
nonempty disjoint subsets, i.e. V = V1 ∪ V2 with |V1 |, |V2 | > 0 and V1 ∩ V2 = ∅, such
that all edges (i, j) ∈ E have either i ∈ V1 and j ∈ V2 or j ∈ V1 and i ∈ V2 .
The nodes in bipartite graphs can be divided into two qualitatively different groups, and
there are no links between indices in the same group. Examples are networks that represent
sexual relations in heterosexual groups, or graphs that represent relations between diseases
(node group 1) and clinical features (node group 2), networks mapping researchers and the
journals in which they publish, networks of resource generators and resource consumers, etc:
Generalisations to tripartite graphs (three disjunct vertex subsets, with links only between
nodes from different subsets) and to higher order partitions are obvious.
22
AA
K A A
A A
•@
I
•
A
6
•@ •
A •@ •
A
@ @ @
@ @ @
@• - •A - @ • •A @• •A
i AA i A i A
• • •
U A A
Figure 16. Left: in- and out degrees kiin (A) and kiout (A), i.e. the number of arrows flowing
into and out of the given node, in directed graphs. Middle and right: degrees ki (A), triangle
counters Ti (A), and clustering coefficients Ci (A) in non-directed graphs. Ci (A) gives the
fraction of distinct neighbour pairs of i that are themselves connected. In the absence of link
directionality, there is no distinction in nondirected graphs between left- and right-degrees.
We denote the pair of in- and out-degrees for a node i as ~ki (A) = (kiin (A), kiout (A)) ∈ IN2 .
In nondirected graphs we find that always kiin (A) = kiout (A) (see exercises). Here we can
drop the superscripts and simply refer to ‘the degree’ of a node:
• Definition: the degree of node i in a non-directed N -node graph with adjacency matrix
P
A is defined as ki (A) = j Aij .
• Definition: the degree sequence of a non-directed N -node graph with adjacency matrix
A is defined as the vector (k1 (A), k2 (A), . . . , kN (A)) ∈ INN .
Clustering coefficients and closed path counters. There are many ways to characterise a
graph’s local structure beyond counting the neighbours of a node. For simple nondirected
23
graphs, the clustering coefficient gives the fraction of node pairs linked to i that are
themselves connected:
• Definition: the clustering coefficient Ci (A) of node i with degree ≥ 2 in a non-directed
N -node graph with adjacency matrix A is defined as
number of connected node pairs among neighbours of i
Ci (A) =
number of node pairs among neighbours of i
PN
j,k=1 (1−δjk )Aij Ajk Aik
= P N ∈ [0, 1] (14)
j,k=1 (1−δjk )Aij Aik
We have already seen that products of entries of the adjacency matrix of a graph can be used
to identify paths. We can use this to count the numbers of closed paths of a given length:
• Claim: the number L` (A) of closed paths of length ` > 0 in an N -node graph with
adjacency matrix A (directed or non-directed) is given by
N N `−1 N
(A` )ii
X X Y X
L` (A) = ... Aik ,ik+1 Ai` ,i1 = (15)
i1 =1 i` =1 k=1 i=1
This follows directly from our earlier identities on paths. Note that the sum of the diagonal
entries of a matrix is called its trace, Tr(B) = i Bii , so we have L` (A) = Tr(A` ).
P
Ti (A), which can also be written as Ti (A) = 12 (A3 )ii , counts the number of distinct
nondirected loops of length three, in which node i participates. The factor 12 in Ti (A)
corrects for overcounting: any triangle starting and ending in node i can be drawn with
two possible orientations. Note that in simple non-directed graphs one has Ci (A) =
2Ti (A)/ki (A)[ki (A) − 1] (see exercises). In Fig. 16 we illustrate the various node
characteristics with some simple examples.
(1)
ki (A) = 4
(2)
i • ki (A) = 20
Figure 17. Degrees and generalised degrees in non-directed graphs. At the minimal level
(1) P
one specifies for each node i (black vertex) only the degree ki (A) = ki (A) = j Aij (the
(1) (2)
number of its neighbours). Next one provides for each node the pair (ki (A), ki (A)), in
(2) P
which ki (A) = j` Aij Aj` is the number of length-two paths ending in i. Since the graph
at hand here is non-directed, we can drop the superscripts ‘in’ and ‘out’.
For ` = 1 these formulae reduce to the previous expressions for ordinary in- and out-degrees.
We can similarly introduce quantities that generalise the triangle counters Ti (A) by counting
closed paths in the graph A of arbitrary lengths ` ≥ 3, that pass through node i.
An alternative way to obtain the distances between nodes in the graphs, without
checking one by one all possible routes from i to j, is provided by the following identity.
Here the inverse C −1 of an N × N matrix C (if it exists) is the unique matrix with the
property CC −1 = C −1 C = 1I, in which 1I denotes the N ×N identity matrix.
25
`≥0 `≥dij
h i
= γ dij (Adij )ij + O(γ)
Hence
h i
−1
log[(1I − γA) ]ij log γ dij + log (Adij )ij + O(γ)
lim = lim
γ↓0 log γ γ→0 log γ
h i
dij
log (A )ij + O(γ)
= dij + lim
γ→0 log γ
1 h i
log (Adij )ij + O(e−x ) = dij
= dij − lim []
x→∞ x
The matrix inversion is usually impossible analytically, so is done numerically (see exercises).
Node centrality. To quantify how important an individual node i may be to sustain traffic
or flow of information over a graph, two measures of ‘centrality’ have been defined: the
closeness centrality and the betweenness centrality.
PN
• Definition: the average distance di (A) to node i is di (A) = N −1 j=1 dij (A).
• Definition: the closeness centrality xi (A) of node i is defined as xi (A) = 1/di (A).‡
• Definition: the betweenness centrality yi (A) of a node is defined as the number of node
pairs (k, `), with k 6= ` 6= i, such that i lies on a shortest path between k and `.§
Nodes with a high closeness centrality have small typical distances to the other nodes, and
are hence relatively close to any area of the graph. Nodes with a high betweenness centrality
are apparently important relay stations that reduce the shortest path lengths between node
pairs in the graph. They need not be on average close to the other nodes, but tend to be
the pivotal nodes that connect otherwise separate parts of the graph.
Similarity between node pairs. The functional role of any node i in an N -node graph with
adjacency matrix A is defined strictly by the specification of the links that flow into or out
‡ This definition is helpful and makes sense (and is therefore used) only for connected graphs, since otherwise
di (A) = ∞ (due to the appearance of node pairs that give dij (A) = ∞).
§ Sometimes this quantity is normalised by the total number 21 (N −1)(N −2) (in non directed graphs) of
node pairs not including i.
26
These measures obey −1 ≤ σij (A), τij (A) ≤ 1 for all (i, j) (see exercises).
The origin of the Pearson correlation (or Pearson coefficient) definition of distance
between node pairs is the following. In statistics the Pearson correlation of two variables
(u, v) with joint distribution P (u, v) measures the degree of linear relationship between u
and v, and is defined as follows (see also 8.2):
huvi − huihvi
PC = q (24)
(hu2 i − hui2 )(hv 2 i − hvi2 )
1 P
One obtains formula (23) above by choosing P (u, v) = N k δu,Aik δv,Ajk , see exercises for the
proof.
27
The previous characteristics describe the topology of the graph in the neighbourhood of a
specified node. A global characterisation could be giving the full sequence of these local
numbers, as in the degree sequence k(A) = (k1 (A), . . . , kN (A)). However, as networks
get larger, it is increasingly inconvenient to draw conclusions and derive insight from large
sequences. To arrive at quantitative characteristics that are less sensitive to the number of
nodes, one has two simple options that continue to build on single-node features.
The average in-degree and the average out-degree in any graph are always identical (see
exercises), which reflects the simple fact that all arrows flowing out of a node will inevitably
flow into another node. So we can use in both cases the simpler notation k̄(A).
• Definition: the density ρ(A) ∈ [0, 1] of an N -node graph with adjacency matrix A is
the number of edges of a graph divided by the maximum possible number of edges.
P
We note that in a directed graph the number of links is L = ij Aij , in a non directed graph
P P P
it is L = i<j Aij + i Aii , and in a simple nondirected graph L = i<j Aij . Hence
P
Aij
directed graphs : ρ(A) = ij 2 (25)
N
P P P P
i<j Aij + i Aii i<j Aij + i Aii
nondirected graphs : ρ(A) = 1 = 1 (26)
2
N (N − 1) + N 2
N (N + 1)
P
Aij
simple nondirected graphs : ρ(A) = 1 i<j (27)
2
N (N − 1)
Note: in these definitions we do not count the links (i, j) and (j, i) in non-directed graphs
twice, and the number of non-diagonal entries in a symmetric matrix is 21 N (N − 1). These
densities can be written in terms of the average degree of a graph as follows (see exercises):
directed graphs : ρ(A) = k(A)/N (28)
X
nondirected graphs : ρ(A) = k(A)/(N +1) + Aii /N (N +1) (29)
i
simple nondirected graphs : ρ(A) = k(A)/(N −1) (30)
28
• Definition: the average shortest path length in a graph with adjacency matrix A
2 X
non−directed graphs : d(A) = dij (A) (31)
N (N −1) i<j
1 X
directed graphs : d(A) = dij (A) (32)
N (N −1) i6=j
• Definition: the diameter of a graph with adjacency matrix A is defined as d(A) =
maxi6=j dij (A) (i.e. the distance between the pair of nodes that are furthest from one
another in the graph).
• Definition: the average local clustering coefficient of an N -node graph with adjacency
matrix A is defined as C̄(A) = N −1 N
P
i=1 Ci (A).
Note: a graph is considered ‘small-world’, if C̄(A) is significantly higher than for a random
graph constructed on the same vertex set, and if the graph has approximately the same
mean-shortest path length as its corresponding random graph.
• Definition: the number of links L in a directed graph is L = i,j≤N Aij . In a non-
P
directed graph we do not count Aij = 1 and Aji = 1 separately, so here the number of
links would be L = 12 i6=j≤N Aij + i≤N Aii .
P P
with ~k = (k in , k out ).
29
p(k)
p(k)
k k k
Figure 18. Degree distributions as observed in several non-directed real-world graphs,
suggesting a tendency for these networks to have power-law distributions of the form
p(k) ∼ k −γ , with powers in the range 2 < γ < 3. The evidence for this is somewhat
weak in the first two examples, but the last four do indeed resemble lines in a log-log plot.
In many large real-world networks one observes degree distributions of a power-law form,
see e.g. Figure 18. These are also called ‘scale-free’ networks, since there is apparently no
‘typical’ scale for the degrees in such systems. See exercises. Most nodes typically have small
degrees, but there is a small number of nodes (the so-called ‘hubs’) with very large degrees.
This reflects organisation principles to which we will come back later.
Other statistics. Similarly we can define the joint distribution p(k, T |A) of degrees and
triangle numbers in non-directed graphs:
1 X
∀k, T ∈ IN : p(k, T |A) = δ δ (35)
N i k,ki (A) T,Ti (A)
Now p(k, T |A) is the fraction of nodes that have degree k and that participate in T triangles.
It will be clear how to generalise these ideas and define similar distributions for in- and out-
degrees and triangles in directed graphs, or distributions of generalised degrees.
76
pp
61
95
pp
pp
pp 21
pp
45
8
30
pp
pp pp
pp
55
84 51
pp
87 pp
pp 19
78
10 pp 34 32
pp pp pp pp
pp
pp
pp
58 12 pp 53
9 pp pp 94 pp
pp pp
pp pp
pp
21 65
pp 22
pp 56 75
63 pp pp pp
40 pp
pp pp 5 8 56
pp pp pp
pp 71 41
96 pp 3 pp pp pp pp pp
pp pp
pp 40 pp
pp pp 81
pp pp pp pp 17
89 pp
pp 91 pp 36
pp pp pp pp
pp pp 52 pp pp
pp pp 88
54
pp
pp
27
76 pp pp
pp pp pp
pp
66
pp
pp 70 pp pp pp pp pp 29
48 pp pp 52
92 pp
pp
pp
pp pp
98 24
27 84 pp pp pp
pp 51
pp 73 pp pp pp
pp 90 pp pp
pp pp
pp
pp pp
11 pp
86 70 pp
pp pp 45 37 pp
9
pp pp
64 78 pp pp pp
pp pp
82 pp pp
57 3 pp 77 pp
pp pp pp 42 pp
24 pp pp pp 41
81 pp pp pp 46
pp pp pp pp 74 pp
pp 42 pp pp 82 pp pp
77 pp pp pp 51
pp pp 12 pp pp pp pp pp 97
pp 71 pp pp pp pp 42
pp pp pp 30
pp pp 33 pp pp
pp pp pp pp 75
pp
pp
pp pp
53
pp pp 53 28 pp
pp
pp
pp
28 pp pp 44 81
13 pp 32 47 pp
35 pp
pp pp 83
pp pp 39 pp pp pp pp
pp 46 pp pp 52 pp 23 pp
pp pp 43 pp pp pp pp 26
pp 58 pp pp pp pp
26 pp pp pp 48
pp pp 49 pp pp
pp pp
31 pp pp
11 pp pp 73 91
97 49 pp pp pp pp pp
pp pp pp pp
pp pp pp
50 pp pp
pp pp pp
pp 93 45
pp 86 pp 61 pp pp pp
pp pp pp 69 pp 46 pp
27
pp pp pp pp pp pp 24 pp
pp 30 pp pp
4
pp pp pp 79 100 pp
pp pp
pp 47 74 43
pp 92 pp pp pp 40 pp
pp pp 7 48
83 69 pp pp pp pp pp 54 pp pp
pp pp pp 82
pp
pp 38 pp pp
pp 55 pp pp
pp pp pp pp 28
pp pp
90 pp pp pp 84
pp pp
6 pp pp
pp
13 pp 59 85 pp pp pp
pp pp 39 pp
pp
65 pp pp 88 pp pp pp 16 26 pp pp 47
pp pp pp 98 pp pp pp 38 pp
pp
15 pp pp pp 80 pp
pp
99 18 pp 89 pp 31
43 pp 25 pp pp
2 72 pp 25 pp pp pp pp pp pp
pp 60 pp pp pp
pp pp 63 pp
pp pp pp pp pppp 67 57 4 73
pp 23 96 pp pp 2
pp pp pp 44 pp pp
pp pp 66 37 pp 86 65 pp
pp pp pp
pp pp
pp pp pp pp 22 pp 93 83 pp pp
6 pp pp
pp 20 68 31 pp pp pp pp
pp
92 78 pp pp
pp pp pp pp 49 pp pp pp 30
pp pp 44 22 57 58 pp pp pp pp pp
pp pp pp pp
94 4 pp pp pp pp pp
pp 33 pp pp pp 3
pp 77 pp
pp pp pp pp pp pp pp pp
pp pp pp pppp pp pp
15 pp 35 60 pp pp
95
pp pp pp pp pp pp pp
pp pp 79 pp 87 pp pp
pp 23 14 pp 67
pp 21 pp 69 pp 74
pp pp
56 29 pp
80 pp pp
pp pp pp 32 pp
pp pp
pp
pp 19 5
pp pp pp pp pp
pp 15 pp pp pp pp
pp 67 pp pp pp pp pp pp
pp pp pp pp pp
pp pp pp pp pp
87 pp pp
17
pp pp 64 pp
pp pp
pp pp pp pp pp
pp pp pp 70
72 pp 96 66 pp pp
14 pp 7 85 18 pp 9 72 68 pp
pp 97 pp 20
10 39 pp pp
pp pp 17
pp 41 pp 2 88 6
29 pp 50 99 pp pp pp pp
pp pp 94 pp
pp pp 59 pp pp pp
pp pp pp pp pp
pp pp pp 89 pppp pp pp pp pp
59 100 pp pp pp
pp pp pp 35 pp pp
16 pp pp
pp
pp
76 pp
25 pp 16 pp
64 38 91 pp pp pp pp 7 pp pp 75
pp pp 95pp pp pp pp 71
pp pp 14 pp
pp 54 pp pp pp
5 pp
pp pp 18
62 63 36 10 pp
pp 80 pp pp pppp 100 pp
pp pp 11
pp pp
pppp pp pp
pp 98 pp
pp 8
33
90 pp pp
20 pp 99 pp
pp
19 pp pp
93 pp pp pp
79 60 pp
pp
pp 12
pp
pp 34
37
pp
pp
1 62 pp
1 13
62
pp
pp
34
61
85
55
pp
k k k
29 95
pp
23 pp 96 pp
pp
90 5
28
pp pp pp pp
pp
pp pp pp
pp
pp
pp 6
pp 13 pp
63 53 86 pp
pp 85
pp
4 pp 94
pp
39 pp
pp
pp pp
97 pp
42 pp 79
pp pp pp
33 88 pp
pp 66 pp
pp pp pp
pp
pp 15 pp
pp pp pp
pp pp pp
62 87
pp 56 60 pp pp pp
pp pp 95 pp
pp 85 19 pp pp 61 84
pp pp 7 16
pp
pp pp
pp 7614
16 27 pp
pp 3 75
pp
pp 40 pp
pp 87 pp pp
pp pp 93
7 pp pp pp pp pp
pp pp
pp
pp pp
pp
68 pp pp
12 pp 98
72 pp
pp
pp
21 pp 77 pp
pp
77 pp pp pp pp
pp 25
75 pp
pp pp 88
pp
17 pp pp
pp pp
pp 69 pp 17 pp 74
pp pp pp pp
pp 43 26
pp 13
95 83
pp 2
pp pp pp 8
pp pp 9 pp 66
43 pp pp pp
24 pp
pp
66 24 pp pp 65
pp 55 25 38 pp
pp pp pp pp
pp 75
pp 41 pp pp
1
pp
64 80 pp pp pp pp pp pp pp pp pp
pp pp 81 74 pp
94 78
pp pp pp 92 pp
pp pp 46 82 pp
pp pp pp pp pp pp pp
pp pp pp pp pp pp
70 pp
70 pp 71 73 pp
pp pp 81 60 78 pp pp
pp pp pp pp pp
pp 97 6 pp 99 35 pp
pp 67 pp pp 76 67
pp pp pp pp pp
pp pp pp 57 pp pp
pp pp pp 12
76 pp 31 27 pp
65 54 38 pp pp pp 89
36
pp
pp pp pp pp
pp pp pp 37 pp
37 pp 4 pp pp pp 64
pp pp pp 28 pp pp pp pp 99 pp
pp 18
pp 4 pp pp pp 56 pp 55 73
pp 84 pp 12
pp pp pp
22 85 pp pp pp pp
pp pp pp pp pp pppp 80 23 pp
pp 100 pp pp pp pp
pp pp 5
100 pp pp 93 pp
89 5 pp pp pp pp
pp 82
47 2 9 34
21 pp pp pp 34 pp
pp pp
pp 45
pp pp pp pp pp pp
48 pp pp pp pp
pp pp pp pp 46
pp 15 pp pp pp pp pp
pp 79 pp
pppp pp pp
53 pp
pp
96 pp 100 91
2 pp pp pp pp pp
pp pp
pp pp pp pp 56 pp 90 pp
pp pp pp pp pp
pp pp pp pp pp
pp 40 pp pp pp
89 26 pp pp
pp 34pp pp pp 48 58 pp 51 pp 1 pp pp
pp pp pp 6pp pppp pp pp pp pp
pp pp 35 pp 79 pp pp
pp
pp pp pp 23 22 pp 37 pp
pp 57 pp 54
pp pp pp pp pp pp
58 pp pp pp pp pp
pp 68 pp
pppp pp 91 32 50 pp
73 pp pp pp pp 31
pp
pp pp 29 pp pp 44
pp pp pp pp 54
pp pp
pp pp
pp pp
pp pp 96 pp 52 pp
pp pp pp 10
98 14 28
pp
11
14 pp pp 25 10 pp 81 63
pp 52 pp
pp pp pp pp pp 47
pp
30 pp pp 10 pp pp pp pp pp pp
pp pp
pp pp
19
pp
pp pp pp 72
83 pp
pp pp pp pp pp pp pp pp pp 80 22 pp
pp pp pp 11 pp pp pp
33
86 98 pp pp pp
pp pp pp pp pp
8 pp pp pp
65 pp
pp pp 59 pp pp
pp pp pp 18 pp pp
pp 15 8 pp
68 pp pp
78 97 pp
pp pp pp
61 pp pp
83 pp
pp
69 26 pp pp pp pp
pp pp pp pp pp pp
36 pp pp
pp pp pp
pp pp 67 pp pp pp
pp 58 69 53
55 pp 64 pp
pp pp
pp 93 30 38
pp 13 99 pp pp 43
pp pp 20
pp 35 pp
pp
21
pp pp 90 7 pp
pp 71
pp 20 pp
pp
27 pp
pp 86 pp pp
72 pp 29 62
36 pp 48
57 pp pp 88 pp
45 pp pp pp 70
62 pp pp 32
pp
74 pp pp
39 44 pp pp pp pp
pp pp 47 pp
33 pp
pp pp
pp 50 pp pp
pp
pp pp pp
32 pp pp
pp pp 59
pp 24
pp pp 52
63 30 pp pp
pp 31 42
39
pp pp 61
19
pp
3 pp pp pp
pp pp
60
pp pp49 pp pp pp
pp
pp
pp 92
91 pp
pp pp
pp
pp pp 49
77 40 pp 41 pp 51
pp pp pp
94 50
pp
51
84
11 pp 92
k k k
Figure 19. Examples of small numerically generated non-directed graphs, all with N = 100
and k(A) = 4 (their precise definitions will be given in subsequent sections of these notes).
Clearly, size and average degree do not specify topologies sufficiently – there are still too
many ways to generate graphs with the same size and the same number of links. The degree
distribution provides additional information, but one would still like to go further.
31
@ @
Aij = 1
•@@ •@
@ @
@
@ @
@ @
ki (A) = k? kj (A) = k 0 ?
W (k, k 0 |A) gives the fraction of non-self links in the network that connect a node of degree k
to a node of degree k 0 . Clearly W (k, k 0 |A) = W (k 0 , k|A) for all (k, k 0 ), and W (k, k 0 |A) = 0
if k = 0 or k 0 = 0 (or both). From (36) follows also
• Definition: the degree assortativity a(A) in a non-directed graph is the Pearson
correlation between the degrees of connected nonidentical node pairs,
W (k, k 0 |A)kk 0 − ( k>0 W (k|A)k)2
P P
k,k0 >0
a(A) = 2 2 ∈ [−1, 1] (37)
k>0 W (k|A)k − (
P P
k>0 W (k|A)k)
W (k, k 0 |A).
P
with the marginal distribution W (k|A) = k0 >0
If a(A) > 0 there is a preference in the graph for linking high-degree nodes to high-degree
nodes and low-degree nodes to low-degree nodes; if a(A) < 0 the preference is for linking
high-degree nodes to low-degree ones. Upon summing the definition (36) over k 0 we see that
the marginal W (k|A) follows directly from the degree distribution, for simple graphs the
relation is
N
1 k
W (k, k 0 |A) =
X X
W (k|A) = δk,ki (A) ki (A) = p(k|A) (38)
k0 >0 N k̄(A) i=1 k̄(A)
(for graphs with self-links we would replace k̄(A) → k̄(A) − N −1 i Aii ). The reason why
P
W (k|A) 6= p(k|A) is that in W (k|A) the degree likelihood of nodes is conditioned on these
nodes coming up when picking links at random; this favours nodes with more links over those
with less. In those graphs where there are no correlations between the degrees of connected
32
nodes one would find that the joint distribution (36) is simply the product of the respective
marginals (38), W (k, k 0 |A) = W (k|A)W (k 0 |A) for all k, k 0 > 0. Hence, a useful quantity to
characterise correlations is
• Definition: the degree correlation ratio in a simple non-directed graph with adjacency
matrix A is
0 W (k, k 0 |A) k̄ 2 (A) W (k, k 0 |A)
Π(k, k |A) = = (39)
W (k|A)W (k 0 |A) kk 0 p(k|A)p(k 0 |A)
This quantity is by definition equal to 1 for graphs without degree correlations. Any
deviation from Π(k, k 0 |A) = 1 will signal the presence of degree correlations.
The degree correlations captured by Π(k, k 0 |A) can provide valuable new information that
is not contained in the degree distribution p(k|A). For instance, in Fig. 20 we show
two networks with nearly identical degree distributions, that are nevertheless seen to be
profoundly different at the level of degree correlations. The result of calculating the
macroscopic characteristics p(k|A) and Π(k, k 0 |A) for the example protein interaction data
of Fig. 2 is shown in Fig. 21.
For directed networks the degree correlations are described by a function W (~k, ~k 0 |A),
where ~k = (k in , k out ) and ~k 0 = (k 0in , k 0out ), since in directed graphs we must distinguish
between in-in degree correlations, out-out degree correlations, and in-out degree correlations:
• Definition: the joint distribution of in- and out-degrees of connected node pairs in a
simple directed N -node graph with adjacency matrix A is
P
ij δ~k,~ki (A) Aij δ~k0 ,~kj (A) 1
∀k, k ≥ 0 : W (~k, ~k |A) =
0 0
X
= δ~ ~ Aij δ~k0 ,~kj (A)
N k̄(A) ij k,ki (A)
P
ij Aij
(40)
@ @
Aij = 1
•@@ •@
@ @
@
@ @
@ @
p(k) Π(k, k 0 )
0.4 40
1.4
0.3 30
1.2
0
k
0.2 20 1
0.8
0.1 10
0.6
0.0
0 10 20 30
10 20 30 40
k k
0.4 40
1.4
0.3 30
1.2
k0
0.2 20 1
0.8
0.1 10
0.6
0.0
0 10 20 30
10 20 30 40
k k
Figure 20. Illustration of the limitations of using only degree statistics to characterise
graphs. The two non-directed N = 5000 graphs shown here look similar and have nearly
indistinguishable degree distributions p(k) (shown as histograms). However, they differ
profoundly at the level of degree correlations, which is visible only after calculating the
functions Π(k, k 0 ) for the two graphs, shown as heat maps on the right. In the top graph,
high degree nodes tend to be connected more to other high degree nodes. In the bottom
graph there is a strong tendency for high degree nodes to connect to low degree nodes.
The left and right marginals of W (~k, ~k 0 |A) need not be identical (in contract to non-
directed graphs). For simple directed graphs we find (see exercises):
W1 (~k|A) = p(~k|A)k in /k̄(A), W2 (~k 0 |A) = p(~k 0 |A)k out0/k̄(A)
• Definition: the degree correlation ratio in a simple directed graph with adjacency matrix
A is
W (~k, ~k 0 |A) k̄ 2 (A) W (~k, ~k 0 |A)
Π(~k, ~k 0 |A) = = in out0 (41)
W1 (~k|A)W2 (~k 0 |A) k k p(~k|A)p(~k 0 |A)
This quantity is by definition equal to 1 for directed graphs without degree correlations.
Any deviation from Π(~k, ~k 0 |A) = 1 will signal the presence of degree correlations.
34
Π(k, k 0 )
0.4 50
1.4
40
0.3
1.2
p(k) k0 30
0.2 1
20
0.8
0.1
10
0.6
0.0
0 10 20 30
10 20 30 40 50
k k
Figure 21. The degree distribution p(k) (33) (left), and the normalised degree correlation
kernel Π(k, k 0 ) (39) (right, shown as a heatmap) for the protein interaction network of Fig.
2. Here N ≈ 9000 and k̄(A) ≈ 7.5. Significant deviations from Π(k, k 0 ) ≈ 1, i.e. deviations
from green in the heat map, imply nontrivial structural properties beyond those captured
by the degree distribution.
@ @
Aij = 1
•@@ •@
@ @
@
@ @
@ @
xi (A) = x? xj (A) = x0 ?
W (x, x0 |A) gives the fraction of non-self links in the network that connect a node with
features x to a node with features x0 . Clearly W (x, x0 |A) = W (x0 , x|A) for all (x, x0 ). From
(42) follows also
35
W (x, x0 |A).
P
with the marginal distribution W (x|A) = x0 ∈X
If a(A) > 0 the linked nodes tend to have positively correlated features; if a(A) < 0 they
tend to have negatively correlated features. Note that this definition (43) therefore is sensible
only for features x whose values are ordered in a meaningful way – like height or age, but in
contrast to e.g. colour.
Upon summing (42) over x0 we see that the marginal W (x|A) is
N
1
W (x, x0 |A) =
X X
W (x|A) = δ ki (A) (44)
x0 ∈X N k̄(A) i=1 x,xi (A)
Using the joint distribution p(x, k|A) = N −1
P
i δx,xi (A) δk,ki (A) of features and degrees of
nodes we can simplify the marginal of W to
X k
W (x|A) = p(x, k|A) (45)
k>0 k̄(A)
4.5. Modularity
Sometimes the prominent structure of a network is modularity, see e.g. Fig 22. In such
graphs nodes connect preferentially to other nodes that have the same module label – in fact
finding the optimal modules, i.e. the optimal assignment of a string (x1 , . . . , xN ) of module
labels to the nodes in the network, is a common problem in network applications. We can
now use the module membership label of each node as its feature in the sense above.
To quantify the extent to which a simple non-directed graph is modular, we compare
the number of ‘like-connects-to-like’ connections (or intra-modular links) in the graph A to
what we would have found if the wiring had been completely random:
1X
nr of intra−modular links in A : Lintra (A) = Aij δxi ,xj (46)
2 ij
(where the factor 12 reflects the non-directed nature of the graph, we don’t want to count the
same link twice). In contrast, in a random graph A0 (which we will study more rigorously
later) with the same degree sequence k = (k1 , . . . , kN ) as the graph A we would calculate the
expectation value of the above quantity as hLintra (A0 )i = 21 ij hA0ij δxi ,xj i = 12 ij hA0ij iδxi ,xj ,
P P
since there is assumed to be no relation between the labels x and the adjacency matrix. Now
hA0ij i = P (A0ij = 1|k).1 + P (A0ij = 0|k).0 = P (A0ij = 1|k) (47)
36
Figure 22. Examples of modular graphs. Here each node has a feature xi that represents
membership of a specific subset of nodes (its ‘module’, here the modules are shown colour-
coded). Nodes are more frequently connected to partners within the same module, as
opposed to partners from another module.
Here P (A0ij = 1|k) is the probability that in a random graph with degree sequence
k = (k1 , . . . , kN ) one will find nodes i and j connected. This must be proportional to
ki and kj , so we can estimate that hA0ij i ≈ ki kj /C. The value of C then follows upon
summing both sides over i and j, giving (since A and A0 have the same degrees):
hA0ij i = ( hence N k̄ = (N k̄)2 /C
X X X
ki )( kj )/C so C = N k̄ (48)
ij i j
We often study networks because they are the infrastructure of some process. Here we
inspect simple dynamical processes for variables placed on the nodes of graphs, to find out
which network aspects impact on the processes that they support. This leads us to the
eigenvalue spectrum of the matrix A, and of the so-called Laplacian matrix of the graph.
λ > 0 represents a decay parameter – in the absence of peer pressure, i.e. for nodes
without neighbours, so ∂i = ∅, one would find si (t) = si (0)e−λt .
• Solution of dynamical equations:
Equation (51) is linear, and hence easily solved:
XB `
s(t) = e(A−λ1I)t s(0), eB = (52)
`≥0 `!
Taking the inner product on both sides of (52), using (53), gives
38
X t` X t` N
0
êk · (A − λ1I)` s(0) = êk · (A − λ1I)` σk0 (0)êk
X
σk (t) =
`≥0 `! `≥0 `! k0 =1
N X t` N X t` (µk0
0 − λ)` k k0
êk · (A − λ1I)` êk =
X X
= σk0 (0) σk0 (0) ê · ê
k0 =1 `≥0 `! k0 =1 `≥0 `!
N X t` (µk0 − λ)`
δkk0 = σk (0)et(µk −λ)
X
= σk0 (0) (55)
k0 =1 `≥0 `!
Eigenvalues of A with µk < λ will have σk (t) → 0 and those with µk > λ will have
σk (t) → ±∞. Hence either |s(t)| → 0 or |s(t)| → ∞ as t → ∞; the dynamical
variables evolve either to zero or to infinity. Hence, although this model (51) is well-defined
mathematically, it is not a good description of social or magnetic interactions.
Revised definition – spherical model. To cure the maladies of the previous model without
sacrificing its linearity, we can replace the constant λ in (51) by a time dependent decay rate
λ(t). If we define this λ(t) by the requirement that s2 (t) = N for all t ≥ 0, so that the
divergencies of the previous laws can no longer occur, we obtain a so-called spherical model:
• Dynamical equations:
d 1
∀t ≥ 0 : s(t) = As(t) − λ(t)s(t), λ(t) = s(t) · As(t) (56)
dt N
d 2
The second equations follows upon setting s2 (0) = N and demanding that dt s (t) = 0
k
for all t ≥ 0. Again we switch to the new basis of eigenvectors {ê }, by substituting
k
s(t) = N
P
k=1 σk (t)ê into (56), which now leads to the following equations, from which
we need to solve both the {σk (t)} and λ(t):
N
d 1 X
σk (t) = [µk − λ(t)]σk (t), λ(t) = µk σk2 (t) (57)
dt N k=1
• Asymptotic behaviour:
Let us assume, for simplicity, that we do not have the pathological case where the
initial vector s(0) was strictly orthogonal to one or more of the A-eigenvectors. So
σk (0) = êk · s(0) 6= 0 for all k. Let us also define the largest eigenvalue µmax :
µmax = max µk , S = {k ≤ N | µk = µmax } (65)
k≤N
The second largest eigenvalue of A controls the timescale over which the evolution towards
stationarity takes place. If we make the simple choice σk (0) = 1 ∀k for the initial conditions,
we can write the solution λ(t) at any time in terms of the so-called eigenvalue spectrum
N
1 X
%(µ|A) = δ[µ − µk ] (68)
N k=1
(see appendix 8.6 for definition and properties of the δ-distribution). To see this we note
that when σk (0) = 1 ∀k our equation (64) simplifies to
1 PN 2µk t
dµ %(µ|A)µ e2µt
R
N k=1 µk e
λ(t) = 1 N = R (69)
2µk t dµ %(µ|A)e2µt
P
N k=1 e
We conclude that the dynamics of such processes on graphs depends critically on the
eigenvalue spectra of their adjacency matrices.
40
5.2. Diffusion processes and random walks - the Laplacian matrix of a graph
Diffusion processes on networks. Imaging again having a simple non-directed N -node graph
with adjacency matrix A. Each node i of the graph now contains a conserved resource zi ∈ IR
(e.g. energy, water, food, money, etc), which can diffuse (or ‘leak’) away to its neighbours,
always from high to low levels. With ‘conserved’ we mean that, in contrast to the variables
in our previous dynamical models, if the amount of the variable increases at one node it
has to decrease somewhere else in compensation. The rate of diffusion between two nodes
is larger when their differences in resource levels are larger, as would be the case with e.g.
heat or water pressure.
d X X
zi (t) = [zj (t) − zi (t)] = Aij zj (t) − ki (A)zi (t) (70)
dt j∈∂i j
This process can be written in terms of the N × N so-called Laplacian matrix L with entries
d
zi (t) = − j Lij zj (t), where
P
Lij , as dt
Lij = ki (A) δij − Aij (71)
and the solution of the diffusion process becomes, with z = (z1 , . . . , zN ),
z(t) = e−Lt z(0) (72)
We could again worry about diverging solutions, but we will see below that all eigenvalues
of L are nonnegative, so here this cannot happen. In fact we can show easily from (70) that
P
the total amount Z = i zi is conserved over time:
d XX X X
Z(t) = Aij zj (t) − ki (A)zi (t) = kj (A)zj (t) − ki (A)zi (t) = 0 (73)
dt i j j i
Random walks on networks. Random walks on non-directed graphs are discrete versions of
diffusion processes. We define pj (t) ∈ [0, 1] as the probability that the walker is at site j
at time t ∈ IN. At each time step he moves to a new site i, selected randomly and with
equal probabilities from the neighbours of j. Since there are kj (A) sites to choose from, the
probability to go to each one of these is kj−1 (A). Hence the dynamical equations are
X 1 X Aij
pi (t + 1) = pj (t) = pj (t) (74)
j∈∂i kj (A) j kj (A)
With the definition Dij (A) = ki (A)δij this can be rewritten as pi (t + 1) = j (AD −1 )ij pj (t),
P
and hence, upon defining p(t) = (p1 (t), . . . , pN (t)), we can write the solution at any time as
p(t) = (AD −1 )t p(0) (75)
We see that the stationary state solution p = (p1 , . . . , pN ) of this equation can be written as
p = Dx, with (D − A)x = 0. Since D − A is the Laplacian matrix, we see that again the
41
This follows directly from the properties of the δ-distribution, see Appendix 8.6.
We know from linear algebra that all eigenvalues of symmetric matrices are real-valued,
hence the above restriction to non-directed graphs. Adjacency matrices of directed graphs
will indeed normally have complex eigenvalues.
We can combine the above three inequalities into the following corollary:
µmin (A) ≤ k̄(A) ≤ µmax (A) ≤ maxj=1...N kj (A) (78)
• Definition: a non-directed N -node graph with adjacency matrix A in which all degrees
ki (A) are identical to q, i.e. ki (A) = q for all i, is called a q-regular graph.
%(µ)
0 0 0
-5 -3 -1 1 3 5 -5 -3 -1 1 3 5 -5 -3 -1 1 3 5
µ µ µ
Figure 23. Adjacency matrix eigenvalue distributions %(µ) of three graphs shown and
quantified in previous figures. Left: eigenvalue distribution for the human protein interaction
graph (see Figures 2 and 21). Middle and right: eigenvalue distributions for the two graphs
in Fig. 20. The middle histogram refers to the graph with only weak degree correlations (top
line in Fig. 20) and the right histogram refers to the graph with strong degree correlations
(bottom line in Fig. 20). The eigenvalue spectra of the last two graphs are seen to be
significantly different, in spite of their nearly identical degree distributions.
Link between adjacency matrix spectra and closed path statistics. From the eigenvalue
spectrum %(µ|A) of the adjacency matrix A of a non-directed graph one can obtain the
numbers L` (A) of closed paths of all possible lengths ` in this graph, since
• Claim: for any integer ` > 2 the eigenvalue spectrum %(µ|A) of a non directed graph
with adjacency matrix A obeys
Z
1
dµ µ` %(µ|A) = L` (A) (82)
N
where L` (A), defined in (15), gives the number of closed paths of length ` in the graph.
Proof:
340175
481 430
44
447 776
594
757
737
403
905
963 523
%(µ)
0 0 0
-5 -3 -1 1 3 5 -5 -3 -1 1 3 5 -5 -3 -1 1 3 5
µ µ µ
Figure 24. Adjacency matrix eigenvalue distributions %(µ) of the three further graphs,
to emphasise
R that the shape of these distributions can vary considerably, which, via the
moments dµ µ` %(µ), reflects the different statistics of closed paths in these graphs. The
Erdös-Rényi random graphs will be the subject of a subsequent section of these notes.
1 `
From the proof of (79) we know that for any integer ` > 0: dµ µ` %(µ|A) =
R P
N i (A )ii .
If ` > 2 this immediately gives us dµ µ` %(µ|A) = N1 L` (A).
R
594
757
737
403
905
963 523
%Lap (µ)
0 0 0
-15 -10 -5 0 5 10 15 -15 -10 -5 0 5 10 15 -15 -10 -5 0 5 10 15
µ µ µ
Figure 25. Laplacian matrix eigenvalue distributions %Lap (µ) of the three graphs of Figure
24, which indeed show nonnegative eigenvalues only. It is clear the the eigenvalue spectra
of the adjacency matrix and of the Laplacian matrix sometimes will and sometimes will not
be similar. In the exercises we will find out why the Laplacian spectra in the middle and
right graph are of the same shape as their adjacency matrix spectra in Fig. 24.
Some examples of adjacency matrix eigenvalue spectra for non-directed graphs that we
have already inspected earlier are shown in Fig. 23. Further examples are shown in Fig. 24,
to emphasise the large variability in spectra one should expect.
• Claim: the Laplacian matrix L of a graph always has at least one eigenvalue µ = 0.
Proof:
Define u = (1, 1, . . . , 1), and show that it is an eigenvector with eigenvalue zero:
X X
(Lu)i = Lij uj = ki (A)δij − Aij ).1 = ki (A) − ki (A) = 0 (84)
j j
• Claim: the multiplicity of the kernel of a Laplacian matrix L of a graph (i.e. the
dimension of the eigenspace corresponding to eigenvalue zero) equals the number of
disconnected components in the graph.
Proof:
1
Consider a vector x with eigenvalue zero. Using the identity x · Lx = Aij (xi − xj )2
P
2 ij
derived in the previous proof, it follows that for such an eigenvector
Aij (xi − xj )2
X
0=
ij
Aij (xi − xj )2
X X
0=
V 0 i,j∈V 0
Hence we would again get, for any connected component V 0 : xi = xj for all i, j ∈ V 0 .
But that implies that x is a linear combination of the eigenvectors above, which is
not possible. Hence the dimension of the kernel of L, i.e. the number of independent
eigenvectors with eigenvalue zero, is exactly the number of connected components.
The above features of the Laplacian matrix allow us to predict immediately the stationary
state of diffusion processes. For instance, from expression (72) we may now conclude that
in the stationary state z(∞) = limt→∞ z(t):
1 X
f or each connected component V 0 : ∀i ∈ V 0 : zi (∞) = 0 zj (0) (85)
|V | j∈V 0
(see exercises for proof). In Fig 25 we show the eigenvalue spectra %Lap (µ|A) of the matrices
shown earlier (with their adjacency matrix eigenvalue spectra) in Fig. 24.
48
• Claim: for graphs generated in the ER ensemble , the average value of the average
degree k̄(A) = N −1 ij Aij equals p? (N − 1).
P
Proof:
X 1 X X 2 X 2 X X
hk̄(A)i = p(A) Ars = p(A) Ars = p(A)Ars
N rs N r<s N r<s
A∈G A∈G A∈G
N h
2 X X i
p? δAij ,1 + (1 − p? )δAij ,0
Y
= Ars
N r<s i<j=1
A∈G
1 1 h
2 X X ? ?
i
p? δAij ,1 +(1−p? )δAij ,0
Y X
= Ars [p δArs ,1 +(1−p )δArs ,0 ]
N r<s Ars =0 i<j, (i,j)6=(r,s) Aij =0
2 X ? 2p? X 2p? 1
= p .1 = = . N (N − 1) = p? (N − 1)
N r<s N r<s N 2
Note: hki is the average over the ensemble of the average degree k̄(A) of its graphs, i.e.
hki = A∈G p(A)k̄(A). Individual random graphs A generated according to (88) will
P
• Claim: the Erdös-Rényi ensemble assigns equal probabilities to all graphs with the same
number of links.
Proof:
Since Aij ∈ {0, 1}, the probabilities (88) can be written in the alternative form:
1
Yh i P P
p(A) = (p? )Aij (1 − p? )1−Aij = (p? ) i<j
Aij
(1 − p? ) 2 N (N −1)− i<j
Aij
(89)
i<j
Hence the dependence of p(A) on A can indeed be expressed fully in terms of the
P
number L(A) = i<j Aij of links in A, via
• Claim: the graph probabilities (88) of the ER ensemble can equivalently be written as
N
" ! #
Y hki hki
p(A) = δAij ,1 + 1 − δAij ,0 (91)
i<j=1 N −1 N −1
Proof: This follows directly from the above result hki = p? (N − 1).
In the ER ensemble we control the likelihood of graphs via just one graph observable, which
can either be k̄(A) or the number of links L(A) (one follows from the other), and all graphs
with the same value for this parameter are equally probable. In spite of this superficial
simplicity, analysing this model turns out to be less than trivial.
50
• Claim: the average clustering coefficient Ci = hCi (A)i of any node i in graphs generated
from the ER ensemble (88), with the definition of Ci (A) given in (14), is
hCi (A)i = p? [1 − (1−p? )N −1 − p? (N −1)(1−p? )N −2 ] (92)
Proof:
We use definition (14), and have to be careful to distinguish between ki (A) < 2 and
ki (A) ≥ 2. To handle this implicit conditioning on the degree value we use the integral
Rπ
representation of the Kronecker δ-symbol (see 8.5), δnm = (2π)−1 −π dω ei(n−m)ω :
* + * P +
X X Air Ars Asi
r6=s
hCi (A)i = δk,ki (A) Ci (A) = δk,ki (A)
k≥0 k≥2 ki (A)(ki (A) − 1)
1
X X
= δk,ki (A) Air Ars Asi
k≥2 k(k−1) r6=s
*Z +
X 2 X πdω iω(k−Pj Aij )
= e Air Ars Asi
k≥2 k(k−1) r<s −π 2π
* +
2 X Z π dω
eiωk Air Ars Asi e−iωAij
X Y
=
k≥2 k(k−1) r<s, r,s6=i −π 2π j6=i
* +
2 X Z π dω Y
eiωk Ars Air e−iωAir Ais e−iωAis e−iωAij
X
=
k≥2 k(k−1) r<s, r,s6=i −π 2π j ∈{i,r,s}
/
So far we have only substituted definitions, and rearranged factors such that entries of
the adjacency matrix are grouped together. Now we do the actual ensemble averages.
The measure p(A) in the ER ensemble (88) factorises over the links, reflecting the fact
that they are indeed generated independently, which means that the average over p(A)
above simplifies to so the above can be reduced to the product of ensemble averages:
* +
Y
−iωAir −iωAis −iωAij
= hArs ihAir e−iωAir ihAis e−iωAis i he−iωAij i
Y
Ars Air e Ais e e
j ∈{i,r,s}
/ j ∈{i,r,s}
/
? ? −iω 2 ? −iω ? N −3 ? 3 −2iω ? −iω ? N −3
= p (p e ) (p e +1−p ) = (p ) e (p e +1−p )
Next we use Newton’s binomium formula to work out the quantity (p? e−iω +1−p? )N −3 :
N −3
* +
−iωAir
−iωAis
Y
−iωAij N −3 ? ` −`iω
= (p? )3 e−2iω (1−p? )N −3−`
X
Ars Air e Ais e e (p ) e
j ∈{i,r,s}
/ `=0
`
N −3
N −3 ? `+3 −(`+2)iω
(1−p? )N −3−`
X
= (p ) e
`=0
`
We insert this into our expression for hCi (A)i, use 1 = 21 (N −1)(N −2) , and
P
r<s, r,s6=i
do some simple cleaning up:
−3
(N −1)(N −2) Z π dω iωk NX N −3 ? `+3 −(`+2)iω
(1−p? )N −3−`
X
hCi (A)i = e (p ) e
k>2 k(k−1) −π 2π `=0
`
51
−3
X (N −1)(N −2) NX N −3 ? `+3 ? N −3−`
Z π
dω iω(k−`−2)
= (p ) (1−p ) e
k>2 k(k−1) `=0
` −π 2π
At this stage we use the integral representation of the Kronecker delta-symbol to get
rid of the ω-integral:
−3
(N −1)(N −2) NX N −3 ? `+3
(p ) (1−p? )N −3−` δk,`+2
X
hCi (A)i =
k>2 k(k−1) `=0
`
N −3
N −3 (N −1)(N −2) ? `+3
(p ) (1−p? )N −3−`
X
=
`=0
` (`+2)(`+1)
We now write explicitly the combinatorial factor, and clean up the various quantities
where possible:
N −3
(N −3)! (N −1)(N −2) ? `+3
(p ) (1−p? )N −3−`
X
hCi (A)i =
`=0 `!(N −3−`)! (`+2)(`+1)
N −3
(N −1)!
(p? )`+3 (1−p? )N −3−`
X
=
`=0 (`+2)!(N −3−`)!
N −3
N −1 ? `+3
(p ) (1−p? )N −3−`
X
=
`=0
`+2
N −3 N −1
N −1 ? `+2 N −1 ? `0 0
?
(p ) (1−p? )N −1−(`+2) = p? (p ) (1−p? )N −1−`
X X
=p 0
`=0
`+2 `0 =2
`
N −1
N −1 ? `0 0
= p? (p ) (1−p? )N −1−` − p? (1−p? )N −1 − p? (N −1)p? (1−p? )N −2
X
0
`0 =0
`
We then recognise that Newton’s binomial formula can be used to do the sum over `,
and proceed to our final result:
n N −1 o
hCi (A)i = p? p? + 1 − p? − (1−p? )N −1 − p? (N −1)(1−p? )N −2
n o
= p? 1 − (1−p? )N −1 − p? (N −1)(1−p? )N −2
The above proof is a useful exercise in the use of various bookkeeping tools, such
us summation formulae from Calculus, Newton’s binomial formula, and the integral
representation of the Kronecker delta-symbol. These tools will continue to serve us.
O(N −1 ) in order to have on average a finite number of partners per node in the system. We
now investigate properties of the ER ensemble in this finite connectivity limit.
• Claim: in the finite connectivity limit, i.e. for N → ∞ with hki fixed, the degree
distribution of the Erdös-Rènyi ensemble has the Poissonnian form
lim hp(k|A)i = e−hki hkik /k! (93)
N →∞
Proof:
X
lim p(k|A) = lim p(k|A)p(A|hki) (94)
N →∞ N →∞
A∈G
As always we manipulate all ensemble averages until they factorise over the bond
variables, since the entries of A are in the ER model distributed independently. Again we
use the symmetry and absence of diagonal elements of A, and the integral representation
of the Kronecker δ-symbol to achieve this:
1 X P 1 X Z π dω iωk −iω Pj Aij
lim hp(k|A)i = lim h δk, Aij i = lim e he i
N →∞ N →∞ N j N →∞ N −π 2π
i i
1 X Z π dω iωk −iω Pjs Asj δis
= lim e he i
N →∞ N −π 2π
i
1 X Z π dω iωk − 12 iω Pjs Asj (δis +δij )
= lim e he i
N →∞ N −π 2π
i
1 X Z π dω iωk −iω Pj<s Asj (δis +δij )
= lim e he i
N →∞ N −π 2π
i
1 X Z π dω iωk Y −iωAsj (δis +δij )
= lim e he i
N →∞ N −π 2π
i j<s
1 X Z π dω iωk Y X hki hki
= lim e δA,1 + (1− )δA,0 e−iωA(δis +δij )
j<s A∈{0,1} N −1 N −1
N →∞ N −π 2π
i
p(k)
0 0 0
0 5 10 15 0 5 10 15 0 5 10 15
k k k
Figure 26. Comparison between the theoretical prediction (93) for the average degree
distribution of infinitely large ER graphs (triangles) and the observed distributions in
random samples from the ER ensemble, for N = 50, 500, 5000 (histograms). Clearly,
for N = 500 the differences between actual degree distributions and the N → ∞ formula
are already small, and for N = 5000 they are more or less negligible. This means that
asymptotic results are useful descriptions of large but finite graphs.
1 X Z π dω iωk+ hki P
(e−iω −1)+O(N −1 )
= lim e N j6=i
N →∞ N −π 2π
i
1 X π dω iωk+hki(e−iω −1)+O(N −1 )
Z Z π
dω iωk+hkie−iω
= lim e = e−hki e
N →∞ N −π 2π −π 2π
i
The last step is the remaining integral over ω. It looks nasty, but is in fact simple.
Just expand exp(hkie−iω ) as a power series, and use the integral representation of the
Kronecker delta again:
−hki
Z π
dω iωk X hki` −i`ω −hki
X hki` Z π dω
lim hp(k|A)i = e e e =e eiω(k−`)
N →∞ −π 2π `≥0 `! `≥0 `! −π 2π
hki`
= e−hki δk` = e−hki hkik /k!
X
`≥0 `!
In Fig 26 we see that this asymptotic result (i.e. a formula derived for N → ∞) is accurate
already for large but finite graphs of size N ∼ 102 − 103 . In other words: in the finite
connectivity regime, size N ∼ 102 − 103 graphs appear to behave like infinite ones.
• Claim: in the finite connectivity limit, i.e. for N → ∞ with hki fixed, the average
clustering coefficients of the Erdös-Rènyi ensemble become
hki h i
hCi (A)i = 1 − e−hki − hkie−hki + O(N −2 ) (95)
N
Proof:
54
We substitute p? = hki/(N − 1) into (92) and expand the result for N → ∞, using
log(1 + x) = x + O(x2 ) and ex = 1 + x + O(x2 ):
hki h hki N −1 hki N −2 i
hCi (A)i = 1 − (1− ) − hki(1− )
N −1 N −1 N −1
hki h hki hki i
= 1 − e(N −1) log(1−N−1 ) − hkie(N −2) log(1−N−1 )
N −1
hki h hki −1 hki −1
i
= 1 − e−(N −1) N−1 +O(N ) − hkie−(N −2) N−1 +O(N )
N −1
hki h −1 −1
i
= 1 − e−hki+O(N ) − hkie−hki+O(N )
N −1
hki h i
= 1 − e−hki − hkie−hki + O(N −2 )
N
So in the finite connectivity scaling regime all clustering coefficients of typical Erdös-Rényi
graphs vanish for N → ∞, and the number of triangles per node is order N −1 . Using in
principle similar tools (but involving calculations that are more tedious), one can show that
large random graphs generated from the Erdös-Rényi ensemble (88) with fixed hki will be
locally tree-like (i.e. have a vanishing number of short loops per node) and will on average
have vanishing degree correlations,
for all (k, k 0 ) : lim hW (k, k 0 |A)i = [ lim hW (k|A)i][ lim hW (k 0 |A)i] (96)
N →∞ N →∞ N →∞
• Claim: the degree distribution follows from its generating function via
1 dk G(x)
p(k) = lim (98)
x→0 k! dxk
Proof:
This follows directly from application of the Taylor expansion to the function G(x),
which tells us that G(x) = `≥0 `!1 G(`) (0)x` .
P
55
• Claim: all moments hk m i of the degree distribution, with m ∈ IN, follow from the
generating function via
d m
hk m i = lim x G(x) (99)
x→1 dx
Proof:
For m = 0 the claim holds trivially. We just work out the recipe on the right for m > 0:
d m d m X d m−1 X d
x G(x) = x p(k)xk = x p(k)x xk
dx dx k≥0 dx k≥0 dx
d m−1 X d m−2 X
= x p(k)kxk = x p(k)k 2 xk
dx k≥0 dx k≥0
= ......
d 0 X
p(k)k m xk = p(k)k m xk
X
= x
dx k≥0 k≥0
Let us work out the generating function (97) for some simple degree distributions, with
average degree hki = q ≥ 0:
• Claim: the generating function of the degree distribution for regular random graphs,
where p(k) = δqk , is
G(x) = xq (100)
Proof: this is trivial, in the sum over k we retain only the term k = q.
• Claim: the generating function of the degree distribution for Poissonnian random
graphs, i.e. where p(k) = e−q q k /k! with q ≥ 0 (like finitely connected ER ones) is
G(x) = e−q(1−x) (101)
Proof:
y k /k! = ey :
P
We do the sum over k in (106), using k≥0
X q k xk
G(x) = e−q = e−q eqx = e−q(1−x) (102)
k≥0 k!
• Claim: the generating function of the degree distribution for random graphs with
q k
exponential degree distributions, i.e. where p(k) = ( 1+q ) /(1+q) with q ≥ 0, is
1
G(x) = (103)
1 + q(1 − x)
P P
(see exercises for proofs that this distribution obeys k p(k) = 1 and k p(k)k = q).
56
Proof:
y k = 1/(1−y):
P
We do the sum over k in (106), using k≥0
1 X qx k 1 1
G(x) = =
1+q k≥0 1+q 1+q 1 − qx/(1+q)
1 1
= = (104)
1 + q − qx 1 + q(1 − x)
In the exercises we confirm for all three examples that they indeed obey G(0) = 0, G(1) = 1,
d
and limx→1 x dx G(x) = q.
Clearly, having a giant component will have a significant impact on processes running
on the graph. Therefore we would like to calculate f . Since each randomly drawn node has
degree distribution p(k), we may use the following simple argument
1−f = Prob(randomly drawn node not in LCC)
X
= p(k).Prob(neighbours of randomly drawn node with degree k not in LCC)
k
Since the graph is tree-like, the only possible correlations among local topological features
of nodes in a generation g are those caused by their common ancestor (if any), so
Prob(k neighbours are not in LCC) = (1 − f )k , and hence we find that f is the solution of
the simple equation 1 − f = k≥0 p(k)(1 − f )k , or equivalently
P
f = 1 − G(1 − f ) (106)
where G(x) is the generating function (97). Since G(1) = 1 we see that f = 0 is always
a solution of (106), describing a graph with a non-extensive largest component, since the
57
' $
∂i
i
& %
Figure 27. In locally tree-like graphs the number of short loops is vanishingly small, for the
vast majority of the nodes the local topology is that of a tree. Hence, starting from a node
i, we would find that the tree branches descending from i are nearly disconnected – they
connect only at site i. In this example p(k) = δk,3 . With non-regular degree distributions
we will see local randomness in this environment.
relative size of the giant component is f N . The next question is whether there are solutions
of (106) with f > 0.
The solution of equation (106) can be found graphically by intersecting the function
F (f ) on the interval f ∈ [0, 1] with the diagonal, since this intersection has f = F (f ), in
which
F (f ) = 1 − G(1 − f )
regular random graphs, hki = q : F (f ) = 1 − (1 − f )q
f initely connected ER graphs, hki = q : F (f ) = 1 − e−f q (107)
exponential random graphs, hki = q : F (f ) = qf /(1 + qf )
(where we used the generating functions calculated in the previous subsection). We observe
that regular graphs are a special case. Here for q = 1 all values f ∈ [0, 1] obey f = F (q),
and for q > 1 the value f = 1 is always a solution of f = F (q).
The result of plotting the functions F (f ) on f ∈ [0, 1] for the above choices for p(k),
and of solving numerically the equation f = F (f ) for hki = q ∈ [0, 6] is shown in Figure
28. In all three cases the system undergoes a percolation phase transition at hki = q = 1,
where the system switches from f = 0 (for q < 1) to f > 0 (for q > 1). Exactly at hki = 1
the networks develop a giant component. The size of this component is largest for regular
graphs, and smallest for the exponential ones.
Universality of the percolation transition. It is no accident that in all three examples above
58
random regular finitely connected ER random exponential
1 1 1
0.4
q = 12 0.4 0.4
0.2 0.2
q = 12 0.2 q = 12
0 0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
f f f
1 1 1
f
0.6 0.6 0.6
0 0 0
0 1 2 3 4 5 6 0 1 2 3 4 5 6 0 1 2 3 4 5 6
Figure 28. Top row: shapes of the function F (f ) for three random graph types with average
degree hki = q: regular graphs with p(k) = δkq , finitely connected Erdös-Rèyi graphs (for
q k
large N ) with p(k) = e−q q k /k!, and exponential graphs with p(k) = ( 1+q ) /(1+q). Solid lines
in each panel: F (f ) for q ∈ { 12 , 1, 32 , 2, 52 , 3}, from bottom to top. Dotted: the diagonal,
whose intersection point with F (f ) marks the value f that gives the relative size of the
largest connected component in the graph. Bottom row: corresponding expected relative
sizes of the largest connected component (i.e. solutions of F (f ) = f ) in each of the there
random graphs, shown as a function of the average degree hki. In all cases a giant component
appears in the graphs at hki = 1, which is interpreted as a percolation transition point.
the percolation transition occurs at the same point hki = 1. The transition point correspond
to the value of hki where the trivial solution f = 0 of F (f ) = f ceases to be unique, this event
is called a bifurcation of a new solution of (106). Figure 28 (bottom row) shows that, except
for the degenerate case of regular graphs, the transition is generally continuous, i.e. there
is no jump in the solution f when we vary hki. This prompts us to do a simple continuous
bifurcation analysis of (106) near f = 0, by expansion in powers of f :
k
k k
(−f )`
X X X
f =1− p(k)(1 − f ) = 1 − p(k)
k≥0 k≥0 `=0
`
59
0.9
0.8
hki = 2.0
0.7
0.6
Frac(dij ≤ d) hki = 1.8
0.5
Figure 29. The fraction of node pairs (i, j) in randomly generated ER graphs that are
found to have a distance dij ≤ d, shown versus d. Here N = 1000 and hki ∈ [0, 2]. One
observes clearly that there is a sharp transition at hki ≈ 1. For hki < 1 the fraction of node
pairs at a finite distance from each other is vanishing small. For hki > 1 this fraction all of
sudden becomes finite, which marks the emergence of the giant component in the graph.
k
(−f )`
X X
=1− p(k)
`≥0 k≥`
`
nX k k o
+ f2 + O(f 3 )
X X
=1− p(k) − f p(k) p(k)
k≥` k≥1
1 k≥2
2
k!
p(k)k − f 2 + O(f 3 )
X X
=f p(k)
k≥1 k≥2 2(k−2)!
1 X
= f hki − f 2 p(k)k(k−1) + O(f 3 )
2 k≥2
1 X
= f hki − f 2 p(k)k(k−1) + O(f 3 )
2 k≥0
1
= f hki − f 2 hk(k−1)i + O(f 3 ) (108)
2
So our equation for f can be written as
1
f 1 − hki + f hk(k−1)i + O(f 3 ) = 0 (109)
2
60
For sufficiently small f we may neglect the cubic term and conclude
hki−1
f = 0 or f = 2 (110)
hk 2 i−hki
It can be shown (see exercises) that always hk 2 i > hki unless we have a graph without
links. Hence, as soon as hk 2 i − hki < ∞ a new solution f > 0 bifurcates exactly when
hki = 1, irrespective of the shape of the degree distribution p(k). Only for power law degree
distributions, where hk 2 i = ∞, this bifurcation does not occur, and we have to evaluate
(106) in full to study whether and when a giant component may appear.
In Figure 29 we show that the predicted emergence of a giant component at a sharply
defined value of hki is real, for numerically generated random Erdös-Rènyi graphs of size
N = 1000, and with hki ∈ [0, 2]. We plot the fraction of node pairs (i, j) (with i 6= j)
that have a distance dij ≤ d, as a function of d. Clearly, there is a phase transition at
hki ≈ 1, where all of a sudden the typical distances between nodes in the graph become
finite, marking the creation of the giant component.
Note that all calculations in this subsection were based on the assumption that the
neighbours of any randomly picked node have degrees that are distributed independently.
Just giving the degree distribution of a graph is not enough, as we have already seen in e.g.
Figure 20; we need to specify the full ensemble probabilities p(A) to check when this assumed
degree independence holds. It is easy to construct graphs with hki > 1 (see exercises for an
example of a regular graph with hki = 2) without a giant component. For the Erdös-Renyi
ensemble, where we indeed have a fully specified p(A), a more precise calculation can be
done, and here (106) is indeed found to be exact in the limit N → ∞.
Tailored random graphs with hard constraints. If we go for (111), we need only define p(A)
for all graphs A that obey Ω(A) = Ω(A? ). All other graphs are forbidden. We choose
the collection of allowed graphs to be our set G, and we take the functions Ωµ (A) to be
P
integer-valued. Maximisation of (139) subject to the constraint A∈G p(A) = 1, using
Lagrange’s method (see Appendix 8.8), then gives the following equations that are to be
solved simultaneously for {p(A)}:
∂ h i
p(A0 )
X
∀A ∈ G : 0= S[p, G] + λ 1 −
∂p(A)
A0 ∈G
∂ h i
p(A0 ) log p(A0 ) − λ p(A0 )
X X
= −
∂p(A)
A0 ∈G A0 ∈G
∂ h i
= − p(A) log p(A + λp(A) = − log p(A) − 1 − λ (114)
∂p(A)
Hence log p(A) = −1 − λ for all A ∈ G, or p(A) = e−1−λ . Normalisation tells us that
−1−λ
= |G|−1 . The end result is the following maximum entropy
P
A∈G p(A) = 1, hence e
ensemble, in which all graphs A that meet our constraints are equally probable
1
∀A ∈ G : p(A|Ω) = , Z(Ω) = |G| (115)
Z(Ω)
2
Z(Ω) ≥ 1 is the number of graphs in {0, 1}N that exhibit Ω(A) = Ω(A? ). We could also
2
choose to work with the set G = {0, 1}N of all N -node graphs, and forbid those graphs A
62
' $
' $
Ω1 (A) = Ω1 (A? )
' $
Ω2 (A) = Ω2 (A? )
' $
Ω3 (A) = Ω3 (A? )
• A?
&
& % %
&
& % %
Figure 30. Systematic tailoring of random graph ensembles, in order to generate random
graphs that resemble a given graph A? , by prescribing that a series of K measurements
Ωµ (A) give values identical to those found for A? . The larger K, the smaller the ‘box’
of graphs that meet all K imposed conditions, and the more similar the graphs in the
remaining box will be to A? . The probabilities p(A) assigned to all graphs A in each box
are determined via entropy maximisation.
that do not satisfy the constraints by assigning to them p(A) = 0. This givesk
δΩ(A),Ω(A? ) X
∀A ∈ G : p(A|Ω) = Z(Ω) = δΩ(A),Ω(A? ) (116)
Z(Ω)
A∈G
Global constraints such as nondirectionality or simplicity can in principle be incorporated
via the quantities Ωµ (A), but it is often more transparent to build such constraints into the
definition of G. Ensembles of the type (116) are also called microcanonical ensembles.
Tailored random graphs with soft constraints. If we choose the soft constraints (112),
we have to build any global constraints into the set G, and maximise the entropy (139)
subject to A∈G p(A) = 1 and A∈G p(A)Ωµ (A) = Ωµ (A? ) for all µ = 1 . . . K. The
P P
K
∂ h i
p(A0 ) + λµ Ωµ (A? ) − p(A0 )Ωµ (A0 )
X X X
∀A ∈ G : 0= S[p, G] + λ0 1 −
∂p(A)
A0 ∈G µ=1 A0 ∈G
Q
k We use the standard notation convention δx,y = µ δxµ yµ .
63
K
∂ h i
p(A0 ) log p(A0 ) − λ0 p(A0 ) − p(A0 )Ωµ (A0 )
X X X X
= − λµ
∂p(A)
A0 ∈G A0 ∈G µ=1 A0 ∈G
K
∂ h X i
= − p(A) log p(A) + λ0 p(A) + λµ p(A)Ωµ (A)
∂p(A) µ=1
K
X
= − 1 − log p(A) − λ0 − λµ Ωµ (A) (117)
µ=1
Thus the solution of Lagrange’s equations takes the following form, after having determined
P
the value of λ0 from the normalisation requirement A∈G p(A) = 1:
PK
λµ Ωµ (A)
e− µ=1 PK
λµ Ωµ (A)
e−
X
∀A ∈ G : p(A) = , Z(Ω) = µ=1 (118)
Z(Ω)
A∈G
in which the parameters {λ1 , . . . , λK } are found by solving the coupled equations
Ωµ (A? ) =
X
∀µ ∈ {1, . . . , K} : p(A)Ωµ (A)
A∈G
1 X − PK λν Ων (A)
= e ν=1 Ωµ (A). (119)
Z(Ω)
A∈G
One can show that equations (119) have a unique solution, but solving them numerically
is nontrivial. Even for simple nondirected graphs it involves sampling a space of size
|G| = 2N (N −1)/2 . Sometimes one can proceed analytically, if one chooses the Ωµ (A) wisely
and N is large. The ensembles (118) are also called exponential or canonical ensembles.
In the above derivations of the hard-constrained and the soft-constrained ensembles we
should in principle have included also the inequality constraints p(A) ≥ 0 for all A ∈ G
when maximising the Shannon entropy (139). However, it turned out in both cases that
even without imposing them explicitly, the inequality constraints are satisfied automatically
by the maximum entropy distributions. Hence they are obsolete.
Ensembles with constrained average degree. We first inspect ensembles of simple non-directed
graphs in which the only information we choose to carry over from the given graph A? is
the value k̄ = N −1 ij A?ij of the average degree, i.e. K = 1 and Ω1 (A) = N −1 ij Aij .
P P
It turns out that the maximum entropy ensemble of simple nondirected graphs in which
this average degree is imposed via a soft constraint is the Erdös-Rényi ensemble (88). See
exercises. Imposing the average degree as a hard constraint, in contrast, leads to the following
ensemble defined on the set G of all simple non directed N -node graphs:
1 X
p(A) = δP Aij ,N k̄ , Z(k̄) = δP Aij ,N k̄ (120)
Z(k̄) ij ij
A∈G
Each graph with average degree k̄ is equally likely, but for this ensemble not to be empty
we need N k̄ ∈ IN; this will automatically be the case if k̄ = N −1 i ki (A? ) for some N -node
P
64
graph A? . The factor Z(k̄) gives the number of graphs in G with average degree k̄.
Ensembles with hard-constrained degree sequences. The natural next step up is to impose
instead of only the average degree the values of all N degrees k = (k1 , . . . , kN ); typically
these would be the degrees of an observed graph A? . If the degrees k are imposed as hard
constraints, so we allow only for graphs A for which k(A) = k, we obtain an ensemble on
the set G of simple non directed graphs that is called the ‘configuration model’:
1 X
p(A|k) = δk,k(A) , Z(k) = δk,k(A) . (121)
Z(k)
A∈G
All graphs A that have the degree sequence k are equally probable, and all graphs that do
not have this degree sequence are assigned probability zero.
Figure 31. The Watts-Strogatz non-directed network model. Starting from a ring in which
each node is connected to its K ≥ 2 nearest neighbours (shown on the left, here with K = 4),
one subsequently replaces a given fraction p of the original nearest neighbour edges with
randomly selected alternative edges (not necessarily between neighbours in the ring). The
total number of edges remains 21 N K, and the average connectivity is always k̄(A) = K.
N
X X h e−λ` −λr 1 i
= A`r δ A ,1 + δA ,0
r=1 A`r ∈{0,1} 1 + e−λ` −λr `r
1 + e−λ` −λr `r
N N
X e−λ` −λr X 1
= −λ −λ
= λ` +λr
(126)
r=1 1 + e r=1 1 + e
` r
In the same manner one can impose further topological features (degree correlations, number
of loops, etc), via soft constraints, hard constraints, or even a mixture of the two.
7. Further topics
1 K = 2.08, 2.10
0.8
K = 2.06
0.6 K = 2.04
Frac(dij ≤ d)
0.4
K = 2.02
0.2
K = 2.00
0
0 5 10 15 20 25 30 35 40 45 50
Figure 32. The fraction of node pairs (i, j) that are found to have a distance dij ≤ d,
shown versus d, measured in small world graphs created by superimposing an Erdös-Rènyi
graph with average degree K −2 upon a ring with nearest-neighbour interactions only. The
combined graph has expected average degree hki = K. For K = 2 we would have only
short-range links. Here N = 1000 and hki ∈ [2.0, 2.1], and each curve refers to a single
graph (hence there are fluctuations). One observes a relatively sharp transition – at around
K = 2.07 where there is still only a small fraction of ‘long-range’ links – to graphs with the
short typical distances that characterise the small-world effect.
distance-related quantities in the graph depend on the fraction p of links that have become
random and long-range, as opposed to short-range.
Superposition construction. An alternative construction that is very similar but more easily
analysed mathematically is the following. Again all N nodes are initially placed on a ring.
We then (a) connect all nearest neighbours, and (b) superimpose on this an Erdös-Rènyi
graph with average degree hki = K − 2. Provided N is large and K is small, the likelihood
of a proposed random link coinciding with an existing nearest neighbour link on the ring is
negligible – if it happens we simply don’t add the random one. We then obtain the following
adjacency matrix A, built from the deterministic ring AD and the random ER graph AR :
Aij = AD R D R
ij + Aij − Aij .Aij (127)
AD
ij = δi,j+1 mod N + δi,j−1 mod N (128)
Y K −2 K −2
p(AR ) = δARij ,1 + (1− )δ R (129)
i<j N −1 N −1 Aij ,0
67
Inspection reveals (see e.g. Figure 32) that only a small fraction of the edges in the graph
need to be non-local to achieve the ‘small world’ effect.
Here kj (`) is the degree of node j after ` steps of the process. We terminate if the size of
the network is what we want it to be.
Next we show that it leads to a power-law degree distribution. Let us first summarise
a few facts regarding the number of nodes N and links L, and the degrees.
p` (k|`+1) = δk1 . At each step ` of the process, the degree of each node i ≤ ` either stays the
same, this happens with probability 1 − Prob(Ai,`+1 = 1), or increases by one, which happens
with probability Prob(Ai,`+1 = 1). Hence
no degree increase at step ` degree increase at step `
z }| { z }| {
k k−1
∀i ≤ ` : p` (k|i) = p`−1 (k|i) 1 − + p`−1 (k−1|i) (131)
2(`−1) 2(`−1)
Next we move to the overall degree distribution after ` steps, defined as
`+1 `
1 X 1 X 1
p` (k) = p` (k|i) = p` (k|i) + δk1 (132)
`+1 i=1 `+1 i=1 `+1
Inserting (131) into the right-hand side of this latter expression gives
` n
1 X k k−1 o 1
p` (k) = p`−1 (k|i) 1 − + p`−1 (k−1|i) + δk1
`+1 i=1 2(`−1) 2(`−1) `+1
` `
` k 1 X ` k−1 1 X 1
= 1− p`−1 (k|i) + p`−1 (k−1|i) + δk1
`+1 2(`−1) ` i=1 `+1 2(`−1) ` i=1 `+1
` k ` k−1 1
= 1− p`−1 (k) + p`−1 (k−1) + δk1 (133)
`+1 2(`−1) `+1 2(`−1) `+1
So now we have a closed dynamical equation for the evolving overall degree distribution.
Let us check that the probabilities in our equation remain properly normalised. Suppose
P
k≥0 p`−1 (k) = 1. Summation over all k in our equation gives:
X ` X k ` X k−1 1
p` (k) = 1− p`−1 (k) + p`−1 (k−1) +
k≥0 `+1 k≥0 2(`−1) `+1 k≥0 2(`−1) `+1
` ` 1 X ` 1 X
= − kp`−1 (k) + (k+1)p`−1 (k)
`+1 `+1 2(`−1) k≥0 `+1 2(`−1) k≥0
` 1 1
− +
`+1 2(`−1) `+1
` 1
= + =1 (134)
`+1 `+1
Hence normalisation is preserved, as it should. In the same manner one can confirm form
the dynamical equation (133) that the average degree after ` iterations is indeed given by
2`/(`+1) (see Exercises).
The final step is to find the asymptotic solution of (133). To do this we introduce a
real-valued time variable t` = `τ , with 0 < τ 1, and adapt our notation according to
p` (k) → pt` (k). Our equation then becomes
` k−1 ` k 1 1
pt` (k) − pt`−1 (k) = pt`−1 (k−1) − pt`−1 (k) − pt`−1 (k) + δk1
`+1 2(`−1) `+1 2(`−1) `+1 `+1
pt` (k) − pt`−1 (k) 1 n k−1 k o
= pt`−1 (k−1) − pt`−1 (k) − pt`−1 (k) + δk1
τ t` + τ 2(1−τ /t` ) 2(1−τ /t` )
69
pt` (k) − pt` −τ (k) 1 n k−1 k o
= pt` −τ (k−1) − pt` −τ (k) − pt` −τ (k) + δk1
τ t` + τ 2(1−τ /t` ) 2(1−τ /t` )
(135)
We now take the limit τ → 0 (assuming that it exists) and find
d 1 1
t pt (k) = (k−1)pt (k−1) − (k+2)pt (k) + δk1 (136)
dt 2 2
Stationary solutions of this equation are apparently to be solved from
(k−1)p(k−1) − (k+2)p(k) + 2δk1 = 0 (137)
One can confirm (see Exercises) that this equation is solved by:
4
p(0) = 0, k > 0 : p(k) = (138)
k(k+1)(k+2)
This is clearly a power law degree distribution, with p(k) ∼ k −3 for large k. The average
degree is finite, but k k 2 p(k) diverges, so the width of p(k) is infinite (see Exercises).
P
Variations on the above preferential attachment process include e.g. starting with more
than one disconnected node, or making multiple links at each iteration step.
log Z(Ω). With the definition of Z(Ω) as given in (115) we then obtain
X
δΩ,Ω(A) = exp[S(Ω)] (140)
A
The left-hand side is exactly the number of graphs that have features Ω(A) = Ω, so we
can define the complexity of typical graphs with Ω(A) = Ω simply as the logarithm of this
number, i.e. simply as the Shannon entropy (139) of the ensemble. The same definition
(139) can then be used also for the soft-constrained ensembles (118).
Total number of N -node graphs. The total number of N -node graphs is simply the number
of ways we can choose the binary entries of the adjacency matrix. For directed graphs this
70
2 1
Z = 2N , for non-directed graphs we find Z = 2 2 N (N +1) , and for simple non-directed graphs
1
we get Z = 2 2 N (N −1) . So in all cases log Z ∼ 12 N 2 in leading order for large N . In the
finite connectivity regime, however, we allow only for a finite number of nonzero entries per
row and per column of the adjacency matrix. This reduces the number of possibilities. The
question is: by how much? Below we study this problem for simple-nondirected graphs,
similar results can be derived for directed ones (see also the exercises).
Simple non-directed graphs with specified average degree. Let us calculate the number of
N -node simple nondirected graphs that have average degree k̄, given that N k̄ ∈ IN. This is
simply Z(k̄) in the ensemble (120). Upon writing the Kronecker symbol in Z(k̄) in integral
form, and upon choosing G to be the set of all simple non-directed graphs, we obtain
Z π
X dω iωN k̄/2 X −iω Pi<j Aij
Z(k̄) = δN k̄,P
A = e e
ij ij −π 2π
A∈G A∈G
Z π Z π
dω iωN k̄/2 Y X −iωAij dω iωN k̄/2
= e e = e (1 + e−iω )N (N −1)/2
−π 2π i<j Aij ∈{0,1} −π 2π
−1)/2
dω iωN k̄/2 N (NX
!
N (N − 1)/2
Z π
= e e−iωm
−π 2π m=0 m
N (N −1)/2 ! !
X N (N − 1)/2 N (N − 1)/2
= δm,N k̄/2 = (141)
m=0 m N k̄/2
This result can be understood easily, as it gives the number of possible ways in which one
can draw N k̄/2 links from a set of N (N − 1)/2 possible candidates.
For large N and finite k̄ (the finite connectivity regime) we can inspect the leading
orders in N , using Stirling’s formula log n! ≈ n log n − n + O(log n) for n → ∞. If both n
and m are large (with m n), this formula, together with log(1 + x) = x + O(x2 ), allows
us to write
n!
log = log n! − log m! − log(n−m)!
(n−m)! m!
≈ nnlog n − (n−m) log(n−m) − m log m +oO(log n, log m)
m m
= n log n − (1− ) log(n−m) − log m + O(log n, log m)
n n
n m m m m o
= n log n−(1− ) log n−(1− ) log(1− )− log m + O(log n, log m)
n n n n
nm n mo m2
=n log + + O(log n, log m) + O( 3 )
n m n n
n m2
= m log + m + O(log n, log m) + O( 3 ) (142)
m n
Application of this expansion to n = 12 N (N −1) and m = 21 N k̄ then gives us
1 1 log N
N −1 log Z(k̄) = k̄ log[(N −1)/k̄] + k̄ + O( )
2 2 N
1 1 log N
= k̄ log(N/k̄) + k̄ + O( ) (143)
2 2 N
71
Thus for large N the leading order of the number of graphs with finite average degree k̄ still
grows super-exponentially as Z(k̄) ∼ exp( 21 k̄N log(N ) + . . .). This means that one can never
hope to sample numerically the space of all such graphs, even for relatively modest sizes N .
For instance, working out the formula gives
N = 32, k̄ = 2 : Z(k̄) ≈ 2.7 1052 (144)
91
N = 50, k̄ = 2 : Z(k̄) ≈ 4.1 10 (145)
These are very big numbers (for comparison: the total number of atoms in the observable
universe is estimated to be somewhere between 1078 and 1082 ).
Simple non-directed graphs with specified degree distribution. The next stage is to impose
not only the average degree k̄, but the full degree distribution p(k). The calculation is not
fundamentally different from the previous one but does require some new tools (saddle-point
integration), so here we mention only the result:
1 1 1 X p(k) log N
log Z({p(k)}) = k̄ log(N/k̄) + k̄ − p(k) log[ ] + O( ) (146)
N 2 2 k π(k) N
Here k̄ = k kp(k), and π(k) = e−k̄ k̄ k /k! (the degree distribution of Erdös-Rènyi graphs with
P
average degree k̄). Comparison to (143) shows that, due to the prescribed degree distribution,
N −1 log Z has been reduced by an amount which is the Kullback-Leibler distance (see
Information Theory) between p(k) and the degree distribution of an ER graph with the
same k̄. We see that if we impose the degree statistics p(k) = π(k) for all k, formula (146)
reduces to (143). Hence
Z({p(k)}) P
= e−N k p(k) log[p(k)/π(k)]+O(log N ) (147)
Z({π(k)})
This tells us that, for large N , nearly all graphs with a given finite average degree k̄ have a
Poissonnian degree distribution.
Simple non-directed graphs with specified degree distribution and specified degree correlations.
We can in the same way prescribe further information beyond the degree distribution, such
as the degree correlation kernel W (k, k 0 ). This turns out to give
1 1 1 p(k)
log Z({p(k), W (k, k 0 )}) = k̄ log(N/k̄) + k̄ −
X
p(k) log[ ]
N 2 2 k π(k)
1 X h W (k, k 0 ) i log N
− k̄ W (k, k 0 ) log 0
+ O( ) (148)
2 k,k0 W (k)W (k ) N
Comparison to (146) shows that prescribing W (k, k 0 ) reduces the quantity N −1 log Z further
by an amount which is proportional to the mutual information (see Information Theory) of
the degrees of connected nodes. We see that if we impose that degrees of connected nodes
are uncorrelated, i.e. W (k, k 0 ) = W (k)W (k 0 ) for all (k, k 0 ), formula (148) reduces to (146).
Hence nearly all graphs with a given degree distribution p(k) have uncorrelated degrees.
72
8. Appendices
Hence if u and v are perfectly positively linearly correlated we find PC = 1, and if they
are perfectly negatively linearly related we find PC = −1.
i,j=1 i=1
Proof:
For each x ∈ L and y ∈ L⊥ we find (x · Ay) = (y · Ax) = 0 (since Ax ∈ L and
y ∈ L⊥ ). Therefore Ay ∈ L⊥ , which completes the proof.
Basis of eigenvectors and diagonal form. The final consequence of the above facts is that
there exist a set of N vectors {êi }, where i = 1, . . . , N and êi ∈ IRN for all i, with the
following properties:
Aêi = λi êi , λi ∈ IR, λi > 0, êi · êj = δij (151)
We can now bring A onto diagonal form by a simple unitary transformation U , which we
construct from the components of the normalised eigenvectors ê: Uij = êji . We denote the
transpose of U by U † , Uij† = Uji , and show that U is indeed unitary, i.e. U † U = U U † = 1I:
(U † U )ij xj = U ki Ukj xj = êik êjk xj =
X X X X
δij xj = xi
j jk jk j
j jk jk k
(since {ê } is a complete orthogonal basis). From U being unitary it follows that U and U †
`
Note that the inverse A−1 of the matrix A exists, and can be written as follows:
N
(A−1 )ij = λ−1 k k
X
k êi êj (153)
k=1
To prove that this is the inverse of A, we work out for any x ∈ IRN the two expressions
N N N
−1
λ−1 ` `
ê`i (ê` · x) = xi
X X X
(AA x)i = Aik ` êk êj xj =
kj=1 `=1 `=1
`
(again since {ê } forms a complete orthogonal basis), and
N X
N N
(A−1 Ax)i = λ−1 ` `
ê`i (ê` · x) = xi
X X
` êi êk Akj xj =
kj=1 `=1 `=1
The problem arises when we want to actually write down an expression for δ(x). Intuitively
one could think of writing something like
1 2 2
δ(x) = lim G∆ (x) G∆ (x) = √ e−x /2∆ (155)
∆→0 ∆ 2π
This is not a true function in a mathematical sense; δ(x) is zero for x 6= 0 and δ(0) = ∞. The
way to interpret and use expressions like (155) is to realize that δ(x) only has a meaning
when appearing inside an integration. One then takes the limit ∆ → 0 after performing
the integration. Upon adopting this convention, we can use (155) to derive the following
properties (for sufficiently well-behaved and differentiable functions¶ f ):
Z Z Z
dx −x2 /2
dx δ(x)f (x) = lim dx G∆ (x)f (x) = lim √ e f (∆x) = f (0)(156)
∆→0 ∆→0 2π
( )
Z
0
Z
d
dx δ (x)f (x) = lim dx [G∆ (x)f (x)] − G∆ (x)f 0 (x) (157)
∆→0 dx
= lim [G∆ (x)f (x)]∞ 0 0
−∞ − f (0) = −f (0) (158)
∆→0
¶ The conditions on the so-called ‘test-functions’ f can be properly formalized; this not being a course on
distribution theory, we just concentrate on the basic ideas and properties.
77
Equivalently we can take the result (159) as our definition of the δ-distribution.
8.7. Series
I refer to first year Calculus courses for general results on the convergence of ordinary series,
of the form k≥0 ak , or power series, of the form k≥0 ak z k with z ∈ C | . For this course on
P P
networks we only need to remember and use some specific results such as:
(
X
−γ convergent if γ > 1
γ ∈ IR : k = (160)
k>0
divergent if γ≤1
n
1 − z n+1
zk =
X
∀z ∈ C
| , z 6= 1 (161)
k=0 1−z
X zk
= ez ∀z ∈ C
| (162)
k≥0 k!
9. Exercises
Section 2
(i) Which if the three graphs below is simple? Which of them is directed? Give for each
these graphs the vertex set V and the edge set E.
5 4
9
•6 7 7
•
•@I •K
A
•@ •6
@ A @
@ A @
2 • •
-@
6I
@
-A •4 1 • •
@
@
•3
3@@ 2@@
10 • • 11
@
8 • •9
@
• •
6 5
(ii) Calculate the adjacency matrices for each of the three graphs above, upon relabelling
the nodes of the first graph such that its vertex set becomes V = {1, . . . , 9}.
(iii) Use the adjacency matrices calculated in the previous exercise to prove that the first
of the three graphs has exactly four paths of length three and no paths of length 4 or
larger. Argue why we can be sure that the middle and right graphs will contain paths
of any length ` > 0.
Section 3
(iv) Calculate all in-degrees and all out-degrees of the above three graphs.
(v) Prove that in nondirected graphs always kiin (A) = kiout (A).
Prove that for non-directed graphs one always has ki (A) = (A2 )ii .
(vi) Show that in any simple non-directed graph with adjacency matrix A one has Ci (A) =
2Ti (A)/ki (A)[ki (A) − 1], where Ti (A) is the number of triangles in which node i
participates, and ki (A) is its degree.
(vii) Calculate the clustering coefficients for all nodes in the second and the third of of the
above graphs. Why would we not calculate them for the first graph?
(viii) Define the neighbourhood ∂i of a node i in a nondirected graph with adjacency matrix
A as follows: ∂i = {j ≤ N | Aij = 1}. Show that the order-2 generalised degrees can be
(2) (2)
written as ki (A) = j∈∂i kjin (A). Calculate all order-2 generalised degrees ki (A) of
P
(ix) Prove that in directed graphs always L = i kiin (A) = kiout (A). Show that in a
P P
i
simple non-directed graph one has L = 21 N k̄(A).
(x) Verify that the order-` generalised degrees in a nondirected graph with adjacency matrix
A can be written as
N
(`)
(A`−1 )ij kj (A)
X
ki (A) =
j=1
Show that the corresponding expressions for directed graphs are, with (A† )ij = Aji :
N N
(`)in (`)out
`−1
)ij kjin (A), (A† `−1
)ij kjout (A)
X X
ki (A) = (A ki (A) =
j=1 j=1
`
(xi) Prove the matrix identity (1I − γA)−1 = `≥0 γ ` A . Given any matrix norm |A| that
P
satisfies the usual conditions (i.e. |A| ∈ IR+ , |λA| = |λ||A| for any λ ∈ IR, |A| = 0 if
and only if A = 0, |A1 + A2 | ≤ |A1 | + |A2 |), show that there is always a sufficiently
small but nonzero value of γ such that the series `≥0 γ ` A` converges in norm.
P
(xii) Consider the N -node graph with N > 2 and the following adjacency matrix entries:
Aij = δi,j+1 mod N + δi,j−1 mod N . Prove that for this graph
−1
−1 1 NX e2πi`(r−s)/N
r, s ∈ {1, . . . , N } : [(1I − γA) ]rs =
N `=0 1 − 2γ cos(2π`/N )
(you may find the geometric series helpful in proving this, as well as the series
(1 − )−1 = m≥0 m ; see Calculus lectures).
P
(xiii) Calculate the closeness centrality and the betweenness centrality of nodes i = 2 and
i = 3 in the second and the third of of the graphs in exercise (i).
(xiv) Show that the definition of the Pearson correlation similarity τij (A) can be derived from
the definition of the Pearson correlation of two random variables (u, v), upon choosing
P (u, v) = N1 k δu,Aik δv,Ajk .
P
(xv) Let x · y denote an inner product on IRN , so that it meets the defining criteria:
(a) (∀x, y, z ∈ IRN ) : (x + y) · z = x · z + y · z
(b) (∀x · y ∈ IRN )(∀λ ∈ IR) : x · (λy) = λx · y
(c) (∀x · y ∈ IRN ) : x · y = y · x
(d) (∀x ∈ IRN ) : x · x ≥ 0, with equality if and only if x = 0
Prove the Schwartz inequality: |x·y| ≤ |x||y|. Hint: calculate |x+λy|2 |y|2 with λ ∈ IR,
and choose a clever value for λ at the end.
(xvi) Explain why the two expressions given for the cosine similarity σij (A) of two nodes i
and j in a nondirected graph are identical. Show that |σij (A)| ≤ 1, and that σij (A) = 1
if and only if ∂i = ∂j . Hint: define for each node i the vector a(i) = (Ai1 , Ai2 , . . . , AiN ) ∈
{0, 1}N , and write σij (A) in terms of the two vectors a(i) and a(j) .
80
(xvii) Explain why the two expressions given for the Pearson correlation similarity τij (A) of
two nodes i and j in a nondirected graph are identical. Show that |τij (A)|
√ ≤ 1. Hint:
(i) (i) 1 P
define for each node i the vector a with entries ak = [Aik − N ` Ai` ]/ N , and write
τij (A) in terms of a(i) and a(j) .
Section 4
in
(xviii) Prove that the average in-degree k (A) = N −1 i kiin (A) and the average out-degree
P
out
k (A) = N −1 i kiout (A) of any graph (directed or non-directed) are always identical.
P
Show that the total number of links in a directed graph can be written as either
L = N
P in PN out
i=1 ki (A) or L = i=1 ki (A). Show that in simple nondirected graphs the
number of links is L = 12 N k̄(A), where k̄(A) = N −1 i≤N ki (A) is the average degree.
P
(xix) Prove the following identities for the density ρ(A) of a graph with adjacency matrix A:
directed graphs : ρ(A) = k(A)/N
X
nondirected graphs : ρ(A) = k(A)/(N +1) + Aii /N (N +1)
i
simple nondirected graphs : ρ(A) = k(A)/(N −1)
(xx) Calculate the diameter d(A) and the degree distribution p(k|A) for the middle and the
right graph in question (i).
(xxi) Consider the following degree distribution for an infinitely large non-directed graph:
p(k) = e−q q k /k! ∀k ∈ IN. Calculate the average degree hki = k≥0 p(k)k and the
P
(xxiii) Consider the following degree distribution for an N -node non-directed graph: p(k) = 0
for k = 0 or k > N , and p(k) = CN k −γ for 0 < k ≤ N . Calculate CN . For which γ
values is p(k) normalisable for N → ∞? Give formulas for hki and the degree variance
σk2 = k≥0 p(k)k 2 − hki2 . For which γ values is hki finite in the limit N → ∞? For what
P
values of γ is the variance finite for N → ∞? Give an estimate of the average and the
variance for γ = 2.5 and N = 10,000, using the approximation N −λ
≈ 1N dk k −λ .
P R
k=1 k
(xxiv) Calculate the degree distributions for the N -node graphs with the following adjacency
matrices (check carefully whether they are directed or non-directed, and use the correct
degree distribution definition in each case):
(a) Aij = δi,j+1 for j < N , and AiN = 0.
(b) Aij = 1 for all i, j ∈ {1, . . . , N }
(c) Aij = 0 for all i, j ∈ {1, . . . , N }
(d) Aij = 1 if either i, j ∈ {1, . . . , N/2} or i, j ∈ {N/2+1, . . . , N }; Aij = 0 otherwise
(e) Ai1 = 1 for all i > 1, Aij = 0 for all other (i, j).
81
(xxv) Show that the degree correlation ratio Π(k, k 0 |A) of a ‘regular’ simple non-directed
graph A, i.e. one with p(k|A) = δk,k? for some k ? ∈ IN, is always equal to 1 for any
(k, k 0 ).
(xxvi) Prove that W1 (~k|A) = p(~k|A)k in /k̄(A) and that W2 (~k 0 |A) = p(~k 0 |A)k out0 /k̄(A).
(xxvii) Prove the following general bounds for the modularity: − 21 ≤ Q(A) ≤ 12 .
(xxviii) Assign the following module labels to the nodes of the right graph in exercise (i):
x1 = x2 = 1, x3 = x4 = x5 = 2. Calculate the graph’s modularity Q(A). Next
turn to graphs (b) and (d) in exercise (xxiv). Assign the following module labels to the
nodes: xi = 1 for i ≤ N/2 and xi = 2 for i > N/2 (take N to be even). Calculate the
modularity Q(A) for both graphs.
Section 5
(xxix) Show how the average degree k̄(A) and the total number of triangles T (A) in a simple
non-directed N -node graph can be calculated directly from the spectrum %(µ|A) of its
adjacency matrix.
(xxx) Calculate the adjacency matrix eigenvalue spectrum %(µ|A) of the middle graph in
exercise (i). Use your result to calculate the average degree, and to prove that this
graph has no closed paths of odd length.
(xxxi) Calculate the Laplacian matrix L of the middle graph in exercise (i), and its eigenvalue
spectrum %Lap (µ|A). Hint: write L = 1I + B and first find the eigenvalues of B, where
1I is the unity matrix. Use your result to prove that this graph has only one connected
component.
(xxxii) Use the results of the previous exercise to solve the dynamical equations describing a
diffusion process on the middle graph in exercise (i), that starts with zi (t) = z0 δi2 (i.e.
diffusion from the central node i = 2). Verify that your result makes sense for t = 0
and in the limit t → ∞. Verify that the quantity i zi (t) is conserved over time.
P
(xxxiii) Show that for regular N -node graphs, i.e. those for which all N degrees ki (A) are
identical, one can express the Laplacian eigenvalue spectrum %Lap (µ|A) in terms of the
adjacency matrix eigenvalue spectrum %(µ|A). Give the mathematical relation between
the two in explicit form.
(xxxiv) Consider the N -node graph with the following adjacency matrix entries, with N > 2:
Aij = δi,j+1 mod N + δi,j−1 mod N . Calculate the adjacency matrix spectrum %(µ|A) and
the Laplacian spectra and %Lap (µ|A). Hints: use the result of the previous exercise, and
try Fourier modes xk = eiωk as an ansatz for the eigenvectors. Confirm that the smallest
eigenvalue of the Laplacian is zero, and use the spectrum to determine the number of
connected components in the graph.
82
Section 6
(xxxv) For the Erdös-Rènyi model we know that hk̄(A)i = p? (N − 1). Calculate hk̄ 2 (A)i.
Calculate the variance σk̄2 = hk̄ 2 (A)i − hk̄(A)i2 in the finite connectivity regime, and
express it in terms of hki for N → ∞. What can you conclude from the result?
P P
(xxxvi) Show for the following degree distribution that k≥0 p(k) = 1 and k≥0 p(k)k = q,
without using its generating function:
q k
p(k) = ( ) /(1+q) (165)
1+q
(xxxvii) Calculate the generating function G(x) for the following degree distribution, with
α ∈ [0, 1] and q1 , q2 ∈ IN:
p(k) = αδk,q1 + (1−α)e−q2 q2k /k!
(xxxviii) Confirm that the three generating functions for regular, Poissonnian, and exponential
d
random graphs all obey: G(0) = p(0), G(1) = 1, and limx→1 x dx G(x) = hki. Calculate
2
expressions for hk i from the three generating functions.
(xxxix) Prove that hk 2 i ≥ hki for all graphs, with equality if and only if p(k) = 0 for all k > 1.
(xl) Construct a large 2-regular graph, i.e. one with p(k) = δk,2 and large N , that does not
have a giant component. Prove your claim.
(xli) Show that the distribution p(A) which maximises the Shannon entropy for the
set of simple nondirected graphs, subject to the soft average degree constraint
A∈G p(A)k̄(A) = hki and subject to normalisation, is the Erdös-Rényi ensemble.
P
(xlii) Show that the probabilities in the ensemble of simple nondirected graphs with soft-
constrained degree sequences can, for large N and finite degrees {ki }, be written as
Y h ki kj 1 ki kj 1 i
p(A|k) = + O( 2 ) δAij ,1 + 1 − + O( 2 ) δAij ,0
i<j N hki N N hki N
Section 7