Skip to content

Improve method is_planar - #36021

Merged
vbraun merged 12 commits into
sagemath:developfrom
dcoudert:graphs/issue35152_planarity
Sep 10, 2023
Merged

vbraun merged 12 commits into
sagemath:developfrom
dcoudert:graphs/issue35152_planarity

Conversation

@dcoudert

@dcoudert dcoudert commented Aug 2, 2023

Copy link
Copy Markdown
Collaborator

Fixes #35152.

We improve the method to avoid working with embeddings when the input (di)graph has multiple edges or loops, or when the input digraph has pairs of opposite arcs. In these cases, the notion of embedding is not consistently defined so far as it mixes neighbors and incident edges.

We now allow to set positions whenever embeddings are not involved.

We also avoid modifying the input graph in method is_planar from planarity.pyx and reorder some operations.

📝 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

Comment thread src/sage/graphs/planarity.pyx Resolved
@dcoudert

Copy link
Copy Markdown
Collaborator Author

ping

@dcoudert
dcoudert requested review from videlec and removed request for videlec September 2, 2023 08:03
@dcoudert
dcoudert requested a review from tscrim September 9, 2023 08:26

@tscrim tscrim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, but could you make one small tweak to the error message outputs and put one extra space on the second line after the break; e.g.,

NotImplementedError: a really long
 doctest output line

Once done, you can set a positive review.

@dcoudert

dcoudert commented Sep 9, 2023

Copy link
Copy Markdown
Collaborator Author

Thank you for the review.

@github-actions

github-actions Bot commented Sep 9, 2023

Copy link
Copy Markdown

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

@vbraun
vbraun merged commit 754e88a into sagemath:develop Sep 10, 2023
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.

RuntimeError in Graph.is_planar for some directed graphs with allow_multiple_edges set

5 participants