Prim 's algorithm using priority_queue in STL | If v is not in MST and weight of ( u , v ) is smaller than current key of v ; Updating key of v
if ( inMST [ v ] == False and key [ v ] > weight ) : NEW_LINE INDENT key [ v ] = weight NEW_LINE pq . append ( [ key [ v ] , v ] ) NEW_LINE parent [ v ] = u NEW_LINE DEDENT