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

feat: simple_cycles() lists all simple cycles #1580

Draft
wants to merge 1 commit into
base: simple-cycles-base-branch
Choose a base branch
from

Conversation

szhorvat
Copy link
Member

@szhorvat szhorvat commented Nov 11, 2024

This PR depends on #1567 and #1571. For now, it targets the simple_cycles-base-branch branch, which has those PRs merged. Once they are merged to main, it should be marked as ready-for-review and re-targeted.

Can you please help me implement tests @maelle ? What I'd like to have a is a check on the cycle length histograms for the graph already added to the examples. Count cycles of length 1, length 2, etc. and add a check on the expected numbers. I'm not sure what's the best way to do this in R.

Closes #1573

@szhorvat szhorvat requested a review from krlmlr November 11, 2024 11:35
@szhorvat
Copy link
Member Author

Perhaps min / max should use a NULL default instead of -1.

We can model this on cliques()

@szhorvat szhorvat marked this pull request as ready for review November 12, 2024 10:10
@szhorvat szhorvat marked this pull request as draft November 12, 2024 10:11
@szhorvat
Copy link
Member Author

szhorvat commented Nov 12, 2024

Refactored to use NULL as the default value.

It would be useful not to prevent running checks when the base branch is not main.

@krlmlr krlmlr requested a review from Antonov548 November 27, 2024 08:14
@maelle
Copy link
Contributor

maelle commented Nov 28, 2024

@krlmlr why is a review by @Antonov548 needed? After that review, I can work on the tests.

@Antonov548
Copy link
Contributor

@krlmlr why is a review by @Antonov548 needed? After that review, I can work on the tests.

The idea was just to take a look active pull requests to still keep up to date what is changing.

Copy link
Contributor

@krlmlr krlmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The "simple cycles" feature is the first commit in the C core that breaks the R package. Almost ready to tackle it.

@@ -3580,25 +3580,6 @@ find_cycle_impl <- function(graph, mode=c("out", "in", "all", "total")) {
res
}

simple_cycles_impl <- function(graph, mode=c("out", "in", "all", "total"), min.cycle.length=-1, max.cycle.length=-1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you see a downside in keeping this and making simple_cycles() a wrapper of this function?

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.

4 participants