Last active
May 7, 2021 08:51
-
-
Save MASaraji/51a5cab8529156e4721ac634d2efb104 to your computer and use it in GitHub Desktop.
warshal-floyd with permutations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin_matrix = [[0, 1, 0, 0,0], [1, 0, 1, 0,0], [0, 0, 0, 1,1], [0,0, 0, 0,0],[0,0,0,0,0]] | |
from itertools import product | |
a=product(range(len(bin_matrix)),repeat=3) | |
a=filter(lambda a:bin_matrix[a[0]][a[1]] and bin_matrix[a[1]][a[2]],a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment