Function to find the minimum edge cost having an end at the vertex i
def firstMin ( adj , i ) : NEW_LINE INDENT min = maxsize NEW_LINE for k in range ( N ) : NEW_LINE INDENT if adj [ i ] [ k ] < min and i != k : NEW_LINE INDENT min = adj [ i ] [ k ] NEW_LINE DEDENT DEDENT return min NEW_LINE DEDENT