-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fix planarity #696
Fix planarity #696
Conversation
For some of the gap> D := CompleteDigraph(4);
<immutable complete digraph with 4 vertices>
gap> SubdigraphHomeomorphicToK4(D);
[ [ 2, 4, 3 ], [ 3, 4, 1 ], [ 4, 2, 1 ], [ 1, 2, 3 ] An alternative output could be: [ [ 2, 4, 3 ], [ 3, 4 ], [ 4 ], [ ] ] It is a question of whether the output should be thought of as a graph (because direction doesn't matter in the case of planarity) or a digraph (because we are in the digraphs package). I'm happy to change the behaviour to whatever seems the most appropriate, or to provide some more examples. |
Provided the tests pass, I think this is good to go @james-d-mitchell |
I've just noticed this: gap> IsPlanarDigraph(HanoiGraph(6));
true
gap> IsPlanarDigraph(DigraphMutableCopy(HanoiGraph(6)));
false Not sure what's going on, but this probably shouldn't happen. This behaviour exists in the main branch as well. Trying to fix now. |
I think this is a problem with |
Hmm that seems fishy, the return value shouldn't depend on whether or not the graph is mutable. |
@james-d-mitchell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor tweak and this is good to go
fda50e8
to
de62666
Compare
This PR addresses #669.
For planarity checking, the
edge-addition-planarity-suite
code needs its graphs to be antisymmetric. Previously, the antisymmetric digraph was constructed in GAP, and then the desired output was constructed in C. This meant that the C code couldn't reason about the user's input digraph, and hence only a minimal rotation system was returned.Now, the antisymmetric digraph is constructed in C, and the return list in constructed by checking the existence of edges in the user's original input graph.