generate similaries matrix