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
Planar graph layout does not respect clockwise ordering of neighbors in combinatorial embedding #28152
Comments
Author: Hendrik Schrezenmaier |
Commit: |
comment:3
A few stylistic comments. Recall that comments must be in 80 columns mode and that we do our best to follow the pep8 conventions. - TESTS::
-
- Check the dependence of the computed position on the given
- combinatorial embedding (:trac:`28152`).
+ TESTS:
+
+ Check the dependence of the computed position on the given
+ combinatorial embedding (:trac:`28152`):: - all triangles, and return the set of newly created edges. Also comb_emb
+ all triangles, and return the set of newly created edges. Also ``comb_emb`` pep8 - comb_emb[w].insert(comb_emb[w].index(x),u)
- comb_emb[u].insert(comb_emb[u].index(v),w)
+ comb_emb[w].insert(comb_emb[w].index(x), u)
+ comb_emb[u].insert(comb_emb[u].index(v), w) 80 columns mode - # Up to this point we did not take the order of the external face into account.
- # Since the combinatorial embedding of a triangulated is only unique up to
- # the choice of the outer face and reflection, this might lead to a reflection
- # of the Schnyder drawing resulting from this labeling which is not conformal
- # with comb_emb any longer. Therefore, we might have to swap the labels 1 and 2.
+ # Up to this point we did not take the order of the external face into
+ # account. Since the combinatorial embedding of a triangulation is unique
+ # up to the choice of the outer face and reflection, this might lead
+ # to a reflection of the Schnyder drawing resulting from this labeling which
+ # is not conformal with comb_emb any longer. Therefore, we might have to
+ # swap the labels 1 and 2. I also did minor changes in above text. Please check. Passes all tests with py3. I have not fully tested yet de functionality. |
comment:4
one failing doctest in src/sage/graphs/planarity.pyx, see patchbot report |
comment:6
Thanks for the effort so far. I suggest also to add a line of documentation, at least in |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:12
I fixed the pep8 and also fixed the bug that made the doctest fail. I also made the documentation more precise about which combinatorial embedding is used. But unfortunately it is not as rburing thought (and I think to be more intuitive, too) that |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:15
please review |
comment:16
I have only a minor comment. Otherwise seems ok. - for (v,w) in labels[u]:
- if labels[u][(v,w)] == 1:
- labels[u][(v,w)] = 2
- elif labels[u][(v,w)] == 2:
- labels[u][(v,w)] = 1
+ for v, w in labels[u]:
+ if labels[u][v, w] == 1:
+ labels[u][v, w] = 2
+ elif labels[u][v, w] == 2:
+ labels[u][v, w] = 1 |
Reviewer: David Coudert |
comment:18
OK, LGTM. |
Consider the claw S3:
The following combinatorial embedding is respected in the planar layout (the neighbors are in the given clockwise order):
While this one isn't:
In the latter, the neighbors are in the counterclockwise order (in fact the picture is the same as the former).
Strictly speaking,
layout_planar
(which is called bylayout
) does not promise to use the combinatorial embedding. But it does provide an optionon_embedding
which I assume should allow this:Still, the combinatorial embedding is not respected. I think this is because in
layout_planar
the lineG.is_planar(set_embedding=True)
executed unconditionally (totally ignoringon_embedding
).Component: graph theory
Keywords: planar, clockwise, embedding
Author: Hendrik Schrezenmaier
Branch/Commit:
b941f18
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/28152
The text was updated successfully, but these errors were encountered: