-
-
Notifications
You must be signed in to change notification settings - Fork 528
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
Modular decomposition bug #25872
Comments
comment:1
That's certainly not an easy issue to fix. I have not clue what's going on :( |
comment:2
I don't know if this helps, but I was cross-checking #25763 and it seems that the bug is not visible with
where |
comment:3
I tried other labelings of the graph and its working correctly when the first vertex of
With 'G2', the construction starts from vertex 0 that should be in a parallel node
|
Commit: |
comment:5
I have pushed the changes which were required to fix the bug. The change required was to remove the is_separated field from Node class in modular_decomposition.py. It removes the optimization which was causing the bug. New commits:
|
comment:6
Thank you Lokesh. You must add the following tests to the TESTS block of method
|
comment:7
Still doesn't work.
Found by
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:9
Replying to @jm58660:
Thanks for posting the example. Let me take a look. |
comment:10
A few questions. Would it be of use to add an Should we move In the testing section of |
comment:11
This is a very good idea to add another algorithm and the parameter It is possible to move the file to |
comment:12
I added trac #26496. The code there should be functional if you add |
comment:13
see also #33902 How about removing |
This comment has been minimized.
This comment has been minimized.
comment:14
I can only agree with that. The code is buggy and I don't know how to fix that. |
comment:15
OK, I'll try doing this. |
comment:16
We can at least start with a deprecation warning. |
Changed branch from u/jlokesh/modular_decomposition_bug to u/dimpase/graphs/remove_tedder_modular_decomposition |
Author: Dima Pasechnik |
New commits:
|
comment:23
We should certainly update the ticket description to reflect the removal. |
This comment has been minimized.
This comment has been minimized.
comment:25
This breaks existing code |
comment:26
So what should we do ? deprecate this option before removing tedder in a year ? remove tedder now and let this parameter even if unused with a deprecation ? something else ? |
comment:27
Just make it so that passing |
comment:28
The problem is, however, not limited to this, as there is also a I think it's too much fuss to fiddle around with deprecations here. |
comment:29
Just don't make these breaking API changes:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed reviewer from David Coudert to David Coudert, Matthias Koeppe |
comment:32
LGTM, thanks. |
Changed branch from u/dimpase/graphs/remove_tedder_modular_decomposition to |
Changed commit from |
This comment has been minimized.
This comment has been minimized.
… modular decomposition <!-- ^ 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 "Fixes sagemath#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, "Fixes sagemath#12345". --> This PR implements the recursive, linear-time algorithm to compute the modular decomposition of simple undirected graphs from [TCHP2008](https://arxiv.org/pdf/0710.3901). A previous implementation was introduced in version 9.7 but was removed after some bugs were discovered (see sagemath#25872 for exemple). This implementation is based on an updated version of the article and is intensively tested. This PR contains: - a implementation in C++ of the algorithm (in the file `graph_decompositions/modular_decomposition.hpp`) and the corresponding interface file `graph_decompositions/modular_decomposition.pxd` - a small reorganization of the method `modular_decomposition` of the class Graph: this method now accept a parameter `algorithm` (that can be 'habib_maurer' for the previous algorithm, or 'corneil_habib_paul_tedder' for the new one, which is the default value), it then call the function `modular_decomposition` from `graph_decompositions/modular_decomposition.pyx` which dispatch the call to the correct function (`habib_maurer_algorithm` or ` corneil_habib_paul_tedder_algorithm`) - a new parameter `algorithm` for the `is_prime` method (which is passed directly to the `modular_decomposition` method) - a new `is_module` method for the Graph class - a small clean up of the file `graph_decompositions/modular_decomposition.pyx` to remove unused field of the `Node` class and useless functions. - a new `prime_node_generator` parameter for the `md_tree_to_graph` (used for generating modular decomposition tree for tests) In this PR, I did not change the output of the `modular_decomposition` method to keep the changes to a minimum. If this PR is accepted, I intend to do it in another PR. The goal would be to return a object that contains all the information of the modular decomposition tree: currently the two formats for the output have no information for the prime graph corresponding to prime nodes. It can be computed from the output of the new algorithm but this information is lost during the conversion to one of the output format of the method `modular_decomposition`. ### 📝 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. - [x] 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#39038 Reported by: cyrilbouvier Reviewer(s): cyrilbouvier, David Coudert
… modular decomposition <!-- ^ 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 "Fixes sagemath#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, "Fixes sagemath#12345". --> This PR implements the recursive, linear-time algorithm to compute the modular decomposition of simple undirected graphs from [TCHP2008](https://arxiv.org/pdf/0710.3901). A previous implementation was introduced in version 9.7 but was removed after some bugs were discovered (see sagemath#25872 for exemple). This implementation is based on an updated version of the article and is intensively tested. This PR contains: - a implementation in C++ of the algorithm (in the file `graph_decompositions/modular_decomposition.hpp`) and the corresponding interface file `graph_decompositions/modular_decomposition.pxd` - a small reorganization of the method `modular_decomposition` of the class Graph: this method now accept a parameter `algorithm` (that can be 'habib_maurer' for the previous algorithm, or 'corneil_habib_paul_tedder' for the new one, which is the default value), it then call the function `modular_decomposition` from `graph_decompositions/modular_decomposition.pyx` which dispatch the call to the correct function (`habib_maurer_algorithm` or ` corneil_habib_paul_tedder_algorithm`) - a new parameter `algorithm` for the `is_prime` method (which is passed directly to the `modular_decomposition` method) - a new `is_module` method for the Graph class - a small clean up of the file `graph_decompositions/modular_decomposition.pyx` to remove unused field of the `Node` class and useless functions. - a new `prime_node_generator` parameter for the `md_tree_to_graph` (used for generating modular decomposition tree for tests) In this PR, I did not change the output of the `modular_decomposition` method to keep the changes to a minimum. If this PR is accepted, I intend to do it in another PR. The goal would be to return a object that contains all the information of the modular decomposition tree: currently the two formats for the output have no information for the prime graph corresponding to prime nodes. It can be computed from the output of the new algorithm but this information is lost during the conversion to one of the output format of the method `modular_decomposition`. ### 📝 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. - [x] 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#39038 Reported by: cyrilbouvier Reviewer(s): cyrilbouvier, David Coudert
… modular decomposition <!-- ^ 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 "Fixes sagemath#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, "Fixes sagemath#12345". --> This PR implements the recursive, linear-time algorithm to compute the modular decomposition of simple undirected graphs from [TCHP2008](https://arxiv.org/pdf/0710.3901). A previous implementation was introduced in version 9.7 but was removed after some bugs were discovered (see sagemath#25872 for exemple). This implementation is based on an updated version of the article and is intensively tested. This PR contains: - a implementation in C++ of the algorithm (in the file `graph_decompositions/modular_decomposition.hpp`) and the corresponding interface file `graph_decompositions/modular_decomposition.pxd` - a small reorganization of the method `modular_decomposition` of the class Graph: this method now accept a parameter `algorithm` (that can be 'habib_maurer' for the previous algorithm, or 'corneil_habib_paul_tedder' for the new one, which is the default value), it then call the function `modular_decomposition` from `graph_decompositions/modular_decomposition.pyx` which dispatch the call to the correct function (`habib_maurer_algorithm` or ` corneil_habib_paul_tedder_algorithm`) - a new parameter `algorithm` for the `is_prime` method (which is passed directly to the `modular_decomposition` method) - a new `is_module` method for the Graph class - a small clean up of the file `graph_decompositions/modular_decomposition.pyx` to remove unused field of the `Node` class and useless functions. - a new `prime_node_generator` parameter for the `md_tree_to_graph` (used for generating modular decomposition tree for tests) In this PR, I did not change the output of the `modular_decomposition` method to keep the changes to a minimum. If this PR is accepted, I intend to do it in another PR. The goal would be to return a object that contains all the information of the modular decomposition tree: currently the two formats for the output have no information for the prime graph corresponding to prime nodes. It can be computed from the output of the new algorithm but this information is lost during the conversion to one of the output format of the method `modular_decomposition`. ### 📝 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. - [x] 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#39038 Reported by: cyrilbouvier Reviewer(s): cyrilbouvier, David Coudert
#24898 was not enough.
This ticket removes
'tedder'
implementation, as buggy unfixable abandonware (see #33902 for another example of a bug);the
algorithm=
option is made into a no-op, to be removed after the deprecation period, as we only have one implementation now.CC: @lokeshj1703 @dimpase @dcoudert @deinst
Component: graph theory
Author: Dima Pasechnik
Branch:
f610e5a
Reviewer: David Coudert, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/25872
The text was updated successfully, but these errors were encountered: