Driver code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT MAXM , INF = 100 , 10 ** 7 NEW_LINE dis = [ [ - 1 for i in range ( MAXM ) ] for i in range ( MAXM ) ] NEW_LINE Next = [ [ - 1 for i in range ( MAXM ) ] for i in range ( MAXM ) ] NEW_LINE V = 4 NEW_LINE graph = [ [ 0 , 3 , INF , 7 ] , [ 8 , 0 , 2 , INF ] , [ 5 , INF , 0 , 1 ] , [ 2 , INF , INF , 0 ] ] NEW_LINE DEDENT