Guest User

Floyd algorithm, without function, time = 7 sec

a guest
Aug 20th, 2012
1,348
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2. random.seed(179)
  3. N = 200
  4.  
  5. A = [ [random.randint(1, 10000) for i in range(N)] for j in range(N)]
  6.  
  7. for k in range(N):
  8.     for i in range(N):
  9.         for j in range(N):
  10.             A[i][j] = min(A[i][j], A[i][k] + A[k][j])
RAW Paste Data