Lavishe's blog

By Lavishe, history, 12 months ago, In English

Greetings everyone, I have a question regarding certain tree DP problems — for example, this one: https://cses.fi/problemset/task/1130. Why is it that we can arbitrarily choose node 1 as the root (rather than some other node $$$u$$$ without it affecting the final outcome?

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
12 months ago, hide # |
 
Vote: I like it +42 Vote: I do not like it

Because the value you are calculating does not depend on the root. You can find a different matching, though.