Is there an algorithm go generate all possible string combinations of a string (DNA Sequence) by a given number of maximal allowed positions that can variate (maximal Mismatches, maximal Hamming distance)?
The alphabet is {A,C,T,G}.
Example for a string AGCC
and maximal number of Mismatches 2
:
Hamming distance is 0
{AGCC}
Hamming distance is 1
{CGCC, TGCC, GGCC, AACC, ACCC, ATCC, AGAC, AGTC, ..., AGCG}
Hamming distance is 2
{?}
One possible approach would be to generate a set with all permutations of a given String, iterate over them and remove all strings with greater Hamming distance that it should be.
That approach is very ressource-eating, by a given String of 20 characters and maximal Hamming distance of 5.
Is there another, more efficient approcahes / implementations for that?