Skip to content

Conversation

@kappybar
Copy link
Contributor

I changed the default algorithm to the faster one (and fixed the results of several tests) in

  • all_simple_cycles in cycle_enumeration.py (default algorithm is changed to 'B')
  • shortest_simple_paths in path_enumeration.pyx (default algorithm is changed to 'PNC')
  • nc_k_shortest_simple_paths in path_enumeration.pyx (default parameter postponed is changed to True)

I found two unimplemented features in all_cycles_iterator in cycle_enumeration.py when algorithm='B'. The features are the followings:

  • The algorithm 'B' is unavailable when starting_vertices is not None.
  • The algorithm 'B' is unavailable when rooted=True.

I rase errors when these happen.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@github-actions
Copy link

github-actions bot commented Oct 19, 2025

Documentation preview for this PR (built with commit daeb424; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@dcoudert
Copy link
Contributor

Some doctests are failing due to these changes.
See for instance
https://github.com/sagemath/sage/actions/runs/18623771139/job/53098552404?pr=41076#step:11:1057

Copy link
Contributor

@dcoudert dcoudert left a comment

Choose a reason for hiding this comment

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

LGTM.

vbraun pushed a commit to vbraun/sage that referenced this pull request Oct 26, 2025
sagemathgh-41076: change the default algorithm to the faster one in {path, cycle}_enumeration
    
I changed the default algorithm to the faster one (and fixed the results
of several tests) in

+ `all_simple_cycles` in `cycle_enumeration.py` (default algorithm is
changed to `'B'`)
+ `shortest_simple_paths` in `path_enumeration.pyx` (default algorithm
is changed to `'PNC'`)
+ `nc_k_shortest_simple_paths` in `path_enumeration.pyx` (default
parameter `postponed` is changed to `True`)

I found two unimplemented features in `all_cycles_iterator` in
`cycle_enumeration.py` when `algorithm='B'`. The features are the
followings:

+ The algorithm 'B' is unavailable when `starting_vertices` is not None.
+ The algorithm 'B' is unavailable when `rooted=True`.

I rase errors when these happen.


<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->



### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#41076
Reported by: Yuta Inoue
Reviewer(s): David Coudert
@vbraun vbraun merged commit 0b691f2 into sagemath:develop Oct 27, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants