Skip to content
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

graph/labeled_graph: added remove_labeled_vertex #354

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

DeuceBox
Copy link

I took this patch from this ticket:
https://svn.boost.org/trac/boost/ticket/9493
which no longer exists.

But I believe the original ticket issue was identical to #167 which this patch fixes.

@jeremy-murphy
Copy link
Contributor

I'm looking on my phone so I might be wrong, but it looks like it's running GCC 4.X in the CI, which I thought I removed. Are you up to date on develop?

@DeuceBox
Copy link
Author

I'm looking on my phone so I might be wrong, but it looks like it's running GCC 4.X in the CI, which I thought I removed. Are you up to date on develop?

You're correct that my branch was quite far behind develop. I just rebased on the latest develop, pushed again, and the tests were still failing. It appears that the original patch I preserved from the original svn ticket/tracker only accounted for unique associative containers, and not a random access / vector container that the tests use.

I did my best to update the patch and mimic the tag dispatch approach used by other methods to add support to remove_labeled_vertex for random access containers and multiple associative containers as well, and pushed that updated branch now,

@jeremy-murphy jeremy-murphy self-assigned this Nov 20, 2023
@jeremy-murphy
Copy link
Contributor

jeremy-murphy commented Nov 20, 2023

Looks good. Could you please modify an existing unit test for labelled graphs to assert that the change is effective?

I.e., change a unit test so that it fails without this change, then put it together with your changes so that it passes.

PS. And if there is no existing unit test for labelled graphs... please write a really simple one. :)

@DeuceBox
Copy link
Author

I've added a test for removing a labeled vertex, based on the original #167 post's code snippet. I tested that it fails without my patch, and passes with my patch.

@jeremy-murphy
Copy link
Contributor

I've added a test for removing a labeled vertex, based on the original #167 post's code snippet. I tested that it fails without my patch, and passes with my patch.

That's great.

It does make me wonder about duplicate labels, though -- what happens? Is it even possible? If duplicate labels are possible in any circumstance, then we need a test to confirm what happens.

@DeuceBox
Copy link
Author

Added a test that uses a multi associative container and adds two vertices with the same label, and then removes them one by one, asserting the graph vertex count at each stage.

@jeremy-murphy
Copy link
Contributor

Added a test that uses a multi associative container and adds two vertices with the same label, and then removes them one by one, asserting the graph vertex count at each stage.

Fantastic. As soon as the CI is green, I'll merge it.

@jeremy-murphy jeremy-murphy merged commit fa2636d into boostorg:develop Nov 28, 2023
8 checks passed
@jeremy-murphy
Copy link
Contributor

Thanks so much for fixing a long-standing bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants