Refactor breakpoint graph functions - #62
Merged
Merged
Conversation
Renames the function "cycle_count" to "cycle_nontrivial_count". Adds a new "cycle_count" function that takes both trivial and non-trivial cycles into account.
Updates documentation related to breakpoint graph functions. Adds documentation related to the new function "cycle_nontrivial_count". The documentation has also been updated to clarify the distinction between trivial and non-trivial cycles and to specify which functions account for one or both types.
charles-plessy
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request renames the
cycle_countfunction tocycle_nontrivial_countand adds a newcycle_countfunction that counts both trivial and nontrivial cycles.Before this change,
inversionEstimate_BDincorrectly computed the expected number of inversions because it assumed thatcycle_countcounted all cycles in the breakpoint graph rather than only a specific type.With this change, the estimate correctly computes the expected number of inversions.
The documentation has also been updated to clarify this distinction.