an algorithm to solve the similarity join problem (serial version)