Skip to content

Conversation

GermainPoullot
Copy link
Contributor

Added a class to enumerate all acyclic orientations of a graph.

Added class AcyclicOrientations and a method .acyclic_orientations in graphs.graph.
The method just call the class.

The algorithm is non trivial: backtracks through the orientations of the graph without go through all of them.

Solve ticket #22468, I think (I'm not use to trac, feel free to explain me how it works)?

📝 Checklist

  • I have made sure that the title is self-explanatory and the description concisely explains the PR.
  • I have linked an issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation accordingly.

⌛ Dependencies

This class enumerate all acyclic orientations of a (di)graph.
Added the method to call it in graph.
@mantepse
Copy link
Contributor

There is already a module orientations.py, maybe your functionality fits in there nicely?

@codecov-commenter
Copy link

Codecov Report

Base: 88.60% // Head: 88.57% // Decreases project coverage by -0.03% ⚠️

Coverage data is based on head (94f4f10) compared to base (698001b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #35075      +/-   ##
===========================================
- Coverage    88.60%   88.57%   -0.03%     
===========================================
  Files         2136     2136              
  Lines       396141   396206      +65     
===========================================
- Hits        351009   350959      -50     
- Misses       45132    45247     +115     
Impacted Files Coverage Δ
src/sage/graphs/graph.py 93.79% <100.00%> (+0.01%) ⬆️
src/sage/graphs/orientations.py 98.63% <100.00%> (+0.95%) ⬆️
src/sage/misc/banner.py 72.97% <0.00%> (-14.87%) ⬇️
src/sage/interfaces/qsieve.py 71.30% <0.00%> (-2.61%) ⬇️
src/sage/doctest/forker.py 80.24% <0.00%> (-1.75%) ⬇️
src/sage/modular/local_comp/liftings.py 98.33% <0.00%> (-1.67%) ⬇️
src/sage/schemes/elliptic_curves/hom_frobenius.py 96.34% <0.00%> (-1.22%) ⬇️
src/sage/schemes/elliptic_curves/hom_velusqrt.py 94.09% <0.00%> (-1.19%) ⬇️
src/sage/graphs/generic_graph.py 88.52% <0.00%> (-1.08%) ⬇️
src/sage/modular/hecke/algebra.py 94.65% <0.00%> (-1.07%) ⬇️
... and 24 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@dcoudert
Copy link
Contributor

Could you describe the algorithm you are implementing and give a reference (if any).

Algorithm 4 of 10.1016/j.dam.2017.08.002 should not be difficult to implement and it seems rather efficient.

@videlec
Copy link
Contributor

videlec commented Mar 2, 2023

Could you describe the algorithm you are implementing and give a reference (if any).

Algorithm 4 of 10.1016/j.dam.2017.08.002 should not be difficult to implement and it seems rather efficient.

Maybe also 10.1006/jagm.1997.0891 which seems to have a reasonable amortized delay?

vbraun pushed a commit to vbraun/sage that referenced this pull request Feb 11, 2024
sagemathgh-37272: enable the generation of acyclic orientations with `nauty_directg`
    
Since version 2.8, nauty's `directg` has a new option `-a`  to generate
only acyclic orientations. This option was already working but not
documented. This PR documents this functionality.

This partially answer issue sagemath#37253 and is related to PR sagemath#35075.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [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 accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#37272
Reported by: David Coudert
Reviewer(s): Martin Rubey
@dcoudert
Copy link
Contributor

Now that #37345 has been merged, may be we can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants