Update union find algorithms