Skip to content

Conversation

dcoudert
Copy link
Contributor

An issue has been raised (see #37028 (comment)) on the formulation used to find the longest (induced) cycle. This was due to the subtour elimination constraints that were not correct. We change these constraints to fix this issue. The new constraints force to use edges from the boundary of a subtour only when a vertex of that subtour is selected.

📝 Checklist

  • The title is concise, informative, and self-explanatory.
  • 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 accordingly.

⌛ Dependencies

Copy link

Documentation preview for this PR (built with commit ebb7584; changes) is ready! 🎉

Copy link
Collaborator

@tscrim tscrim left a comment

Choose a reason for hiding this comment

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

LGTM.

@dcoudert
Copy link
Contributor Author

Thank you for the review.

vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 29, 2024
sagemathgh-37181: Fix subtour elimination constraints in `longest_cycle`
    
An issue has been raised (see
sagemath#37028 (comment)) on
the formulation used to find the longest (induced) cycle. This was due
to the subtour elimination constraints that were not correct. We change
these constraints to fix this issue. The new constraints force to use
edges from the boundary of a subtour only when a vertex of that subtour
is selected.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#37181
Reported by: David Coudert
Reviewer(s): Travis Scrimshaw
vbraun pushed a commit to vbraun/sage that referenced this pull request Jan 30, 2024
An issue has been raised (see
sagemath#37028 (comment)) on
the formulation used to find the longest (induced) cycle. This was due
to the subtour elimination constraints that were not correct. We change
these constraints to fix this issue. The new constraints force to use
edges from the boundary of a subtour only when a vertex of that subtour
is selected.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->

URL: sagemath#37181
Reported by: David Coudert
Reviewer(s): Travis Scrimshaw
@vbraun vbraun merged commit 5a561ab into sagemath:develop Feb 2, 2024
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.

4 participants