I have no idea how squaring the matrix shows the number of 2 stage routes and how cubing shows the number of 3 stage routes
#matrices explanation
5 messages · Page 1 of 1 (latest)
so as you may know, M represents the direct routes between two nodes (points on a graph, so the resorts)
so if M[A][B] == 1, there is a direct route, and if M[A][B] == 0, there is no direct route
when you square M, it shows the number of routes that you'd have to stop somewhere and then continue to complete the route
e.g. from london -> liverpool, if M[London][Liverpool] == 2, there are 2 routes
When you multiply a matrix by itself, youre not actually squaring the numbers, you multiply the rows by the columns
So if i wanted to find M^2[A][B], id actually have to look at any intermediates and sum them
so A,C * C,B for instance
so you count any direct routes from A to C and C to B and sum those values, then sum those
if that doesnt make sense lmk ill try explain it graphically
thanks for that that makes more sense , its kindof crazy that simply squaring(ect) can show u all this stuff