Driver code
def main ( ) : NEW_LINE INDENT mat = [ [ 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 ] , [ 1 , 0 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 1 ] , [ 1 , 1 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 1 ] , [ 0 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 0 , 1 ] , [ 1 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 ] , [ 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 ] , [ 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ] , [ 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 1 ] , [ 1 , 1 , 0 , 0 , 0 , 0 , 1 , 0 , 0 , 1 ] ] NEW_LINE source = Point ( 0 , 0 ) NEW_LINE dest = Point ( 3 , 4 ) NEW_LINE dist = BFS ( mat , source , dest ) NEW_LINE if dist != - 1 : NEW_LINE INDENT print ( " Shortest ▁ Path ▁ is " , dist ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Shortest ▁ Path ▁ doesn ' t ▁ exist " ) NEW_LINE DEDENT DEDENT main ( ) NEW_LINE