Back to Problem Solutions forum
While solving Dancing Pairs i've implemmented classic algorithm for such problem, but the answer differs.
Hi, thanks for your message.
It may happen that my own solution is wrong - I'll try to check your code and hope to come back soon!
Well, I'm having some troubles with running your solution. At first it appeared I need networkx
and
setuptools
, after installing which I suddenly found out that ford_fulkerson
is not defined :)
Could you please tell, what is your answer for some basic case, like this:
3
1: 4
2: 4
3: 4 5 6
UPD: I suddenly think my own solution may be wrong on such case. I'll go and test it!
UPD2: Could you please retry your submission when you have a time. I think I found in the checkre code one line which should be removed. :(
No. Changes does not affected.
I've added imports for networkx
and ford_fulkerson
.
My solution for:
3
1: 4
2: 4
3: 4 5 6
is
2
Thank you! So there should be something wrong with my implementation. I'll mark the problem as suspectededly incorrect and will try to study what could be the trouble more thoroughly.
I'm very sorry for this inconvenience :(
UPD: It appeared that my yesterday's "hotfix" was insufficient - I still was building directed graph improperly and missed the warnings.
Now I hope it is working correctly (please, check - he-he) so thanks once more for your patience and help!
I've solved it without changing my implementation. Thanks for so fast fix!
The pseudo code that I found somewhere is also successful.