API

FiveLetterWorda.adjacency_matrixFunction
adjacency_matrix(words, T::Type{<:AbstractMatrix}=BitMatrix; progress=true)

Compute the adjacency matrix.

Default is BitMatrix, which is a memory dense format, but which can be slower to read individual elements. Another alternative is Matrix{Bool}, which is noticably faster for reading individual elements but requires 8 times the storage space.

source
FiveLetterWorda.cliquesFunction
cliques(adj, wordlist, order=5; progress=true)

Find all five-cliques in the adjacency matrix adj.

The cliques are interpreted as entries in wordlist (so the adjacency matrix should reflect the same ordering as wordlist) and the results are then returned as the relevant words.

source
FiveLetterWorda.cliques!Function
cliques!(results::Vector{Vector{String}}, adj, wordlist, order=5;
         progress=true)

Find all order-cliques in the adjacency matrix adj, storing the result in results.

Warn

result is emptied before being populated.

See also cliques

source
FiveLetterWorda.mainFunction
main(n=5; exclude_anagrams=true,
    adjacency_matrix_type=Matrix{Bool}, order=fld(26, n),
    progress=true)

Do everything. 😉

Find the set of groups of order n-letter words where each group of words has no shared letters between words.

If exclude_anagrams=true, then anagrams are removed from the word list before finding the result.

You can specify the storage type of the adjaceny matrix with adjacency_matrix_type. BitMatrix, is very dense in memory, packing eight vertices into a single byte. Matrix{Bool} stores one vertex per byte and is thus 8 times as large, but noticably faster. See also adjacency_matrix

The order specifies the order of cliques to find and defaults to fld(26, n), i.e. the maximal possible order for a given word length. Note that cliques of lower order are more common, so there are many more of them.

Returns a named tuple of containing

  • the adjacency matrix adj of words, i.e. the matrix of indicators for whether a given pair of words have no letters in common
  • the vector of words used words
  • the vector of WordCombinations found.
source
FiveLetterWorda.remove_anagramsMethod
remove_anagrams(words::Vector{String})

Remove all anagrams from words.

This reduces the set of words to the set of equivalence classes under the operation "anagram". The representative member from each class is just the first word encountered from that class. If the vector is sorted lexicographically, then this is just the anagram that comes first in the alphabet.

source
FiveLetterWorda.write_tabMethod
write_tab(fname, wcs::Vector{Vector{String}})
write_tab(fname, wcs::Vector{WordCollection})

Write the results out to a tab delimited file.

source