consider the loop as rep(k,n) rep(i,n) rep(j,n) if(dp[i][k] &&
dp[k][j])dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])

here we take one node (first for loop) and check if the cost of moving from
i->j gets reduced on choosing k as intermediate node.

On Sat, Mar 3, 2012 at 6:26 PM, saurabh singh <saurab...@gmail.com> wrote:

> Its quite trivial..it just if there's a shorter way to reach from index j
> and k by using any of the nodes as intermediate....
> Saurabh Singh
> B.Tech (Computer Science)
> MNNIT
> blog:geekinessthecoolway.blogspot.com
>
>
>
> On Sat, Mar 3, 2012 at 5:59 PM, shady <sinv...@gmail.com> wrote:
>
>> Can someone explain Flyod Warshall algorithm, i am unable to understand
>> how it works ?
>> even a good link will suffice, i am not getting the intuition behind it.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to