Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SageMath implementation of Warshall's algorithm
def warshall(M):
n = M.nrows()
W = M
for k in range(n):
for i in range(n):
for j in range(n):
W[i,j] = W[i,j] or (W[i,k] and W[k,j])
return W
@tahmidhasan3003

This comment has been minimized.

Copy link

tahmidhasan3003 commented Oct 16, 2019

Is the only iteration gives the final result or should I have to repeat this process?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.