Good luck, this is exactly the NP-complete Minimum Set Cover problem (which makes me hope it's not homework). The universe is the set of letters, the family of subsets is the dictionary of words. You want to minimize the number of words needed to use all the letters in the alphabet, in other words, the number of subsets needed such that each element in the universe is contained in at least one chosen subset.
You won't be able to do significantly better than brute force, unless an approximation algorithm would also be appropriate for your needs. But with a huge dictionary, the running time is going to be intractable.
| [reply] |
| [reply] [d/l] |
blokhead,
Good luck,...
Thanks, I am sure I will need a bit of that.
But with a huge dictionary, the running time is going to be intractable.
Well fortunately for humans, alphabets are relatively small and very long words that do not repeat letters are uncommon. The number of words that you need consider from a huge (~ 65K words) is quite manageable. See How many words does it take? for an example.
| [reply] |
Such a sentence is called a pangram.
Find an anagram solver, and give it a source "word" of 'abcdefghijklmnopqrstuvwxyz'. If you can't find an anagram for that, add another 'e'. Or an 's'. Or a 't'. Or an 'a'. You could bruteforce this prospect, but you should figure out a pangram pretty quickly.
-- [ e d @ h a l l e y . c c ]
| [reply] |
had a idea but I need some suggestion to start it correctly.
Post what you have then. The monks here will gladly
help you with the problem, but you need to show some
effort on your part.
| [reply] |
sounds like boring homework actually.
look for longest words in dictionary with greatest number of letter diversity to complement each other. you can find these handful of words with a little script. then just play with the words by hand, or optimize it with a script. A friend of mine once (a long time ago) challenged me to a program vs program game of noughts and crosses. he programmed logic, i hardcoded the moves. i won every game. | [reply] |
| [reply] |