Skip to content

Updated methods concerning addition of edges in a matching covered graph #39763

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

Merged
merged 11 commits into from
May 18, 2025

Conversation

janmenjayap
Copy link
Contributor

The objective of this issue is to update the methods concerning addition of edges in a matching covered graph.

More specifically, this PR aims to updated the following methods:

  • add_edges() | Add edges from an iterable container.

Please note that earlier this method used to add only one multiple edge, even though the container contains several of those.

Fixes #38216.
Note that this issue fixes a small part of the mentioned issue.

📝 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

Nothing as of now.

cc: @dcoudert.

Copy link

github-actions bot commented Mar 23, 2025

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

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.

I think it would be better to feed a new list of edges in which you add (u, v, None) or (u, v, label) unless u == v. This way you avoid the costly edges.remove(edge) operation.

Also, I'm not sure why you add the edges to the graph if it already have all of them.

@janmenjayap
Copy link
Contributor Author

If the graph has already those edges, the it's a multiple-edge addition, this can be done directly without the check for whether the edge participates in some perfect matching or not.

But if that's not the case, then we need to check if collectively the addition of all the edges, each of them participates in some perfect matching or not (the perfect matching may be different than the existing perfect matching depending on whether the edges in input introduce new vertices or not).

@dcoudert
Copy link
Contributor

It seems ok, but I'm not sure if you plan to do further changes in this PR. Let me know.

@janmenjayap
Copy link
Contributor Author

Currently, there is no plan for any further changes in this PR; @dcoudert.
We may merge this PR.

Thank you.

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.

@janmenjayap
Copy link
Contributor Author

Thank you.

@vbraun vbraun merged commit 53eb914 into sagemath:develop May 18, 2025
12 of 19 checks passed
@janmenjayap janmenjayap deleted the edge_addition branch May 19, 2025 13:03
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.

On Decompositions, Generation Methods and related concepts in the theory of Matching Covered Graphs
3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy