You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sagemathgh-38762: Added a Tutte Embedding Layout for Graphs
<!-- ^ 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 "Fixessagemath#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, "Fixessagemath#12345". -->
Adds enhancement requested in sagemath#38410.
For 3-connected and planar graphs
(https://en.wikipedia.org/wiki/Polyhedral_graph), there exists an
embedding into
the plane called the Tutte embedding. In the Tutte embedding, an outer
face is set, and all other vertices are placed inside
the outer face such that they are at the mean position of their
neighbors.
(https://en.wikipedia.org/wiki/Tutte_embedding)
### 📝 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#38762
Reported by: Niccolo Turillo
Reviewer(s): David Coudert, Niccolo Turillo
option by_component : Whether to do the spring layout by connected component -- boolean.
21012
21012
option dim : The dimension of the layout -- 2 or 3.
21013
+
option external_face : A list of the vertices of the external face of the graph, used for Tutte embedding layout.
21014
+
option external_face_pos : A dictionary specifying the positions of the external face of the graph, used for Tutte embedding layout. If none specified, theexternal face is a regular polygon.
21013
21015
option forest_roots : An iterable specifying which vertices to use as roots for the ``layout='forest'`` option. If no root is specified for a tree, then one is chosen close to the center of the tree. Ignored unless ``layout='forest'``.
21014
21016
option heights : A dictionary mapping heights to the list of vertices at this height.
21015
21017
option iterations : The number of times to execute the spring layout algorithm.
0 commit comments