|
|
back to boardCommon Board1004 Time Limmit Anybody knows a fast algorithm for this problem??? Re: 1004 Time Limmit How fast do you need? 'couse DFS is OK Re: 1004 Time Limmit > Anybody knows a fast algorithm for this problem??? What do you mean "fast" ?. Is n^3 fast enough for you? how to write a program with n^3? > > Anybody knows a fast algorithm for this problem??? > > What do you mean "fast" ?. > Is n^3 fast enough for you? > I only find a algorithm based on dijkstra with N^4, so please tell me how to do it Re: how to write a program with n^3? > > > Anybody knows a fast algorithm for this problem??? > > > > What do you mean "fast" ?. > > Is n^3 fast enough for you? > > > > I only find a algorithm based on dijkstra with N^4, so > please tell me how to do it Algorithm with n^3, can be based on Floyd algorithm. I submit this program but I've got wrong answer, so I wrote backtrack solution for this problem, which is fast enough. I suppose you can't use floyd's dynamic method > > > > Anybody knows a fast algorithm for this problem??? > > > > > > What do you mean "fast" ?. > > > Is n^3 fast enough for you? > > > > > > > I only find a algorithm based on dijkstra with N^4, so > > please tell me how to do it > > Algorithm with n^3, can be based on Floyd algorithm. I > submit this program but I've got wrong answer, so I wrote > backtrack solution for this problem, which is fast enough. it's only correct if it's a graph with direction, but it's not in the problem, Re: I suppose you can't use floyd's dynamic method > > > > > Anybody knows a fast algorithm for this problem??? > > > > > > > > What do you mean "fast" ?. > > > > Is n^3 fast enough for you? > > > > > > > > > > I only find a algorithm based on dijkstra with N^4, so > > > please tell me how to do it > > > > Algorithm with n^3, can be based on Floyd algorithm. I > > submit this program but I've got wrong answer, so I wrote > > backtrack solution for this problem, which is fast enough. > > it's only correct if it's a graph with direction, but it's > not in the problem, > I'm sure that this problem can be solved with MODIFIED floyd algorithm. Undirection graph is not "big" problem. |
|
|