Skip to content

Instantly share code, notes, and snippets.

# 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],