Skip to content
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

graphs: add implementation of slice decomposition via an extended LexBFS algorithm #38299

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7c8f8d2
graphs: add implementation of slice decomposition via extended LexBFS
cyrilbouvier Jun 28, 2024
bca274e
Fix typo: EXAMPLES instead of EXAMPLE
cyrilbouvier Jun 28, 2024
62ff2b7
Fix errors detected by linter
cyrilbouvier Jun 28, 2024
86a9a78
Trying to fix failing tests with latex repr (by copying graph_latex.py)
cyrilbouvier Jun 28, 2024
efae289
EXAMPLES: -> EXAMPLES::
cyrilbouvier Jul 2, 2024
805d899
PEP 0008: at least two spaces before #
cyrilbouvier Jul 2, 2024
201cbff
graphs: break up first paragraph of docstring of extended_LEX_BFS
cyrilbouvier Jul 2, 2024
2d5002f
docstring of extended_LEX_BFS: detail on the case initial_v_int=-1
cyrilbouvier Jul 2, 2024
8ffab78
Remove unnecessary empty lines and add needed one
cyrilbouvier Jul 2, 2024
bef41c8
Partial revert of efae289c: EXAMPLES: -> EXAMPLES::
cyrilbouvier Jul 2, 2024
474c551
Use LaTeX in docstring of graphs.traversals module
cyrilbouvier Jul 2, 2024
f7ad61f
graphs.traversals: write function definition on one line
cyrilbouvier Jul 2, 2024
7c0b21e
graphs.traversals: remove extra spaces in dict declaration
cyrilbouvier Jul 2, 2024
a589d2c
slice_decomposition: add 1 line description for _latex_
cyrilbouvier Jul 2, 2024
1fbb00e
slice_decomposition: add space in output of _repr_, add docstring
cyrilbouvier Jul 2, 2024
f3d502e
slice_decomposition: declare types of some variables
cyrilbouvier Jul 2, 2024
9ae7edb
slice_decomposition: remove extra space before ( in function declaration
cyrilbouvier Jul 2, 2024
306c325
slice_decomposition: add one line description for __eq__
cyrilbouvier Jul 2, 2024
fbf7256
slice_decomposition: add one line description + tests for __hash__
cyrilbouvier Jul 2, 2024
5b263e4
slice_decomposition: add indirect doctests for internal methods
cyrilbouvier Jul 2, 2024
c78eb04
slice_decomposition: improve docstring of underlying_graph method
cyrilbouvier Jul 3, 2024
3b428a6
slice_decomposition: more doc
cyrilbouvier Jul 3, 2024
0620a98
slice_decomposition: TESTS: => TESTS::
cyrilbouvier Jul 4, 2024
add4fbc
slice_decomposition: remove empty lines
cyrilbouvier Jul 4, 2024
9ad0dab
graphs.traversals: postpone import of DiGraph
cyrilbouvier Jul 4, 2024
ce3cd9f
graphs.traversals: rename l (for clarity) and set increment on a var
cyrilbouvier Jul 4, 2024
a477740
slice_decomposition: improve message of exception for directed graphs
cyrilbouvier Jul 4, 2024
8704ded
Merge branch 'develop' into add-slice-decomposition-of-graphs
cyrilbouvier Jul 25, 2024
3adb946
graphs/traversals.pyx: fix lint error
cyrilbouvier Jul 25, 2024
5f0219f
graphs/traversals.pyx: fix indent in docstrings
cyrilbouvier Jul 25, 2024
c53ffac
Merge branch 'develop' into add-slice-decomposition-of-graphs
cyrilbouvier Sep 4, 2024
2e55874
graphs: slice_decomposition.pyx: Typo in comments
cyrilbouvier Sep 5, 2024
7f6cc5e
graphs: slice_decomposition: fix a bug with latex repr (missing $)
cyrilbouvier Sep 5, 2024
0d26f30
graphs: slice decomposition: replace doctest for __hash__
cyrilbouvier Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/doc/en/reference/graphs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Libraries of algorithms
sage/graphs/graph_decompositions/bandwidth
sage/graphs/graph_decompositions/cutwidth
sage/graphs/graph_decompositions/graph_products
sage/graphs/graph_decompositions/slice_decomposition
sage/graphs/graph_decompositions/modular_decomposition
sage/graphs/graph_decompositions/clique_separators
sage/graphs/convexity_properties
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6405,7 +6405,7 @@ REFERENCES:

.. [TCHP2008] Marc Tedder, Derek Corneil, Michel Habib and Christophe Paul,
*Simple, linear-time modular decomposition*, 2008.
:arxiv:`0710.3901`.
:arxiv:`0710.3901v3`.

.. [Tee1997] Tee, Garry J. "Continuous branches of inverses of the 12
Jacobi elliptic functions for real
Expand Down
1 change: 1 addition & 0 deletions src/sage/graphs/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -10200,6 +10200,7 @@ def bipartite_double(self, extended=False):
from sage.graphs.graph_decompositions.clique_separators import atoms_and_clique_separators
from sage.graphs.graph_decompositions.bandwidth import bandwidth
from sage.graphs.graph_decompositions.cutwidth import cutwidth
from sage.graphs.graph_decompositions.slice_decomposition import slice_decomposition
matching_polynomial = LazyImport('sage.graphs.matchpoly', 'matching_polynomial', at_startup=True)
from sage.graphs.cliquer import all_max_clique as cliques_maximum
from sage.graphs.cliquer import all_cliques
Expand Down
17 changes: 17 additions & 0 deletions src/sage/graphs/graph_decompositions/slice_decomposition.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from libcpp.vector cimport vector

from sage.structure.sage_object cimport SageObject
from sage.graphs.base.c_graph cimport CGraph

cdef void extended_lex_BFS(
CGraph cg, vector[int] &sigma, vector[int] *sigma_inv,
int initial_v_int, vector[int] *pred, vector[size_t] *xslice_len,
vector[vector[int]] *lex_label) except *

cdef class SliceDecomposition(SageObject):
cdef tuple sigma
cdef dict sigma_inv
cdef vector[size_t] xslice_len
cdef dict lex_label
cdef object _graph_class
cdef object _underlying_graph
Loading
Loading