feat: added simple check to graph_from_literal()#1981
Conversation
graph_from_literal()
|
Too risky, let's wait. |
4ac7fde to
bb8d9da
Compare
|
@krlmlr Ok to merge this one too now? |
|
Running revdepchecks now. |
|
I think there is one new failure because of this PR the other two new ones are from other breaking PRs we merged |
krlmlr
left a comment
There was a problem hiding this comment.
Looks good. Can we also promote this check to simplify() directly? How does this work in igraph/C 1.0? I vaguely remember discussing this.
yes, and it looks worthwhile. Where it'd goInto the hand-written wrapper in simplify <- function(graph, remove.multiple = TRUE, remove.loops = TRUE,
edge.attr.comb = igraph_opt("edge.attr.comb")) {
if (is_simple(graph)) {
return(graph)
}
simplify_impl(...)
}Correctness
Performance (measured, 20k vertices / 100k edges)
One behavioral nuanceToday Knock-on effectIf we promote it, the per-call-site guards become redundant and could revert to plain Only real trade-off is philosophical: @krlmlr should I move the check to that function? I actually would favor that |
|
Go for it! (And why is touchstone unhappy?) |
|
GHA workflow configs need to declare the permissions they need. Separate PR probably. |
|
Done. touchstone should be happy now too. Fixed it in separate PRs. merge if green? |
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 6448626 is merged into main:
|
|
Will run revdepchecks combined. |
Fix #824
The PR implements the suggested additional check if a graph is simple or not.
This required a lot of adjustments in the tests given that this means that the edge order was changed. I could imagine that this might lead to issues downstream so keeping this for after the 2.2 release.
cc @szhorvat is this what you intended?