Recurrence relation
for ( auto it : ed ) dis1 [ it . first . second ] = min ( dis1 [ it . first . second ] , dis [ it . first . first ] + it . second ) ; for ( int i = 0 ; i <= n ; i ++ ) dis [ i ] = dis1 [ i ] ; }