Блог пользователя ghost016

Автор ghost016, 15 лет назад, По-английски
Hello all,

Recently i am stuck with a problem, which i was trying on my own for couple of days, i have two different trees which are weighted, weights are assigned in some basis which are not of the concern now, anywayz i thought of transforming it into bipartite graph and then find the maximum weighted matching between them, but next i thought of doing the maximum tree matching rather then transforming into graph and then doing the match, now i am stuck here, i really want to know how to do it. Many good coders are here, please any one help me with this.

ThankS
Ghost016
  • Проголосовать: нравится
  • +11
  • Проголосовать: не нравится

15 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится
As far as I understand, your problem is: "You have a weighted tree, you need to find maximal matching".
You can do simple DP.
dp1[v] - The maximal matching of the subtree rooted by v where v is already covered by matching.
dp2[v] - The maximal matching of the subtree rooted by v where v isn't covered by matching yet.
»
8 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Are there any problems in the Online Judges about Maximum Matching on the tree?

I cannot find (only there is minimum Vertex Cover on the tree).

I want to give it for my school students