ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1389. Roadworks

Baurzhan biparite matching [6] // Problem 1389. Roadworks 14 Aug 2009 10:57
is it possible to find biparite matching for n or n logn?
if we divide graph into 2 parts  - maximal matching is the answer. But biparite matching founding time is NM(max-flow) so N*N(because it's tree).
MarioYC Re: biparite matching [5] // Problem 1389. Roadworks 4 Nov 2010 11:47
I got AC using bipartite matching :)
Baurzhan Re: biparite matching [4] // Problem 1389. Roadworks 4 Nov 2010 16:42
I'm too - Hopcroft-Carp rulezz=)
hoan Re: biparite matching in O(nlogn) ?????? [1] // Problem 1389. Roadworks 6 Dec 2010 22:07
i use dynamic progrmaming and got AC in O(N), i think the best the algo too find maximum biprate matching ue O(nm), what's your algo?????

sorry for y poor english.
Baurzhan Re: biparite matching in O(nlogn) ?????? // Problem 1389. Roadworks 7 Dec 2010 08:40
AFAIK, Fastest biparite matching algorithm - Hopcroft Carp, with complexity E*sqrt(V); V-num of vertices; E - num of edges; Given graph is a tree, so it's possible to color it into 2 colors, after that, take all black vertices as one part, white as other part and find max matching between them.
I can't give strict evidence of this approach but it intuitively understandable - just draw sample output on the paper and everything will become clear=) You can see my code -> i shared my account here http://acm.timus.ru/forum/thread.aspx?id=25749&upd=634266195834002500 Just look my submission.
Lavrentiy Palovich Re: biparite matching [1] // Problem 1389. Roadworks 6 Jul 2011 17:48
this algo is very similar to Dinica algorithm, are they identical?
Lavrentiy Palovich Re: biparite matching // Problem 1389. Roadworks 6 Jul 2011 18:11
ну, не знаю даже! Кун прошел за 0.9