Similarity relations: the calculation of minimal generating families