|
|
back to boardcan i use floyd to solve this problem? i solve this problem with floyd ,but i got crash Re: can i use floyd to solve this problem? I think no. After using Floyd you'll get d[i][j] - array with shortest paths and w[i][j] - array with intermediate vertexes. However it will be impossible to find paths that does not contain duplicate vertexes (Floyd doesn't take care of that). And also Floyd will prefer short paths (e.g. 1,2,1) and it doesn't match to requirement of this problem. So Floyd in it's original form is not applicable here. Possibly some adoption is. But I don't actually know how this adoption should work. Re: can i use floyd to solve this problem? It is applicable. You can run it instead of N Dijkstra algorithms. |
|
|