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

DisjointSet() misses MakeSet method #35599

Closed
1 task done
maxale opened this issue May 2, 2023 · 0 comments · Fixed by #38692
Closed
1 task done

DisjointSet() misses MakeSet method #35599

maxale opened this issue May 2, 2023 · 0 comments · Fixed by #38692

Comments

@maxale
Copy link
Contributor

maxale commented May 2, 2023

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Problem Description

According to documentation, DisjointSet() supports only two operations .find() and .union().

Proposed Solution

Add support for the operation of adding a new element (forming its own singleton set), which is referred to as MakeSet() operation in Wikipedia.

Alternatives Considered

N/A

Additional Information

No response

vbraun pushed a commit to vbraun/sage that referenced this issue Sep 27, 2024
    
<!-- ^ 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". -->

This fixes sagemath#35599  by adding a `make_set` function to `DisjointSet`
using `OrbitPartitions`. The documentation links to wikipedia.
From wikipedia, the method should be done in place and therefore there
is no return

### 📝 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.
- [x] 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: ... -->

sagemath#35599
    
URL: sagemath#38692
Reported by: Aram Dermenjian
Reviewer(s): Aram Dermenjian, David Coudert
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 28, 2024
    
<!-- ^ 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". -->

This fixes sagemath#35599  by adding a `make_set` function to `DisjointSet`
using `OrbitPartitions`. The documentation links to wikipedia.
From wikipedia, the method should be done in place and therefore there
is no return

### 📝 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.
- [x] 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: ... -->

sagemath#35599
    
URL: sagemath#38692
Reported by: Aram Dermenjian
Reviewer(s): Aram Dermenjian, David Coudert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants