正在加载图片...
FASTER-ALL-PAIRS-SHORTEST-PATHS(W) 1n= W.rows 2 L() =W 3 m=1 4 while m<n-1 5 let L(2m)be a new n x n matrix 6 L(2m )=EXTEND-SHORTEST-PATHS(LOm),LOm)) 7 m 2m 8 return LOm) Because each of the g(n-1)1 matrix products takes (time.FASTER- ALL-PAIRS-SHORTEST-PATHS in)time.Observe that the code is tight,containing no elaborate data structures,and the constant hidden in the -notation is therefore small
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有