Ticket #2271 (closed enhancement: fixed)
[with patch; massively positive review] Include Antti Ajanki's DLX library
| Reported by: | boothby | Owned by: | mhansen |
|---|---|---|---|
| Priority: | major | Milestone: | sage-2.10.3 |
| Component: | combinatorics | Keywords: | |
| Cc: | Work issues: | ||
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description (last modified by boothby) (diff)
The Dancing Links algorithm (DLX) is sweet. It solves the Exact Cover problem with the quickness.
Arguments for including Ajanki's code:
Attachments
Change History
comment:2 Changed 5 years ago by was
- Summary changed from Include Antti Ajanki's DLX library to [with patch; needs review] Include Antti Ajanki's DLX library
+1 to include this in Sage.
I haven't formally refereed it.
You should just attach a single plain text patch instead of an hg bundle.
comment:4 Changed 5 years ago by boothby
Oops, I forgot to add the functions to all.py, so the tests fail. New patch up in a few.
comment:5 Changed 5 years ago by rlm
- Summary changed from [with patch; needs review] Include Antti Ajanki's DLX library to [with patch; positive review pending documentation] Include Antti Ajanki's DLX library
This patch (although awesome) doesn't quite obey the new doctest-for-every-function rule, since the following functions do not have doctests:
- walknodes
- constructmatrix
- covercolumn
- uncovercolumn
- dosearch
- solve
comment:7 follow-up: ↓ 9 Changed 5 years ago by boothby
2271_doctests.patch implements world peace, washes your dishes, and makes coffee before your alarm goes off in the morning. It's truly amazing. Also, it contains doctests for everything in sight, reworks the DLXMatrix class to be a real python generator class, and implements an iterative formulation of DLX.
In the creation of these doctests, I have discovered a wondrous resolution of P vs. NP, but the proof was too long to justify appending to the patch.
comment:8 Changed 5 years ago by rlm
- Summary changed from [with patch; positive review pending documentation] Include Antti Ajanki's DLX library to [with patch; massively positive review] Include Antti Ajanki's DLX library
As well as a round of applause.
comment:9 in reply to: ↑ 7 Changed 5 years ago by mabshoff
Replying to boothby:
2271_doctests.patch implements world peace, washes your dishes, and makes coffee before your alarm goes off in the morning. It's truly amazing. Also, it contains doctests for everything in sight, reworks the DLXMatrix class to be a real python generator class, and implements an iterative formulation of DLX.
In the creation of these doctests, I have discovered a wondrous resolution of P vs. NP, but the proof was too long to justify appending to the patch.
I guess you should have written it in the margins :)
Cheers,
Michael
comment:10 Changed 5 years ago by mabshoff
- Status changed from new to closed
- Resolution set to fixed
Merged 2271_adds_DLX.patch and 2271_doctests.patch in Sage 2.10.3.alpha0 - w00t

