-
-
Notifications
You must be signed in to change notification settings - Fork 654
improve graph backends to fix bug in lex_BFS
#39935
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
Conversation
Documentation preview for this PR (built with commit 8253903; changes) is ready! 🎉 |
65a6a01
to
4dfd8ce
Compare
@cyrilbouvier, can you check this PR. A segmentation fault occurs with immutable graphs but I don't understand what's going on. As you can see, the behavior is somewhat random but will eventually crash. sage: G = Graph(graphs.HouseGraph(), immutable=True)
sage: G.lex_BFS(algorithm="fast")
---------------------------------------------------------------------------
SignalError Traceback (most recent call last)
Cell In[2], line 1
----> 1 G.lex_BFS(algorithm="fast")
File ~/sage/src/sage/graphs/traversals.pyx:500, in sage.graphs.traversals.lex_BFS()
498 else:
499 initial_v_int = -1
--> 500 sig_on()
501 extended_lex_BFS(cg, sigma_int, NULL, initial_v_int, &pred, NULL, NULL)
502 sig_off()
SignalError: Segmentation fault
sage: G = Graph(graphs.HouseGraph(), immutable=True)
sage: G.lex_BFS(algorithm="fast")
[None, 0, 0, 0, 4]
sage: G = Graph(graphs.HouseGraph(), immutable=True)
sage: G.lex_BFS(algorithm="fast")
[0, 1, 2, 3, 4] |
Got it ! The number of arcs in |
Sorry for not replying earlier, I was on holidays. |
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.
LGTM.
The failing CI does not seem related to this PR (error is no space left on device.
, looks more like an error with the CI or runner)
sig_on() | ||
extended_lex_BFS(cg, sigma, NULL, initial_v_int, NULL, | ||
&(self.xslice_len), &lex_label) | ||
sig_off() |
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.
More a naive question than a remark: why sig_on/sig_off
are needed here ?
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.
I don't think it's mandatory, but in case of failure it helps locating the issue in this call.
Thanks for the review. I set this PR to positive review on your behalf. |
Fixes #39934.
We ensure that the sparse/dense/static_sparse graph backends have the methods needed in
lex_BFS
andslice_decomposition
.📝 Checklist
⌛ Dependencies