3 ms·
Generation with constraints is a fairly common algorithm in combinatorics. When you need a set of objects with a particular structure, you could just make all p
by gilleain 5y ago
Generation with constraints is a fairly common algorithm in combinatorics.
When you need a set of objects with a particular structure, you could just make all possible examples and then filter out the unsuitable ones.
However if there are too many objects (matricies, graphs, etc) then this is inefficient. It is better to constrain the generation so that you 'prune' the tree of possible objects.