We apply recursive equation to distance to target through j . and compare with minimum distance so far .
dist [ i ] = min ( dist [ i ] , graph [ i ] [ j ] + dist [ j ] ) NEW_LINE return dist [ 0 ] NEW_LINE