-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
find the dual graph of a planar graph #6236
Comments
comment:1
just in case sagenb.org goes down, here is the code:
|
comment:2
This should be filed in "graph theory". |
comment:5
Hmm, I'm interested in this functionality, so if nobody else is planning on working on it, I would be up to it. It seems that the code given as an example only 'works' for 3-edge-connected simple planar graphs. Is this sufficient, or should we also try to make it work for other graphs? Supporting multigraphs might depend on #14657. |
comment:6
IIRC, the only case I was interested in was cubic planar graphs, and it seemed that there was a nice simplification in that case. Anyways, go for it! |
comment:7
Hi, I'm interested in this functionality too!
What do you mean by 'works'? I don't know enough graph theory to interpret the code above, but if someone could fix this to take care of all planar graphs, I could try to include it. |
comment:8
Fixing it to work for all plane graphs is not that simple. The problem lies not so much with this code as with the support for plane graphs in Sage. At the moment plane multigraphs are not supported, and I guess that also plane graphs with loops are not supported. If the input graph is not 3-edge-connected, then the dual will not be a simple plane graph, so no code will work for those graphs until we first add support for plane multigraphs and plane graphs with loops. |
comment:9
Ah, I see! Thanks for explaining the issue. Can we write a program to check for 3-edge-connectedness? If that is not too hard, then we can at least include the dual graph method for a large class of graphs (and many that other people are interested in). For graphs which fail that test, we can leave a |
comment:10
That is certainly doable, since that is already implemented. (At least I think so) At the moment I'm a bit swamped with work, but I'll have a look at it after next week. feel free to poke me if I forget it, or to have a look at it yourself. |
comment:11
But I just checked before writing the previous message! There's no |
comment:12
No, but there is a |
comment:13
Great, thanks! I'll use that. Should I create a new branch and add it to the graph methods in graph.py? What is a class of planar examples which are 3-edge-connected? I thought of grid graphs, but they fail. :( |
comment:14
The Platonic solids are 3-edge-connected. You need to have graphs with minimum degree at least 3, because otherwise deleting the edges incident to a vertex of minimum degree will disconnect the graph. Also have a look at the methods added by #16970. Creating a new branch and adding to the graph methods seems the best approach. Be sure to read the developers guide. |
comment:15
Meanwhile there is a function
Therefore my question: Is this ticket really still open or has it been implemented elsewhere? |
comment:16
I'm not aware of any such code in sagemath. So go for it. There are trivial speedup improvements for the |
comment:17
Some speedup improvements are implemented in #23630. It also raises questions regarding the expected output when the graph has a single vertex and for disconnected graphs. It might impact the |
Branch: u/moritz/planar_dual |
Commit: |
Author: Moritz Firsching |
comment:19
I added the method, avoiding the potential difficulties with multi-edges etc, by requiring the graph to be 3-connected. (Better to have it in these cases than nothing...) New commits:
|
comment:20
Why are you asking for 3-edge-connectivity ? If it's to prevent graphs with a cut-vertex, the requirement is not sufficient and actually the method is apparently working in this case.
We cannot get the dual of a 2d grid or a cycle. We really need a proper implementation of the decomposition into 3 connected components, or an interface with |
comment:21
Sorry, I got "edge-connected" confused with "vertex-connected" |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:23
Why 3 ? With 2-vertex-connected we could get the dual of cycles, grids, etc. Please change:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:25
Replying to @dcoudert:
Because then the dual will potentially have multiple edges. Take a square as an example: the dual graph has two vertices with 4 parallel edges.
done |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:27
Some comments:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:29
Thanks for the comments, David! I tried to work in the suggested imrovements. First I had tried to put |
comment:30
For me this ticket is good to go (tests, docbuild and display ok, etc.) |
Reviewer: David Coudert |
comment:31
Not sure if you inted to merge this, but without milestone it won't... |
comment:32
Right. Thank you. |
Changed branch from u/moritz/planar_dual to |
Working code is here: http://sagenb.org/home/pub/417/
The worksheet also includes code which lists the faces of a planar embedding of a graph.
CC: @sagetrac-brunellus @nvcleemp
Component: graph theory
Author: Moritz Firsching
Branch/Commit:
922b58b
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/6236
The text was updated successfully, but these errors were encountered: