Hi everyone, recently tried to solve this problem. In the forum, a guy says to settle with Floyd-Warshall, but I do not know how to do that '-'
Can anyone explain me how to solve this problem used Floyd-Warshall algorithm?
Problem in a nutshell: You have a graph (N <= 100) and M querys. Each query asks about the minimum distance between two vertices using a maximum K steps.
You can use a modification of Matrix Exponentiation similar to Floyd-Warshall, see : This book for a tutorial (page 220).
Good book. Thanks
I think you didn't understand the problem correctly, It says "t indicates that cities 1,2, .., t can be used for stopovers."
So t doesn't indicate the number of cities that you can visit, it indicates that you can only use cities from 1 => t, and this is a straight forward Floyd Problem.
omg, you are correct '-'. I have to return to primary for learn read xD
Thanks for advice
Where can I test my solution to that problem??
Had you noticed that on the top of the page, written
URI Online Judge | 2130
? That means it is 2130 number problem of URI OJ. So you just need to google:URI Online Judge 2130
By the way, link to the problem is: Here