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
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
Thankz for your reply, however i asked for the maximum matching, not maximal matching, but thanks anywayz for the reply, and one more thing, can you please tell me an algorithm for these i.e for maximum matching which is btw faster then hungarian. And i am really bad at DP, i think this wont work with me, but i can see u formulated it nicely. Do you have a source code for this ???
Thanks
Ghost016
Thanks
Ghost016
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
In bipartite Graphs ( like trees ) maximum matching = vertex cover !
Hmmmmm. Mb it's http://acm.timus.ru/problem.aspx?space=1&num=1109 ?
FYI: I don't think the above problem ensures that the connections will form a tree. Hence, the DP solution for tree won't work for this problem.
Since this thread is already necroposted, here is a proper link to maximum matching on a tree: https://cses.fi/problemset/task/1130