A*B
or T*v
.
You can also exponentiate via A**10
column_matrix
command, e.g., column_matrix([1,2,3])
A[i]
for the i-th row or
A[i][j]
for the (i,j) entry.
matrix
command.
This is what I did for my tm
function.
matprint
to print matrices
with less precision. You can also transform a column vector v
to a row vector with v.transpose()
.
Task 1: For each of the following graphs G, compute the transition matrix T and use this to study the behavior of a random walk starting at vertex 0. Try to determine the limiting behavior of the random walk. Discuss with your neighbors the meaning of these results.
Task 2: Let C5 be the cycle graph of order 5, and K5 be the complete graph of order 5. For each of these graphs, about how many steps does it take for a random walk starting at vertex 0 to approach of the limiting value (say, for each coordinate to get within 0.01 of the limiting value)? Which converges faster? Why do you think that is? Discuss with your neighbors.
Task 3: Repeat task 1 for the Florentine families and karate club graphs. What does this tell you about which nodes are most important? Discuss with your neighbors.