Let us create the following graph 2 3 ( 0 ) -- ( 1 ) -- ( 2 ) | / \ | 6 | 8 / \ 5 | 7 | / \ | ( 3 ) -- -- -- - ( 4 ) 9
cost = [ [ INT_MAX , 2 , INT_MAX , 6 , INT_MAX ] , [ 2 , INT_MAX , 3 , 8 , 5 ] , [ INT_MAX , 3 , INT_MAX , INT_MAX , 7 ] , [ 6 , 8 , INT_MAX , INT_MAX , 9 ] , [ INT_MAX , 5 , 7 , 9 , INT_MAX ] ] NEW_LINE