2.4 Matrix algebra and the product of adjacency matrices — Practise with help
Warm-up: remember
- A network has adjacency matrix . What is the degree of each vertex?
- How many edges has it?
Answers and feedback
- Row sums: .
- , so . The edges are and .
Practise with help
1. Work out .
Hint
Row times column, four times.
Next step
Row 1, column 1: .
Full working
- Row 1, column 1:
- Row 1, column 2:
- Row 2, column 1:
- Row 2, column 2:
2. A network has adjacency matrix . Work out .
Hint
Each entry is a row of times a column of .
Next step
Row 1 of is . Times column 1 () gives .
Full working
Check: the diagonal entries are the degrees. Every vertex here has degree , and every diagonal entry is . The check passes.
3. For that network, how many walks of length 2 are there from vertex 1 to vertex 2? List them.
Hint
Read the entry in row 1, column 2 of .
Next step
The entry is . Which middle vertex works?
Full working
The entry in row 1, column 2 of is , so there is exactly one walk of length 2 from 1 to 2. It is : vertex 3 is the only vertex joined to both 1 and 2.
(Vertex 1 itself does not work as a middle vertex, because there is no loop at 1.)
4. For the same network, how many walks of length 3 are there from vertex 1 back to vertex 1?
Hint
You need the diagonal entry of . Work out .
Next step
. Row 1 of is . Times column 1 of ().
Full working
The diagonal entry for vertex 1 is , so there are 2 walks of length 3 from 1 back to
- They are and : round the triangle in either direction.
5. A student multiplies two matrices and gets a different answer from their classmate. The classmate says "matrix multiplication is not commutative". Explain what that means, with an example, and say which order is right.
Hint
Try and then swap them.
Next step
Work out both products and compare.
Full working
"Not commutative" means is usually not equal to : swapping the two matrices changes the answer.
but
Different. So neither order is "right" in general — the order is part of the question, and you must multiply the way it is written. For an adjacency matrix, means , which is unambiguous because it is the same matrix twice.
6. Explain why the number of walks of length 2 from a vertex back to itself is the degree of that vertex.
Hint
A walk of length 2 out and back uses one edge twice.
Next step
How many choices of edge do you have on the way out?
Full working
A walk of length 2 from back to must go for some neighbour , using the same edge twice. There is one such walk for each edge at , so the number of them is the degree of .
In the matrix this is the diagonal entry , and since the network is undirected , so this is — the row sum, which is the degree. So the check "diagonal of equals the degree" is not a coincidence; it is the same fact twice.
A question from Section 2.3
7. The adjacency matrix of a network is . Write down the network, then find the number of walks of length 2 from vertex 1 to vertex 3.
Hint
Read the edges off the matrix first — it is quicker than guessing.
Next step
The s are at , , , : edges and .
Full working
The network is a path : edges and .
The entry in row 1, column 3 is , so there is exactly one walk of length 2 from 1 to 3: .
Notice that vertices 1 and 3 are not joined, yet there is a walk of length 2 between them. That is the point of the rule: it finds connections through intermediate vertices, which is what a route is.
8. A network has 4 vertices, and has every entry equal to . How many walks of length 2 are there in the whole network? What does this say about the network?
Hint
Add all the entries of .
Next step
There are entries, each .
Full working
The total of all the entries is , so there are 32 walks of length 2 in the network.
Every off-diagonal entry being means every pair of distinct vertices is joined by exactly two walks of length 2 — so every pair has a common neighbour, and in fact two of them. Every diagonal entry being means every vertex has degree . A network in which every vertex has degree and every pair has two length-2 walks is not possible on 4 vertices without multiple edges, which is worth noticing: the question describes a matrix, and the matrix may not describe a simple network. That is a reminder that a matrix can be written down whether or not it comes from a drawing.