Doing path compression
INDENT parent [ a ] = find_set ( parent [ a ] ) NEW_LINE return parent [ a ] NEW_LINE DEDENT def union_set ( a , b ) : NEW_LINE INDENT global N , v , g , vis , In , low , parent , rnk , bridges , n , m , timer , diameter NEW_LINE DEDENT