You are on page 1of 30

Lecture 6

Summary
Lecture 6 introduces the topic of the second half of term: Networks. Network are very
ubiquitous in the social and the natural world around us. Many aspects of the economy can only
be understood in terms of the network of entangled economic and social relations between the
economic agents. The emergence of social media in the early years of the 21st century have
made “networks” and many of their properties a matter of day-to-day experience. But also in the
natural world ecological network of, for example, predator and prey relationships between
species play a crucial role in understanding both the vulnerability as well as the stability of eco-
systems.
This chapter of the lecture notes introduces the way some of the key mathematical tools we
acquired in previous chapters can be used to allow a detailed treatment of networks and their
characteristics.

1 Networks basics
Aims: The aim of this chapter is to introduce some basic notions, concepts and terminology concerning networks and their building
blocks.

1.1 Nodes, links and functions on networks


Essential

Aims: The aim of this section is to connect the discussion of networks to the discussion of matrices and their properties that we
have had in the previous weeks.

A graph, or network, G is a set of nodes (or ‘vertices’) i ∈ nodes & links (or ‘edges’) i → j ∈ ℰlinks ,
G = {nodes , ℰlinks } = {1, ... , i, ...., n} ⊕ {{i, j}, ... } . (1)

The words “graph” and “network” will be used pretty much interchangeably here. As an example of such a network you could think of
modules in an Economics curriculum
ECON1006 ECON1010

ECON1003 ECON1001

ECON1002 ECON2004 ECON1005 ECON`1009

ECON2007 ECON2001

and the links between those modules in terms of how one module might prepare you for, or influence the way in which you enjoy,
taking a subsequent or parallel module. When we talk about networks in the real world we should always have in mind a clear defini-
tion as to what makes a node a node and what the nature of the links between them is.
2 ECON0114-Week-6-Lecture.nb

Question: Look up the London Tube map. What makes the nodes on that network nodes and what is the nature of the links between
them?

When we want to analyse networks using mathematical tools then we need a way of translating these basic building blocks, nodes and
links, into mathematical objects. In this course I will identify nodes with standard basis vectors, so
node i → e i . (2)

Similarly a link i → j can be identified with a particular matrix


i → j → e i ⊗ e j . (3)

As a graph
j i

A link between a node and itself, i → i, is usually called a ‘loop’.


Simple networks
A network is called a simple network when the following is true
 it contains no self-loops;
 it contains no duplicate links;
and most of the networks we will consider are actually simple networks.
Links: going somewhere
An alternative notation for a link I will sometimes use is
L[i, j] = e i ⊗ e j . (4)

The nice thing about this identification is that the ‘link’ between two nodes becomes something that takes you from one node to the
other because
e i . L[i, j] = e j , (5)

as a result of the basic properties of the tensor-product.


Directed networks
A network is called directed network if there exists one or more links i → j ∈ ℰlinks for which j → i ∉ ℰlinks . An network which is not
directed is usually called a symmetric network.
Complete networks
If every possible link between the set of nodes nodes was part of the network, then we would have ℰlinks = nodes × nodes . Such a
network is often called a complete network and the complete network with n nodes is usually denotes as K n . The simplest one is K2

2 1

Very often in such drawings the self-loops i → i are either left out, or even complete removed from the definition. We will typically
remove all self-loops from the definition.

Question: Draw K3 and K4 and show that each node in Kn has (n - 1) ingoing and outgoing links.

Degree of a node
The in-degree of a node is simply the number of links entering the node, whereas the out-degree is the number of links leaving it.
Sub graphs

A sub-graph G1 of a graph G is a pair {1 , ℒ1 } such that ℰ1 ⊆ ℰlinks and ℰ1 ⊆ ℰlinks ⊆ 1 ⊗ 1 . Below you see a network with 4 nodes
on the left and a sub-graph on the right.
ECON0114-Week-6-Lecture.nb 3

4 2

1 3

2 1 3 4

It also means that if  is the vector-space spanned by all the standard basis-vectors e i then any sub-graph, of a given graph G with n
nodes, is automatically a linear subspace of .

Question: Is K3 a sub-graph of K4 ? How many Kn-1 sub-graphs are there in Kn ?

Drawing Networks & Graphs with Mathematica

Essential

Mathematica allows you to visualize networks very easily using the Graph[] command. For example the graph that you saw earlier was
made as follows

G = Graph[{1  2, 2  3, 4  3, 4  1, 4  2, 2  4}]
4

1 3

If you want to use node-names that are actual words then you will want to write them as "Jill" → "Judy" for example, i.e. as so-called
“strings”. Mathematica also allows you to directly call a number of basic graphs such as the star-graphs S n

StarGraph8, DirectedEdges → True, Frame → True, PlotLabel → "S 8 "

S8
7

8 6

2 5

3 4

or the cycle-graphs Cn

CycleGraph10, DirectedEdges → True, EdgeStyle → ArrowheadsMedium, PlotLabel → C 10 


4 ECON0114-Week-6-Lecture.nb

C10
10
1 9

2 8

3 7

4 6
5

or the complete graphs Kn

CompleteGraph[8, Frame → True, PlotLabel → K8 ]

K8
8

1 7

2 6

3 5

or with explicitly directed links

CompleteGraph8, DirectedEdges → True, EdgeStyle → ArrowheadsMedium, Frame → True,


PlotLabel → K8 
ECON0114-Week-6-Lecture.nb 5

K8
8

1 7

2 6

3 5

You can also ask Mathematica to tell you what the list of nodes is for a certain graph G, or the list of links, using the commands
VertexList[...] or EdgeList[...].

G = CompleteGraph[5];
VertexList[G]
EdgeList[G]

Question: Find the vertex- and link-lists of the C10 graph.

Practice problems link: The section above is useful for Practice problem 1.

Functions on a network

Essential

In many applications the nodes represent object of economic interest to which we want to assign values of some kind. So suppose we
assign to each node j a value F j then these can be put together to form the list of function-values
F = {F1 , ... , Fn } . (6)

So vectors in this context can be though of as function on the network, defined by values they assign to individual nodes. Note that if
we want to ‘copy-and-paste’ the function value at node k to node m then we can do so as follows
F → F . ( + e k ⊗ e m ) (copy and paste). (7)

We could also cut-and-paste of course by removing any value ad node k as well


F → F . ( + e k ⊗ e m - e k ⊗ e k ) (copy and paste). (8)

Question: Look up the representation of the identity-matrix  in terms of the basis-vectors e i and explain why the cut-and-paste
operation indeed cuts the value at node k to 0.

1.2 Adjacency and Incidence matrices


Aims: The aim of this section is to identify a few important matrices that are key to analyzing the properties of networks in general.

As discussed above we identify the nodes with standard basis vectors and the links with particular tensor-products. We use these
building blocks to define a few very important matrices
6 ECON0114-Week-6-Lecture.nb

The adjacency matrix

Essential

Consider some network G with a set of nodes G and a set of links ℰG , the adjacency matrix A is then defined as
 
A=  L[i, j] =  ei ⊗ e j . (9)
{i→ j} ∈ ℰG {i→ j} ∈ ℰG

The matrix elements of the adjacency matrix have a simple interpretation


1 if {i → j} ∈ ℰG
Aij =  . (10)
0 otherwise

A useful property of the adjacency matrix is that it gives us an easy way to calculate the degree of a node.
Degree of a node

Recall from section 1.1. that the in-degree of a node j is the total number of incoming links. In the adjacency matrix these incoming
links into node j are the 1’s in the j-th column. So we can calculate the in-degree din [ j] as

din [ j] = Aij =  . A .
(11)
i

Similarly, the out-degree can be calculated by summing the j-th row



dout [ j] = Ajk = A .  .
(12)
k

We can derive two alternative formulae for these degrees that are useful in some situations. Note that for the in-degree we can also write
din [ j] = Aij = Aij Aij = AT ji Aij = AT . Ajj .
(13)
i i i

The diagonal matrix elements of the matrix AT . A are the in-degrees of the nodes! Similarly we can derive that
dout [ j] = A . AT jj . (14)

As a result we have that

din [ j] = TrAT . A and dout [ j] = TrA . AT  . (15)


j j

These will be quite useful later on.


Adjacency matrices in Mathematica

When you present Mathematica with a graph G the command AdjacencyMatrix[...] can be used to obtain the adjacency matrix of the
graph. For the G = K5 we had above

A = AdjacencyMatrix[CompleteGraph[5]];
MatrixForm[A]

Question: Find the adjacency matrix of the S10 graph.

We can also go the other way around and just make a graph out of an adjacency matrix. For example
0 1 0 1 1
1 1 1 1 1
GraphPlot 0 0 1 1 0 , VertexLabeling → True, DirectedEdges → True,
1 0 0 0 1
1 0 1 1 1
MultiedgeStyle → All, Method -> "CircularEmbedding"
ECON0114-Week-6-Lecture.nb 7

Note that using the tensor-product notation it becomes very easy to make new graphs from old ones by simply adding or removing the
required links. If we change a network with adjacency matrix A into a network with adjacency matrix A ' by adding a link between i → j
and subtracting the link between k → m we would write
A ' = A + e i ⊗ e j - e k ⊗ e m . (16)

For example, if we remove the link from 3 → 4 in the previous network, and add one between 3 → 1
0 1 0 1 1
1 1 1 1 1
GraphPlot 0 0 1 1 0 - TensorProduct[{0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}] +
1 0 0 0 1
1 0 1 1 1
TensorProduct[{0, 0, 1, 0, 0}, {1, 0, 0, 0, 0}], VertexLabeling → True,
DirectedEdges → True, MultiedgeStyle → All, Method -> "CircularEmbedding"

We will make important use of the adjacency matrix later.

Practice problems link: The section above is useful for Practice problem 2.

Adjacency matrices and functions on networks


In the previous section I discussed how functions on network (nodes) are really just vectors F and how the links and the identity matrix
can be used for cut-and-paste and copy-and-paste operations on these functions. If we assume that we have a simple network, then
copying and pasting function-values along all the network links would work like this
F → F . ( + A) (copy and paste). (17)

Similarly cutting and pasting would yield


F → F. A (cut and paste). (18)
8 ECON0114-Week-6-Lecture.nb

That the vector F appears on the left of the adjacency matrix is due to our convention on the direction of the links.

Question: Why is it crucial that you use the word simple in the technical meaning introduced in section 1?

Practice problems link: The section above is useful for Practice problem 3 and problem 7.

Transpose of the Adjacency matrix


Now what happens when we take the transpose of the adjacency matrix? Let us first look at a basic link and take the transpose
(e i ⊗ e j )T = e j ⊗ e i , (19)

i.e. an ordinary link remains a link between the same nodes but its orientation gets reversed! So the matrix A T is an adjacency matrix
with the direction of all links reversed when compared to A. As a result we can now simply write that for a directed network A T ≠ A, i.e.
that a symmetric network has a symmetric adjacency matrix.

Question: Suppose we want to cut-and-paste the function values of a function F in a backwards direction, i.e. against the direction
of a simple network links, explain why this means F → A . F.

The weighted adjacency matrix


The adjacency matrix suggests that all the links are identical however in many applications there are reasons why different links could
carry different weights. To accommodate that in those circumstances we define a weighted adjacency matrix
 
W=  wij L[i, j] =  wij ei ⊗ e j . (20)
{i→ j} ∈ G {i→ j} ∈ G

If all links have the same weight w then we simply have


W =wA . (21)

In many cases in this course we will be interested in generating the adjacency matrices through some randomised procedure to then use
the tools of Mathematica to study the resulting networks. So GraphPlot[...] is a command we will use a lot.

Question: Suppose we want to cut-and-paste the function values of a function F in a backwards direction, i.e. against the direction
of a simple network links, explain why this means F → A . F.

Practice problems link: This observation is useful for Practice problem 7.

Comment:
Note how when using Mathematica we have to specify the explicit form of the vectors e i and as a result we need to know how many
nodes there are in our network. Adding or subtracting entire nodes would require us to modify the lists representing the e . i

However in our symbolic calculations then as long as we are adhering to the e i being the standard orthonormal basis vectors, we can
easily add nodes by just adding the corresponding tensor-product for the links involved.

The incidence matrix

read through and look-up when necessary

There is a second matrix which is often useful in analysing the structure of networks. It is called the oriented incidence matrix, or just
incidence matrix, and it is easiest to define using its matrix elements.

Consider a graph G with n nodes and V vertices, then the matrix B with n rows and V columns is defined by the matrix elements B Jj
where J = 1, ..., V and j = 1, ... , n which take the values
1 link J is coming into node j,
BJj = -1 link J is going out of node j, (22)
0 otherwise .

Perhaps it is easiest to view this matrix as a table, like the one below for a network in which nodes i and j are connected by links both
i → j as well as j → i :
ECON0114-Week-6-Lecture.nb 9

Nodes\Links 1 ⋯ i→j ⋯ j→i ⋯ V


1 … … … … … … …
⋮ … … … … … … …
i 0 0 -1 0 1 0 0
.
⋮ … … … … … … …
j 0 0 1 0 -1 0 0
⋮ … … … … … … …
n … … … … … … …

Question: Consider the matrix C = B . BT with matrix elements CJK = ∑ni=1 BJi BT iK interpret the values that the matrix elements of
C can have in terms of the directions of the links and the nodes they end in. How about the matrix L = B T . B with matrix elements
Ljk = ∑VK=1 BT jK BKk ?

Example
As an example consider the following Cycle-graph
5

1 4

2 3

The Incidence matrix can be read of easily. Let us call the link going into node 1, link 1, the link going out of node 1, link 2, etc. The B
takes the form
-1 0 0 0 1
1 -1 0 0 0
B = 0 1 -1 0 0 . (23)
0 0 1 -1 0
0 0 0 1 -1

Note that in every column there is on 1 and one -1 because every link has a starting point and an end-point. But this need not be the
case in every row because a node and be a starting point or end-point only. Written in terms of a table it looks like this
12 23 34 45 51
1 -1 0 0 0 1
2 1 -1 0 0 0
3 0 1 -1 0 0
4 0 0 1 -1 0
5 0 0 0 1 -1

We will not be using the incidence matrix a lot. But in many network theory problems it might come in handy.
Calculating the incidence matrix with Mathematica

read through and look-up when necessary

Mathematica is happy to compute the incidence matrix for you. But be aware that in that case Mathematica will also label the links for
you. So whenever you ask Mathematica to calculate an incidence matrix, take some time to study the result and compare it the graph
you see.

G = CycleGraph5, DirectedEdges → True


B = IncidenceMatrix[G];
MatrixForm[B]

TableFormNormal[B], TableHeadings → VertexList[G], EdgeList[G]


10 ECON0114-Week-6-Lecture.nb

The ‘network-derivative’
One application of the incidence matrix is quite interesting to mention here. If we multiply a function F on the network by the incidence
matrix from the right we find a new function dF on the links, i.e.
F. B = dF . (24)

This new function contains as components the difference of the function F along a link, i.e.
(dF) i→ j = F j - Fi . (25)

This is sometimes referred to s taking a ‘network-derivative’ of the function. For example for the cycle graph C 5 above, and some
arbitrary function F defined on it, we would have

F = f1, f2, f3, f4, f5;


MatrixForm[F.B]
-f1 + f2
-f2 + f3
-f3 + f4
-f4 + f5
f1 - f5

Of course it is entertaining ask ourselves whether an equation like


F. B = G where G is given, (26)

has a solution F, i.e. if we are given a network-derivative can we find the function that it is a network-derivative of?

In the case of the Cycle-graph Cn both F and G have n components and so a unique solution would exist if, and only if, Det[B] ≠ 0 ...

which unfortunately it isn't because any function f = { f , f , f , f , ...} = f  satisfies f . B = 0 ... but then this could be expected because
that is even true for the ordinary derivative ∂x that any constant function f [x] = f satisfies ∂x f [x] = 0. So uniqueness is not so much the
issue. I won’t delve any further into this issue here as it is not related to anything we want to be doing in the next few weeks. But it is
amusing to contemplate the analogies and differences between the derivates you are used to from calculus and the network-derivative
presented here.

Practice problems link: The section above is useful for Practice problem 3.

Undirected networks and ‘directed but symmetric’ networks


It is interesting to repeat the calculation for the cycle graph where we do not specify “DirectedEdges → True”, in this case Mathematica
will assume the links are symmetric, i.e. go both ways. In that case the Incidence matrix looks different

G = CycleGraph[5];
G2 = {1  2, 2  3, 3  4, 4  5, 5  1, 1  5, 5  4, 4  3, 3  2, 2  1};
GraphicsGrid[{{Graph[G], Graph[G2]}}]

This is how Mathematica draws the two graphs, in G (left) I used the CycleGraph[] command but without specifying the links to be
‘directed’ whilst on the right I defined G2 by hand to include links going both ways explicitly.

5 1
2

1 4

3 5

2 3 4
ECON0114-Week-6-Lecture.nb 11

If we now ask Mathematica for the Incidence matrix, then in the case of G Mathematica will treat the symmetric links as just 5 links
and it applies a slightly different rule from the one in Eq.(17)

B = IncidenceMatrix[G];
MatrixForm[B]
1 1 0 0 0
1 0 1 0 0
0 0 1 1 0
0 0 0 1 1
0 1 0 0 1

This is the so-called unoriented incidence matrix. In this case B loses its interpretation as a network derivative as F. B is no longer
calculating function differences along links. If we calculate the incidence matrix of G2 we find

B2 = IncidenceMatrix[G2];
MatrixForm[B2]
-1 0 0 0 1 -1 0 0 0 1
1 -1 0 0 0 0 0 0 1 -1
0 1 -1 0 0 0 0 1 -1 0
0 0 1 -1 0 0 1 -1 0 0
0 0 0 1 -1 1 -1 0 0 0

This is the oriented incidence matrix that treats the links different depending on their orientation.

F = {F1, F2, F3, F4, F5};


MatrixForm[F.B2]
-F1 + F2
-F2 + F3
-F3 + F4
-F4 + F5
F1 - F5
-F1 + F5
F4 - F5
F3 - F4
F2 - F3
F1 - F2

So here we can still interpret dF = F. B as a network derivative, but note that the components of dF are not all independent. Evidently
they cannot be because there are twice as many links as nodes. So there will be lots of functions A on links that cannot be thought of as
network-derivatives of functions on the nodes.

Note however that the adjacency matrices of both G and G2 are the same!

A = AdjacencyMatrix[G];
A2 = AdjacencyMatrix[G2];
A == A2

True

2 Networks basics
Aims: The aim of this chapter is to use the adjacency matrix to analyse the structure of basic components of a network such as
paths, loops and small structures inside of a network.

Many of the major properties of a network can be evaluated from knowing the adjacency matrix of the network. This section focusses
on introducing those ideas.

2.1 n-step paths, neighborhoods & Connectedness


Aims: The aim of this section is to understand how we can analyse the paths available in a network by using the adjacency matrix.
12 ECON0114-Week-6-Lecture.nb

The adjacency matrix A of a network essentially gives us complete information about the 1-step connections. But much of the use of
network theory is the analysis of the wider connections in networks. Consider for example the famous question:”How many acquain-
tance-relationships are there connecting two arbitrary people in the world?” In the real world the answer to this question is, depending a
little on the type of network we are looking at, often surprisingly small and of the order of 5 to 10. This “small world phenomenon” has
been studied by sociologists as well as by network theorists and we will return to it at some point as well. Fortunately the adjacency
matrix A allows us to study many such questions.
‘Motifs’ or chunks of network

Essential

Consider the following three pieces of network that you might encounter as parts of a much larger network.
i k

j i i j k

Such pieces are often called ‘motifs’. We can associate to them the following three expressions of matrix elements of the adjacency
matrix
Aij and Aij Ajk and Aij Akj . (27)

If in the network described by the adjacency matrix A these three connections exist then the products of these matrix elements all
generate the value 1. If one does not exist because any of the links I drew doesn’t actually exist in the network the corresponding
expression will be 0 because one of the matrix elements will be zero.
The middle of the three network ‘motifs’ I will call a 2-step path: “2-step” because is consists of two links and a “path” because the
orientation of the links lines u in such a way that you could follow their direction from i → k. The third ‘motif’ is not a path because you
can’t walk along the links. Evidently each of these three motifs would be structures that are very common in networks.

We have already seen that if we sum Aij over either i or j then this generates the out- or in-degrees of the nodes of the network. But
what happens when we sum over one of the indices in the more complicated motifs? Let’s consider A ij Ajk first and in particular look at
summing over j. If we do that then this becomes the ordinary matrix product

 Aij Ajk = (A.A)ik . (28)


j

When we sum over the j’s then of course at some point it will have the same value as k, so our sum not only contains motifs like the
one on the left below, but also the one on the right.

k i
i j k

If we work with simple networks then Akk = 0 for any value of k, i.e. there are no self-loops. So for a simple network with adjacency
matrix A the matrix-element A2 ij contains the number of all paths from i → j with one intermediate node different from j

Question: Consider the third motif in the figure, related to the expression Aij Akj . Show that if we sum this over j we are actually
computing A.AT ik .
ECON0114-Week-6-Lecture.nb 13

Two-step paths

Essential

So when we compute A2 we get


1 if there are links i → k and k → j
A2 ij = Aik Akj =  
0 otherwise
k k (29)
= the number of two - step links i → j.

Consider the following network of 50 nodes that was generated randomly with a 0.25 probability for each link i → j of existing in the
network. Out of the 2500 possible links, in this example only 662 turn out to exist.

But the number of two step-connections is far greater: 2452. Yet not every node-pair {i, j} has the same number of two-step connec-
tions. Due to the random nature of the network there will be a spread which, for the network depicted above, is presented in the
following histogram

500
Number of node-pairs

400

300

200

100

0
0 2 4 6 8
Number of 2-step connections

As you see there are only about 50 node-pairs that are not connected by a two step path.

Question: Given that the probability of a connection i → j is 0.25 in the network above, explain why it is to be expected that the
mean number of two-step connections between nodes is a little over 3.

We could also wonder how symmetric the network is, i.e. what the asymmetry is in two-step connections i → j and j → i. The following
14 ECON0114-Week-6-Lecture.nb

histogram reveals that for the network above.

500

Number of node-pairs
400

300

200

100

0
-5 0 5
Number of 2-step asymmetry

Question: Explain why it is to be expected that the mean asymmetry in of two-step connections is close to 0.

If we want to study the number of n-step connections we simply compute


(An )ij = the number of n - step links i → j. (30)

So the integer-powers of the adjacency matrix can tell us a lot about how well or how poorly the nodes in the network are connected.
Note that if we calculate
n
 Am = the number of links i → j with n or fewer steps, (31)
m=1 ij

then by simply counting the number of 0’s in this sum of powers of A we can establish how many node-pairs do not have a connection
with n or fewer steps. For the network above if we perform this calculation we can plot the following graph
Number of disconnected node-pairs

80

60

40

20

0
0 1 2 3 4 5 6
Number of steps

After three steps all node-pairs in that network are connected, i.e. have one or more connections in either direction! This is an important
piece of information about the network we generated: it is strongly connected.
Networks in Mathematica

Essential

Practice problems link: The commands below generated the results presented in the example above and these commands will be
useful in the practice problems.

The commands setting up the matrix and calculating the powers of the adjacency matrix

A1 = TableRandomChoice[{1, 0, 0, 0}, 50], j, 1, 50;


GraphPlotA1, DirectedEdges → True
An[n_] := MatrixPower[A1, n];

The following commands calculate how many matrix-elements of A and A2 are non-zero, i.e. by removing the zero’s from the list,
ECON0114-Week-6-Lecture.nb 15

Length[DeleteCases[Flatten[An[1]], 0]]
Length[DeleteCases[Flatten[An[2]], 0]]

Question: Check the above command and verify that the histograms include n-step paths between node-pairs j → j!

This command computes a histogram of the 2-step connections showing us how many node-pairs have how many two-step connections.

HistogramFlatten[An[2]], 25, Frame → True,


FrameLabel → "Number of 2-step connections", "Number of node-pairs"

This command computes a histogram of the asymmetry of the 2-step connections.

HistogramFlatten[An[2] - Transpose[An[2]]], 25, Frame → True,


FrameLabel → "Number of 2-step asymmetry", "Number of node-pairs",
PlotRange → Full

This command computes for every 0 < n ⩽ 6 the number of node-pairs that are not connected, while treating i → j as distinct from j → i
and including i → i.

B1 = A1;
C1 = A1;
DisconnectCount = {{1, Count[Flatten[C1], 0]}};
t = 1;
Dot = t + 1, B1 = B1.A1, C1 = C1 + B1,
DisconnectCount = AppendDisconnectCount, {t, Count[Flatten[C1], 0]}, 5
ListPlotDisconnectCount, Frame → True,
FrameLabel → "Number of steps", "Number of disconnected node-pairs"

Connected graphs

Essential

Let us think a little more about connectedness if networks. The following two triangles are clearly disconnected.
4 6

1 2

Not only is there no path connecting them, but even although in the following network all the nodes are somehow connected, it is still is
not possible to take a direct path from node 5 to node 2 for example. We say that such a network is disconnected into separate
components.
Consider the network below, it is evidently not disconnected into separate components. But if you look closely you will see that there is
no path connecting, for example, node 5 to node 1.
16 ECON0114-Week-6-Lecture.nb

2 5

3 4

1 6

So even although it is connected it is not strongly connected. It is possible in the network above to leave one part of the network
without having a path to return. Strongly connected network have at least one path connecting every node-pair i → j in both directions.
Testing for connectedness
So how could we test for whether or not the network is connected or strongly connected? Well you might say, just calculate

C[A] =  Am , (32)
m=1

and count the number of 0’s in C[A]. There is one problem here however: how do we know this infinite sum even exists at all? It could
be that at ever additional step the number of paths between some nodes i → j increases so dramatically that the overall sum simply
explodes! But there is a way to fix this!
Consider the following sum

C[b, A] =  ⅇ-b m Am . (33)
m=1

If we choose b large enough then we may have good hope that the exploding number of paths with increasing m will be sufficiently
suppressed by the ever smaller factor of ⅇ-b m . If however a matrix-element of Am is zero, then it is still zero in ⅇ-b m Am . So the number
of node-pairs with a 0 matrix-element in C[A] should be the same as in C[b, A]!
But some might now argue that this is still a bad idea because it requires us to do an infinite number of matrix-multiplications which
doesn’t seem entirely practical? Here to there is a solution. With the methods of lecture 1, as I will show in the next week, the sum can
actually be computed analytically. We find

-1
C[b, A] =  ⅇ-b m Am =  - ⅇ-b A -  for sufficiently small b. (34)
m=1

So if we can find an inverse to the matrix  - ⅇ-b A and count the off-diagonal 0’s then this tells us, for each direction, how many
pairs i → j have no connection. We can use this matrix to compute a few interesting vectors.
Neighborhoods

read through and look up when necessary

Consider the node k represented by e k , if we calculate the vector N k→ given by


N k→ = e k .C[b, A] , (35)

then this vector has non-zero, positive entries only for those j where node j can be reached via at least one path from k. Similarly we
can define
N →k = C[b, A] . e k , (36)

We can use these vectors as indicators which nodes belong to the network neighborhood of node k as follows:
(N →k ) j > 0 then node j is in the neighborhood of influence on k ,
(N k→ ) j > 0 then node j is in the neighborhood of influence of k , (37)
N k→ + N →k  > 0 then node j is in the path - connected neighborhood of k .
j

So the matrix C[b, A] if very useful in exploring the connected parts of the network.
ECON0114-Week-6-Lecture.nb 17

Question: Why can we view the function ⅇ-b m as a ‘step-discounting’ factor?

Connectivity
We can now distinguish the following important cases
Strongly connected network : both C[b, A]ij ≠ 0 and C[b, A]ji ≠ 0 for all i ≠ j ,
(38)
Connected network : either C[b, A]ij ≠ 0 or C[b, A]ji ≠ 0 for all i ≠ j ,

Now it is tempting to thing that the final case would be that when both matrix-elements C[b, A] ij = C[b, A]ji = 0 that this means the
network is disconnected into separate components, but is that actually true?
Let us assume that for a specific pair of nodes {i, j} we have C[b, A]ij = 0 and C[b, A]ji = 0. Now consider the lists

Ni = (C[b, A]ik + C[b, A]jk ) .


(39)
k

By definition the j-th component of that list Ni . e j = 0 just like N j . e j = 0 because these nodes have no connection either way. The
vectors Ni has 0’s for all components k that are nodes that either you can not reach on a path from i or that nodes k from which you
cannot reach i by any path. We might call these nodes k where Ni has a positive entry the connected neighborhood of i in the network.
If we have
Disconnected neighborhood : If for some i ≠ j both C[b, A]ij = 0 and C[b, A]ji = 0 and Ni . N j = 0 , (40)

then their network-neighborhoods are disconnected. To see this remember that all the entries of these neighborhood vectors are either 0
or positive!
If we allow all links to be traversed both ways, i.e. A → AS = A + AT   2 as a new adjacency matrix on the same set of nodes, and we
find
Disconnected network : If for some i ≠ j both C[b, AS ]ij = 0 and C[b, AS ]ji = 0 , (41)

then this indeed implies these nodes lie in disconnected parts of the network A. Let us look at an example with Mathematica.

Practice problems link: The commands below generated the results presented in the example above and these commands will be
useful in the practice problems.

Example

read through and look up when necessary

Let us do an example. First we specify a random network of the kind we saw before, just smaller

A1 = TableRandomChoice[{1, 0, 0, 0}, 15], j, 1, 15;


GraphPlotA1, DirectedEdges → True, VertexLabeling → True

10
11
15

9 8 7 12

13
4 1

5 2 6

14
18 ECON0114-Week-6-Lecture.nb

Then we define the function that computes the relevant matrix C[b, A] for am adjacency matrix of a network with n nodes.

Cb[b_, A_, n_] := NInverseIdentityMatrix[n] - ⅇ-b A - IdentityMatrix[n], 10

Question: How, using Mathematica commands, could you remove the argument n here by using the fact that the matrix A is an n ⨯ n
matrix?

Because I wrote the command such that it computes only to an accuracy of 10-10 , I will consider ever matrix element smaller than that
to be 0. So

C1 = Cb[2, A1, 15];


CountFlatten[C1], u_ /; u < 10-10 

29

Note that the calculation of the inverse takes quite a bit of time, even though our network isn’t that big. For large networks we may
want to explore faster alternatives. We see there are number of node-pairs that have no links. Let us find out which pairs these are

Position[C1, 0]

{{1, 11}, {2, 11}, {3, 11}, {4, 11}, {5, 11}, {6, 11}, {7, 11},
{8, 11}, {9, 11}, {10, 11}, {11, 11}, {12, 11}, {13, 11}, {14, 1},
{14, 2}, {14, 3}, {14, 4}, {14, 5}, {14, 6}, {14, 7}, {14, 8}, {14, 9},
{14, 10}, {14, 11}, {14, 12}, {14, 13}, {14, 14}, {14, 15}, {15, 11}}

Now we can use the Mathematica command Map[ ...] to apply a function to these ‘position’ pairs to turn them into descriptions of links
that Mathematica understands,

f[x_] := {x[[1]]  x[[2]]}


MissingLinks = Mapf, Position[C1, 0]

{{1  11}, {2  11}, {3  11}, {4  11}, {5  11}, {6  11}, {7  11},


{8  11}, {9  11}, {10  11}, {11  11}, {12  11}, {13  11}, {14  1},
{14  2}, {14  3}, {14  4}, {14  5}, {14  6}, {14  7}, {14  8}, {14  9},
{14  10}, {14  11}, {14  12}, {14  13}, {14  14}, {14  15}, {15  11}}

Question: Try using this map with the ‘standard’ arrow → instead of the ‘link arrow’  and show that then the command below
doesn’t work.

and then to see where these links would be in a complete graph of 15 nodes

HighlightGraphCompleteGraph15, DirectedEdges → True, MissingLinks


ECON0114-Week-6-Lecture.nb 19

15
1 14

2 13

3 12

4 11

5 10

6 9

7 8

It is the coloured links that are missing from C[b, A] of the network. If we normalise all the matrix elements of C[b, A] to 0 or 1
depending on whether they are 0 or positive

g[x_] := If[x ⩽ 0, 0, 1]
NC1 = Map[g, C1, {2}];
MatrixForm[NC1]
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1 0 1 1 1 1

We now clearly see that node 11 has no incoming links (the whole 11th column has 0’s only) and node 14 had no outgoing links (the
whole 14th row has only 0’s).

Question: If we would have done the computations up to an accuracy of 10-K then how could we reflect that in the function g[x]?

If we compute the list representing the vector e n in a network with M nodes

Ev[n_, M_] := TableIfj ⩵ n, 1, 0, j, 1, M

we can use it to calculate a vector that contains 1’s for every node that such a node is connected to, i.e. for node 11. If we compute the
neighborhoods of influence of node 11 and on node 11 we get

Ev[11, 15].NC1
NC1.Ev[11, 15]

{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1}

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

The following command draws the graph of the network with adjacency matrix A1 and colours the nodes that are in the neighborhoods
of influence of node 11

HighlightGraphAdjacencyGraph[A1], Position[Ev[11, 15].NC1, 1]


20 ECON0114-Week-6-Lecture.nb

10
11
15

9 12
8 7

13
4
1

5 2 6

14

Question: Verify that although this network is shown in a different format than the one generated by GraphPlot[...] earlier, the
positions of the vertices have remained the same.

Evidently all other nodes are in its neighborhood of influence, none are influencing it. For node 14 the situation is exactly the other way
around. This is clear from

Ev[14, 15].NC1
NC1.Ev[14, 15]

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}

Now let us turn from these questions of connectivity to a brief discussion of closed paths and ‘loops’.

2.2 Closed paths and loops


Essential

Aims: The aim of this section is to see how loops and closed paths can be studied using the adjacency matrix.

So we have seen that the number of n-step connections i → j is given by the matrix element (A n )ij . So of particular interest are the n-step
connections that return to the node of their origin, i.e. the (An )ii , these are paths that close in on themselves. We will study for of them.
Self-loops
If we only consider the first power of the adjacency matrix A then we are talking about 1-step links of a node to itself. If we adhere to
simple networks then by definition Aii = 0 for all nodes i. In other networks, especially ones that we generate randomly, we might have
self-loops if we don’t explicitly removes them. There may also be contexts where self-loops actually make sense. One such example
will be discussed in class.

The total number of self-loops in a network is simply the sum of all diagonal elements of the adjacency matrix, i.e.
NSelf-Loop = Tr[A] . (42)
ECON0114-Week-6-Lecture.nb 21

Two-step closed paths


If we consider the diagonal elements of A2 , the square of the adjacency matrix A, then A2 jj represents the number of two-step

connections from node j to node j.

j i

The number of two step-connections j → j is equal to the number of neighbors k of j for which there is a link to the neighbour and a
link back.

Suppose k is such a neighbour, then the 2-step closed path from j → k → j is of course the same as the path k → j → k. So such a two-
step closed path is counted twice when we simply add all the diagonal elements of A2 . So if we want to compute the total number of
distinct 2-step closed paths in the network we need to calculate
1
N2-step Loops = TrA2  . (43)
2

Closed paths of two steps are still fairly simple.

Question: Compare this formula for counting the two-step loops to the in- and out-degree formulae involving the traces over A T .A
and A.AT .

When we add more steps the number of different types of paths grows. Because of that we will only consider two types of more
complicated paths, 3-step and 4-step paths.

Practice problems link: The section above is useful for Practice problem 4.

2.3 Triangles and Squares


Aims: The aim of this section is to explore two types of small structures that can appear in networks and whose frequency of
appearance tells us something about the structure of the network and how it came about.

Triangles

Essential

Now when we consider 3-step paths, we can make 3-step path using 1, 2 or 3 nodes. Here are some examples

i j i

i j

If we have a simple network then the first two will not occur as they require self-loops to exist. So let us assume that we are only
dealing with simple network. Then all that remains are the triangle type paths. However of these triangle type path we can still come-up
with quite a few different ones.
The following four diagrams are all ‘triangles’ however only the upper-two are closed-paths
22 ECON0114-Week-6-Lecture.nb

k j

i j i k

i i

j k

k j

The lower two have one link that has the ‘wrong’ orientation, i.e. the orientations do not allow us to walk along the links and return to
the same node. As a result the lower two ‘motifs’ that might occur in a large network will not be included as diagonal elements of the
matrix A3 .
So the diagonal elements of the matrix A3 contain actual triangles that can be traversed either in one orientation or the other. If we
calculate the trace of the matrix A3 we would be counting each of these two orientations of triangles three times, once for every node on
the triangle. So one way of counting the triangles in a network is
1
NTriangles = TrA3  . (44)
3

This counts the two different orientations as distinct triangles. For a symmetric network that would mean double-counting them. But for
a directed network one orientation might be present while the other is not present to the same degree.

Question: Consider the 3-step ‘motifs’ in the lower half of the figure. What is the connection between those two pictures and the
following expressions: (a) A2 ik Aik = A2 ik AT ki and (b) TrA2 . AT ?

Practice problems link: The section above is useful for Practice problem 5.

When is this relevant?


Understanding how many triangles there are in a certain network becomes relevant, for example, in social networks. The friends-
network on Facebook is a symmetric network as accepting a friend-request creates a two-way connection. So an interesting question to
ask would be: how many pairs of friends share a common friend? If that would be very common then the number of triangles per node
would be high, if it is very rare then the number of triangles per node would be low. It would tells us something about the finer
structure of the network. Information like this can also gives us clues as to how the network evolves: perhaps agents become friends by
introduction to each other by a common friend!
Squares

Essential

Now let us turn to the final category of small networks that we will discus with an eye towards understanding how frequent they might
be in larger networks as measures of how connected the nodes are: the four-step closed paths. Here are some examples of 4-step closed
paths with fewer than 4 nodes.
ECON0114-Week-6-Lecture.nb 23

i j i j i

k k

k i j

j i i j

All the ‘motifs’ in the upper part of the diagram require the existence of self-loops, so if our network is simple then these closed paths
will not be part of A4 . But of the bottom three the first one is possible in a network without self-loops, while the other two are again
impossible. The diagonal matrix elements of A4 thus either count the lower-left closed 4-step path in the figure above, or the square
below with either the given orientation or the opposite one.
l

i k

So if we want to compute the number of squares, again counting the different orientations as different squares, then we would need to
subtract the contributions from the 3-node closed 4-step path of the previous figure. But note there is another graph that contributes and
that we almost forgot. In the pictures above we assumed that all links would be traversed only once in the 4-step closed path. But
evidently the 4-step path could also traverse the loop below twice.

j i

For a simple network with adjacency matrix A this means that of we want to calculate the number of squares in the network we need to
compute TrA4  but we need to subtract out the motifs that are part of A4 but that are not squares.

Let us write the different motifs in terms of matrix-elements


' Square ' = Aij Ajk Akl Ali and ' non - Square ' = Aij Aji Aik Aki . (45)

If we sum these expressions over the j, k and l nodes then we get

Aij Ajk Akl Ali = A4 ii and Aij Aji Aik Aki = A2 ii A2 ii . (46)
j,k,l j,k

In the sum over the non-square contributions we are in fact summing over each motif twice as the indices j and k can both take the
same pair of values twice. But this double counting also happens in A4 . Noting that every node in a square counts, i.e. the trace of A4
overestimates the number of squares by a factor 4, we write
1
NSquares = TrA4  - A2 ii A2 ii . (47)
4 i
24 ECON0114-Week-6-Lecture.nb

In our definition we again allow squares with different orientations to be counted separately!

Question: Consider four nodes 1, 2, 3 and 4 that form a square. How many triangles could these nodes maximally be forming?

Practice problems link: The section above is useful for Practice problem 6.

Tree-graphs

Essential

One important kind of network can be distinguished by thinking about the cycles Cn in a network of which we have seen the triangles
C3 and the squares C4 : if a network contains no cycles Cn for n > 2 then the network is called a tree-graph.
Example

read through and look up when necessary

First we generate a network with 25 nodes and a 2/7 probability for a link i → j to be part of the network

A2 = TableRandomChoice[{1, 1, 0, 0, 0, 0, 0}, 25], j, 1, 25;


GraphPlotA2, DirectedEdges → True, VertexLabeling → True

15

18

7 1 24
20 3
13
8
9
4
6

19 25
17
16
12

2 22
5
14
21 10
11

23

But because we want the network to be simple we need to remove the diagonal elements

A0 = A2 - DiagonalMatrixDiagonal[A2];
Diagonal[A0]

{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

Degrees of nodes
The easiest way to compute the in-degree of the nodes is by summing the columns. With Mathematica we can use Total[...]

InDegree = Total[A0]

{8, 6, 2, 10, 4, 8, 7, 8, 8, 6, 6, 6, 11, 10, 7, 7, 11, 9, 9, 6, 11, 8, 5, 7, 9}

The nodes with the largest in-degree can be found as follows


ECON0114-Week-6-Lecture.nb 25

Position[InDegree, Max[InDegree]]

{{13}, {17}, {21}}

The out-degree follows from summing the rows, or equivalently the columns of the transpose of the adjacency matrix

OutDegree = Total[Transpose[A0]]

{10, 9, 8, 3, 8, 8, 6, 6, 7, 6, 10, 10, 2, 7, 8, 8, 7, 4, 7, 8, 5, 9, 9, 10, 14}

There is a single node that has the largest out-degree

Position[OutDegree, Max[OutDegree]]

{{25}}

For large matrices it is often interesting to make histograms of these in- and out-degrees and to understand the statistics of those
degrees when trying to understand the nature of the networks.
Two-step loops
Now let us calculate the number of closed 2-step loops
1
TwoStepLoops = TrMatrixPower[A0, 2]
2
28

In fact if we call Mathematica to give the diagonal of A2 we can see how the two-step loops are distributed across the nodes

TwoStepLooplist = DiagonalMatrixPower[A0, 2]

{3, 4, 0, 1, 2, 2, 1, 1, 2, 1, 3, 2, 0, 3, 5, 1, 3, 2, 4, 2, 3, 4, 1, 2, 4}

or visualized as a histogram

HistogramDiagonalMatrixPower[A0, 2], Frame → True


7

0
0 1 2 3 4 5

Question: Can you find a few 2-step loops in the network graph?

Triangles
Similarly we compute the number of triangles
1
Triangles = TrMatrixPower[A0, 3]
3
129

and if we plot a histogram of those


26 ECON0114-Week-6-Lecture.nb

HistogramDiagonalMatrixPower[A0, 3], 25, Frame → True


5

0
5 10 15 20 25 30 35

We see there is a single node that is part of 35 triangles!

TriangleList = DiagonalMatrixPower[A0, 3]

{14, 17, 7, 5, 7, 17, 15, 13, 10, 12, 21, 17, 10, 21, 11, 28, 18, 9, 17, 14, 21, 16, 17, 15, 35}

You might wonder whether there is a correlation between the number of 2-step loops that a node is part of and the number of triangles?
Well, let us just explore. First we combine the two lists into a list of pairs

TwoStepTriangle = TableTwoStepLooplistj, TriangleListj,


j, 1, LengthTriangleList;
ListPlotTwoStepTriangle, Frame → True,
FrameLabel → "No of 2-step loops", "No of Triangles", PlotRange → Full
35

30

25
No of Triangles

20

15

10

0
0 1 2 3 4 5
No of 2-step loops

The ListPlot[...] suggests a correlation. But if we calculate it, it is rather weak

CorrelationTwoStepLooplist, TriangleList // N

0.384425

Question: Can you find a few oriented triangles in the network graph?

Squares
Similarly we compute the number of squares

1 Length[A0]
2
Squares = TrMatrixPower[A0, 4] -  MatrixPower[A0, 2]j, j
4 j=1

669

If we again compute the list per node


ECON0114-Week-6-Lecture.nb 27

SquaresList = DiagonalMatrixPower[A0, 4] -


2
TableMatrixPower[A0, 2]j, j , j, 1, Length[A0]

{132, 115, 39, 41, 51, 127, 95, 94, 92, 105, 136,
131, 70, 140, 92, 152, 134, 61, 139, 103, 121, 99, 86, 95, 226}

Let us look at this also in terms of a list-plot of the number of triangles and number of squares a node is part of

TriangleSquare = TableTriangleListj, SquaresListj,


j, 1, LengthTriangleList;
ListPlotTriangleSquare, Frame → True, FrameLabel → "No of Triangles", "No of Squares",
PlotRange → Full

200

150
No of Squares

100

50

0
5 10 15 20 25 30 35
No of Triangles

That suggests these quantities have a far stronger correlation in this network. If we compute the correlation we find

CorrelationTriangleList, SquaresList // N

0.92309

that this is indeed the case.

Question: Can you find a few oriented squares in the network graph?

Now this was a random network, so the correlation does not necessarily mean very much but such results are bench-marks against
which to compare real-world networks of which we may need to analyse whether or not they arise randomly or by design or choice.

Question: If a network is really densely connected, i.e. almost a complete network, then every oriented square could contain up to 4
oriented triangles. So we would expect at the upper-limit to have NTriangles = 4 NSquares as a linear relationship. If the network
explored above densely connected do you think?

Extra material: Permutations

read through and look up when necessary

Suppose that we are dealing with a graph G with a set of nodes  and a set of links ℰ, if we would simply swap the names of node 2
and node 3 then this does not change the network. For example in the simple case below I swapped node-names 1 and 2 between the
lefthand network and the righthand network.
28 ECON0114-Week-6-Lecture.nb

1 2

2 1

3 3

But the two adjacency matrices look different


0 1 1 0 0 1
A= 0 0 1 on the left and A = 1 0 1 on the right .
0 0 0 0 0 0

We can turn the left A into the right A by the following operation: swap rows 1 and 2, then swap columns 1 and 2, or the other way
around.
0 1 0
P1↔2 = 1 0 0 can be used to A → P1↔2 . A . P1↔2 .
0 0 1

So performing a pairwise permutation of the nodes can be represented by pre- and post-multiplication by a suitable matrix. In fact for a
general swap i ↔ j we can write down that permutation matrix quite easily using our tensor-products
Pi↔ j =  - e i ⊗ e i - e j ⊗ e j + e i ⊗ e j + e j ⊗ e i (48)

Question: Check that this form is correct for P1↔2 .

Now if we do such a pair-permutation Pi↔ j and we apply it twice then evidently that means that we have restored the original situation.
So we have
(Pi↔ j )2 =  . (49)

Because the pair-permutation is symmetric we have


(Pi↔ j )T = Pi↔ j , (50)

as you can easily verify using equation Eq.(22). Similarly, more complicated permutations can be constructed out of sequential pair-
permutations, for example i ↔ j followed by k ↔ l would be executed as follows
A → Pk↔l . (Pi↔ j . A . Pi↔ j ) . Pk↔l = (Pk↔l . Pi↔ j ). A . (Pi↔ j . Pk↔l )
(51)
= PT . A . P with P = Pi↔ j . Pk↔l .

Permutations are important no because we are going to use them so often, but they are important in understanding the concepts of
connectivity of graphs, reducibility of graphs and the nature of bi-partite graphs. Once you have acquired some intuition for these
concepts you might not need the ‘crutches’ of permutations any more. But in obtaining that intuition thinking about permutations is
helpful.

Practice problems link: The section above is useful for Practice problems 7.

Reducible and Bi-partite networks

Essential

I want to end this set of notes with two observations regarding connectivity of a network. In section 2.1 we established that the
following matrix
ECON0114-Week-6-Lecture.nb 29

-1
C[b, A] =  - ⅇ-b A -  for sufficiently small b , (52)

has off-diagonal 0’s for node-pairs {i, j} that are not connected by a path. Now consider nodes j and k and their paths to and from the
node i. if we would now swap the labels on the nodes j ↔ k then the following would happen to the matrix C[b, A]
 C[b, A]ij  C[b, A]ik   C[b, A]ik  C[b, A]ij 
C[b, A]ji     C[b, A]ki    
          . (53)
swappping j↔k
C[b, A]ki     C[b, A]ji    
         

So if we take the node with the largest number of 0’s in their column and swap it with node 1, then take the node with the second
largest number of 0’s in the column and swap it with node 2, etc, we would get this matrix in a form
C1 D
C[b, A] =   , (54)
0 C2

where we have the following 4 matrices:


 C1 is some m ⨯ m square matrix where every row has at least 1 non-zero entry, C2 is some k ⨯ k square matrix where every row has
at least 1 non-zero entry and n = m + k;
 D is a matrix with m rows and k columns with entries which may, or may not be 0.
 0 is a matrix with k rows and m columns with only 0's.
What it tells us about the network is the following:
 If D ≠ 0 then the network is connected, but path either stay within C1 or C2 or they go from C1 → C2 ;
 If C2 = D = ∅ (i.e. are empty) and C1 contains no 0’s then the network is strongly connected;
 If D = 0 then the network is disconnected and the C j represent disjoint sub-networks.
The procedure generates a permutation P such that
C1 D
C[b, A] = P .  . PT . (55)
0 C2

C1 2 C1 .D + D.C2
Question: Use that P . PT =  = PT . P to show that C[b, A]2 = P . . PT .
0 C2 2

Some books on network theory would call a network of the above form ‘disconnected’ because there are nodes which cannot be
connected by a path in both ways. I reserve the notion of ‘disconnected’ however for networks where there are sub-networks of nodes
which are entirely unconnected in either direction.
Irreducible networks
A network which is connected but not necessarily strongly-connected is usually called irreducible! In the coming weeks week we will
be interested primarily in simple, irreducible networks.
Bipartite networks
Another special category of networks that you might quite often encounter is that of bipartite networks. Bipartite networks are
strongly connected, but permutations can be used to bring the adjacency matrix A into a form
0 D1
A=   . (56)
D2 0

Bipartite networks arise naturally in many contexts. Let me give you just two random examples.
Consider for a moment a sequential game between two players and consider the network that consists of
 nodes representing strategies of either player 1 or player 2, and
 links i → j representing that strategy j can be played following a strategy i move by a previous player.
These strategies then form a bipartite network and the sequential games that can be played then form paths in the network.
Consider an strongly-connected tree-graph. Suppose you colour node 1 red. Now colour blue all nodes you can reach in one step from
1. Now colour red all the nodes that you can reach in one step from all the blue nodes. Etc. At some point all the nodes will be either
red or blue. The network of red-and-blue nodes is bipartite. If the tree is not strongly-connected then the choice of initial node may
mean some node are left uncoloured because they are inaccessible from our starting point.
30 ECON0114-Week-6-Lecture.nb

Computing C[b, A] for a bipartite network

read through and look up when necessary

Now note that


D1 .D2 0
A2 =   , (57)
0 D2 .D1

and
0 D1 .D2 . D1
A3 =   , etc . (58)
D2 .D1 . D2 0

So we find that
∞ ∞
-1
C[b, A] =  - ⅇ-b A -  =  ⅇ-b 2 m A2 m +  ⅇ-b (2 m-1) A (2 m-1) (59)
m=1 m=1

and use the formal series



In[3]:=  A2 m
m=1

 A(2 m-1)
m=1

A2
Out[3]= -
-1 + A2

A
Out[4]= -
-1 + A2

to write the form


-1 -1
C[b, A] = A2 ⅇ-2 b 1 - ⅇ-2 b A2  + A ⅇ-b 1 - ⅇ-2 b A2  , (60)

where the first term is ‘block-diagonal’ because A2 is and the second term is off-diagonal because A is.

3 Further reading
1. E.E.Estrada & P.A. Knight, A First Course in Network Theory, Oxford University Press (2015): Chapters 2 and 5.

You might also like