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
Implement LexM traversal #28271
Comments
Changed branch from public/graphs/28271_implement_lexM to none |
Branch: u/gh-giorgosgiapis/lexM |
Changed branch from u/gh-giorgosgiapis/lexM to public/graphs/28271_implement_lexM |
Changed branch from public/graphs/28271_implement_lexM to none |
Commit: |
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:10
This implementation of lexM is far from OK but some comments and thoughts on the algorithm and the way it is implemented would be very helpful. |
comment:11
I think that this method should only work for undirected graphs since triangulation and tree decomposition are only meaningful in undirected graphs. Also, the |
comment:12
It's not easy to check the validity of the code. Can you comment it. I tried the algorithm and I doubt it is correct. For a PetersenGraph, the ordering is Also I don't like the way you manipulate strings. You could directly have string labels, no ? You should read the original paper by Rose, Tarjan and Luecker 1976 https://epubs.siam.org/doi/10.1137/0205021 . I have now a working implementation of the algorithms in sections 4 and 5.3. Both versions give same orders, but the one of section 5.3 is of course way faster. I'm not claiming the orders I produce are correct. Not easy to guess what the output should be. I will push my code to save you time, but before if want to understand what you did and if there is an error and where. So please add some comments. |
comment:13
Replying to @dcoudert:
The reason I didn't choose to have string labels in the first place is that the labels will be used for the tree decomposition later so strings would only make the parsing harder. Also, the conversion to string is needed if we want to use C++ queue.
The general idea is that when we assign a number to a vertex we start a BFS-like procedure from that vertex. In the queue, we are keeping two things: the vertex and the maximum label in the path from our initial vertex to this one. We take care of the case when a vertex is already numbered or examined earlier ( |
comment:14
What you want to do with this string is not correct. See the example below where the second label is larger than the first one (lexicographic order).
|
comment:15
I see now. I should find another way to do it. |
comment:16
Well, I found one solution:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:18
Do you have any examples with graphs and their corresponding LexM orderings to test my code? I could create some but if there are any verified examples it would help me a lot. |
comment:19
In the paper by Rose, Tarjan and Luecker, there is this graph |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:55
I did some corrections. Please check. I you agree, you can set to positive review on my behalf. |
comment:56
Seems OK. Let's wait for the Patchbot. If all tests pass I will set to positive review. |
comment:57
There is an error when building the html documentation. Could be - :meth:`~lex_M` | Return an ordering of the vertices of G according the LexM graph traversal.
+ :meth:`~GenericGraph.lex_M` | Return an ordering of the vertices of G according the LexM graph traversal. Please check |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:60
I suspect you have not even tried to build the documentation and check if it looks good... I have done several corrections. Please check. |
comment:61
I can't seem to get the documentation to build on my MacBook and I currently don't have access to my desktop. I will post to sage-devel about it. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:63
I have added exceptions for when |
comment:64
why using |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:66
Replying to @dcoudert:
You are right. Fixed! |
comment:67
You have again not tested your commit !!! - ValueError: 'foo' is not a graph vertex dad
+ ValueError: 'foo' is not a graph vertex and everywhere: - Traceback (most recent call last)
+ Traceback (most recent call last): |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:69
LGTM. |
Changed branch from public/graphs/28271_implement_lexM to |
The algorithm is described here: http://dept-info.labri.fr/~gavoille/article/DG07. Using this traversal we can approximate the tree-length of an arbitrary graph. The complexity of this algorithm will be O(nm) where n is the number of vertices and m the number of edges if implemented properly in Cython.
Component: graph theory
Keywords: gsoc19
Author: Georgios Giapitzakis Tzintanos
Branch/Commit:
aed4aac
Reviewer: David Coudert
Issue created by migration from https://trac.sagemath.org/ticket/28271
The text was updated successfully, but these errors were encountered: