sage
sage copied to clipboard
use decomposition into bi/tri-connected components and atoms for iterating over minimal separators
In #39341, we added an iterator over the minimal separators of a graph. Here we use decompositions into bi and tri connected components:
- We first decompose the graph into biconnected components. Cut vertices are minimal separators. We then search for the minimal separators of each biconnected component
- We then decompose each biconnected component into triconnected components. The "P" blocks of the SPQR-tree are minimal separators of order 2. The "S" blocks are cycle and each edge of its complement is a minimal separator. It remains to search for minimal separators in each "R" block (a triconnected component) using the main loop of the algorithm.
:memo: Checklist
- [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.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation preview.
:hourglass: Dependencies
Documentation preview for this PR (built with commit 2b83e7218e341d89a4a365fe45b7111b3130fd51; changes) is ready! :tada: This preview will update shortly after each push to this PR.
We can also use a decomposition of the graph by clique minimal separators. It then remains to consider the atoms of the graph.
@videlec, there is a doctest error involving linbox that has clearly nothing to do with this PR but that you are certainly able to understand / fix. See https://github.com/sagemath/sage/actions/runs/14124129591/job/39569516789?pr=39383#step:11:5414
Should we also make some variables explicit types (for speed)?
We could type some lists and sets, but I don't think that the gain will be noticeable here. The cost is in the functions we call.
The idea of using a decomposition into biconnected components, triconnected components and atoms and clique is to have the most costly part working on smaller graphs (the atoms) and to store less data. It remains a costly iterator.