There is a set of feasible characters, say ABCDEF. Combining some of them, I can generate some "meaningful" combinations, say CAFE. I want to gather all of them.
To do that, I can just "walk through" all possible combinations, starting from length of 2, then 3, until max allowed length, say 5. Then I can check each combination for it's "meaningfulness". But this is inefficient algorithm.
Instead, there is rules that define "meaningfulness". For example, one character couldn't follow after another one, say B after F (contrived example). And vice versa. Some short combinations defines another, more specific rules, etc.
This way I can drastically reduce iterations needed for gathering all possible "meaningful" combinations (looks like).
Is there any well know algorithm for generating combinations in such a way?