What are the paths for this adjacency matrix?

944 Views Asked by At

This is the matrix 0 1 2 3 0(1 1 1 0 ) 1(1 0 1 0 ) 2(1 1 0 1 ) 3(0 0 1 1 )

The question is provide the matrix that represents the numbers of paths of length 3 between any two vertices. Your solution to this should indicate there are six paths of length three from vertex 0 to vertex 2. one of them is <(0,0)(0,1)(1,2)> list the other 5.

I don't understand how to find the 6 paths, this is because I dont see how there can be 6 paths, all paths I could find that were length 3 was 6 paths, and not all of them were from vertex 0 to 2

1

There are 1 best solutions below

0
On

With rows and columns corresponding to vertices 0, 1, 2, 3, the adjacency matrix we're told is this: $$ A = \left[\begin{array}{cccc} 1 & 1 & 1 & 0 \\ 1 & 0 & 1 & 0 \\ 1 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 \end{array}\right] $$ The $i,j$ entry of A is 1 if there is a path of length 1 between vertex $i$ and vertex $j$.

To count paths of length 3, we must look at $A^3$, the cube of the adjacency matrix. It's $$ A^3 = \left[\begin{array}{cccc} 7 & 5 & 6 & 3 \\ 5 & 3 & 5 & 2\\ 6 & 5 & 4 & 4\\ 3 & 2 & 4 & 3 \end{array}\right] $$ Note that the 0,2 entry is 6. So there are 6 paths of length 2 from vertex 0 to vertex 2. Note that some of these paths, such as the example given in the question, involve self-loops at one of the vertices.

Here are the paths of length 2 from vertex 0 to vertex 2:

<(0,0)(0,0)(0,2)> and <(0,0)(0,1)(1,2)>

<(0,1)(1,0)(0,2)>

<(0,2)(2,0)(0,2)> and <(0,2)(2,1)(1,2)> and <(0,2)(2,3)(3,2)>