-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New algorithm for ranking spanning arborescences for (#4322) #4796
Conversation
Allow user to specify an attribute for labels (#15)
Rebase on the latest version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes might get this through the tests...
Also, the test file should be treated by black...
This looks like it is going to be very hard to review. I guess a summary of all these comments is a request that you go through the code again with the goal of refactoring it into a minimalist, sleak set of functions and data structures. The code clearly is a lot of work and it passes the tests and provides a nice feature. Thank you for this! |
Thanks for the reply.
This is the first thing I thought about when implementing this algorithm. The data structure with three dictionaries for sources, targets, weights of edges is used in the paper [camerini1980ranking] all along. There is no other paper or code implementation in the past 41 years, as far as I know. I learnt basic graph algorithms systematically before and (I think) am familiar with
I would suggest users to stick to string as node name. This is not an algorithm that someone can play around ... and at least I am not able to design any unit tests for more generic cases.
Will see what I can do after solving those easy ones. It might be very hard to break them even smaller. In [camerini1980ranking], three giant algorithms, written in extremely brief mathematical terms, are present directly, along with some weird definitions ... I did learn a lot by implementing it. It works okay with a larger case in my thesis, so I pass the defense :-)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this one is stuck. I'm +1 for the idea, but -1 for the implementation that introduces many new graph classes which (IMO) makes the code very difficult to understand. Even if the newly-introduced subclasses were made private (which would be necessary IMO), it still wouldn't help the readability very much as the OO design introduces a lot of indirection and new interfaces to learn before you can start to get down to the algorithm itself.
I believe that this functionality has already be implemented with the To get the |
I agree this algorithm does the same thing as I agree the implementation is not good, because I exactly followed [camerini1980ranking]. The paper also mentioned that it was not efficient, because the algorithm was found for the first time. The type annotations I added are not accurate, so some work is needed for |
I have done:
black
.As far as I know, there are problems: