Recently, i am studying the data structure of Partition Refinement. It is an useful technique to partition set. The main application of the technique is as follows:
: Given two sets and , how to find and ?
A general idea is that itemize each element and test whether . Obviously, the running time is . But the running time is not good. Is there a beautiful algorithm which has better complexity? Fortunately, we can solve the problem in using Partition Refinement technique. In the following, i will describe the data structure of Partition Refinement and design an algorithm to solve the above problem. There are other applications, e.g., LBFS, the connected components of and so on.