sage icon indicating copy to clipboard operation
sage copied to clipboard

use decomposition into bi/tri-connected components and atoms for iterating over minimal separators

Open dcoudert opened this issue 10 months ago • 3 comments

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

dcoudert avatar Jan 27 '25 08:01 dcoudert

Documentation preview for this PR (built with commit 2b83e7218e341d89a4a365fe45b7111b3130fd51; changes) is ready! :tada: This preview will update shortly after each push to this PR.

github-actions[bot] avatar Jan 27 '25 11:01 github-actions[bot]

We can also use a decomposition of the graph by clique minimal separators. It then remains to consider the atoms of the graph.

dcoudert avatar Feb 10 '25 12:02 dcoudert

@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

dcoudert avatar Mar 28 '25 10:03 dcoudert

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.

dcoudert avatar Nov 12 '25 16:11 dcoudert