For all words of fixed length L over a given alphabet, I am interested in a practical algorithm that can give me a subset of maximal cardinality such that the Hamming distance between any two words in the subset equals D. (The following variation is also of great interest: ... Hamming distance between any two words in the subset is at least D.)Is there a mathematical result about the cardinality of such sets, depending on the alphabet, the length L of the words, and the minimum distance D?Thank you very much.
Maximum subset of words with Hamming distance  D
ds.algorithms;co.combinatorics;coding theory
In coding theory, the quantity you are looking for is called $A_q(n, d)$, where $n$ is the length of vectors, $d$ is the minimum distance between them, and $q$ is the alphabet size (omitted when $q=2$). Characterizing $A_q(n,d)$ is a challenging open problem (with many basic questions remaining unanswered) but various asymptotic and non-asymptotic upper and lower bounds are known. See Chapter 17 of the book The Theory of Error-Correcting Codes by MacWilliams and Sloane for a summary of the most important ones.