A DP Optimization Trick on Trees
Efficient Subtree Merging in Dynamic Programming on Trees.
By Thiago Felipe Bastos da Silva
There is a useful optimization trick involving DP on trees that I would like to discuss. It was detailed in the comments of this Codeforces blog. In short, you can define a DP over the vertices of a tree and compute its value for each $v$-subtree by combining the children...
[Read More]