my question is given an adjacency matrix of a graph and a positive interger n find the number of path of length n between two vertices,i don't know how to convert to programming? somebody can help me.
+1
A:
Take A^n then read the appropriate entry.
If you want it more efficient for single vertices, do a random walker starting at first vertex for n iterations.
ypnos
2010-10-14 14:25:45
+1
A:
I'm assuming this is homework, so here's a hint. If you were given a pencil and paper, and a small adjacency matrix, how would you count the number of paths?
Stephen C
2010-10-14 15:10:57
Thomas Matthews
2010-10-14 15:24:46
A:
iera
2010-10-14 16:17:02