I often encounter the problem of checking some property of trees (graphic) of a given size with brute force. Do you have any good tricks for this? Ideally, I would like to study each class of isomorphism only once (but speed does it all matter).
Bit-tricks-tricks are welcome since n is usually less than 32 :)
I ask for slightly better algorithms than the similar "loop through all (n-1) -edge subsets and check if they form a tree" for trees on n nodes.
source share