This file contains 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
# this code prints all the shortest paths possible from start node | |
# to end node in UNDIRECTED, UNWEIGHTED graph | |
class node: | |
def __init__(self,val,path,dis): | |
self.val = val | |
self.path = path | |
self.dis = dis | |
ans = [] | |
graph =[ | |
[0, 1, 0, 0, 0, 0, 0], |