-
Notifications
You must be signed in to change notification settings - Fork 208
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
Is maximum_adjacency_search
broken?
#297
Comments
Interesting. Thanks for looking into it! You've certainly identified some serious issues with that implementation. The next big question would be, do the existing unit tests cover everything? If they do, then someone can be free to refactor the hell out of that implementation. But I can only imagine that it is going to require some additional tests to cover the obviously wrong behaviour on The existing unit tests are moderately complicated; if someone wants to tackle this, I'd recommend adding some ultra-simple ones too. |
Hey, I had a look at this as well. I'm not sure about the correctness of the pseudo-code/algorithm in the documentation (https://www.boost.org/doc/libs/1_82_0/libs/graph/doc/maximum_adjacency_search.html). Could either of you check whether this is correct?
Please let me know what you think. I am going to take a look at the unit tests and/or maybe write some tests myself to verify the above algorithm. |
Just to add to the above, it seems the implementation does what it's supposed to do. However, the pseudocode in the documentation doesn't match up with the original papers, nor does it match up with the implementation. |
It took me a while of reading the documentation for this to realize that MAS is not an algorithm per se but another search strategy like BFS and DFS. That documentation could do with some nice graphs that show the sequence of the search, etc, and ultimately I would categorize this along with BFS and DFS in the table of contents, changing the category from "Core Searches" to just "Search". (As an aside "A* search" is not really a search, so it's fine where it is.) Anyway, the way forward is to make the unit tests watertight first so that then you can go to town changing the implementation. I wouldn't worry too much about the pseudocode for now. |
Great, I'm working on the unit tests right now. I'm expanding the existing ones and making new ones for simple and complex graphs. |
Hey @jeremy-murphy, @sebrockm (and others), I have created #333 which refactors the existing tests and creates many new ones. Please let me know what you think. |
Also on the |
There are several things wrong with
maximum_adjacency_search
:weights
is a required parameter. It's unclear what it is doing.set
defined, but it is never filled with any values. In L181 there is a loop iterating over this always emptyset
. This is dead code.assignments
property map is a dead parameter. Looking at the implementation, in L131 we see the one and onlyput
operation performed on it. It overrides all possibly provided user input and assigns every vertex to itself. That makes all followingget
operations obsolete (everyget(assignments, x)
is equivalent to justx
).Background:
This algorithm was introduced in 393c072. There, it was extracted from
stoer_wagner_min_cut
which caused #286.The text was updated successfully, but these errors were encountered: