We put a directed multigraph on the board with five nodes {1,2,3,4,5} and eight edges {a from 1 to 2, b from 1 to 2, c from 2 to 4, d from 3 to 5, e from 4 to 3, f from 4 to 5, g from 5 to 1, and h from 5 to 4}.
A = 0 2 0 0 0 A^2 = 0 0 0 2 0 A^4 = 2 0 0 2 2 0 0 0 1 0 0 0 1 0 1 1 2 1 1 1 0 0 0 0 1 1 0 0 1 0 1 0 0 3 1 0 0 1 0 1 1 0 0 1 1 1 2 1 3 2 1 0 0 1 0 0 2 1 0 1 1 2 3 1 3
The first row of A4 adds to 6, which matches the six paths out of vertex 1 found in Question 1. The lower-right corner of A4, the entry A5,5, is 3, which matches the three paths from vertex 5 to itself found in Question 1.
How many total four-step paths are in the graph? The sum of all 25 entries in the matrix A4, which is 36.
There is a path from i to j for every pair i and j. There are several
ways to see this:
We can think of the matrix Bk as indicating whether there is
a path of length exactly k from i to j in the graph made from G by adding a
loop at each vertex. This is true if and only if there is a path in G of
length k or less. Thus our matrix of all ones matches our conclusion
in Question 3 that the path relation is always true. The fact that
B3 = B4 for this graph means that here, there is always
a path of length at most three from i to j. In any graph of n vertices, as
we discussed in lecture, there is a path from i to j at all if and only
if there is a path of length at most n-1.
B = 1 1 0 0 0 B^2 = 1 1 0 1 0 B^3 = B^4 = 1 1 1 1 1
0 1 0 1 0 0 1 1 1 1 1 1 1 1 1
0 0 1 0 1 1 0 1 1 1 1 1 1 1 1
0 0 1 1 1 1 0 1 1 1 1 1 1 1 1
1 0 0 1 1 1 1 1 1 1 1 1 1 1 1
Last modified 27 April 2006