Update the values of neighbor nodes of u which are not yet included in MST .
for ( int v = 0 ; v < n ; v ++ ) { if ( city [ u ] [ v ] && mstset [ v ] == false && city [ u ] [ v ] < keyval [ v ] ) { keyval [ v ] = city [ u ] [ v ] ; parent [ v ] = u ; } } }