If the given graph is connected or components minimum values not having any negative edge
if ( flag == False or ( flag and len ( s ) == 1 ) ) : NEW_LINE INDENT for i in s : NEW_LINE INDENT if ( i != min1 [ 0 ] ) : NEW_LINE DEDENT DEDENT