For each x in our input set X: For each equivalence class Y seen so far: Choose any member y of Y. If x is equivalent to y: Add x to Y. Resume the outer loop with the next x in X. If we get to here then x is not in any of the equiv. classes seen so far. Create a new equivalence class with x as its sole member.