W[i][j] = min(W[i][j], W[i][k] + W[k][j])
if (a[i,k]+a[k,j] < a[i,j]) then begin a[i,j]:=a[i,k]+a[k,j];