<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Dancing links · HackerPapers discussions</title><link>https://hackerpaper.kaipfister.de/p/cs_0011047/</link><description>Collected HN comments and submissions linking this paper.</description><language>en</language><lastBuildDate>Mon, 02 Nov 2026 11:16:22 GMT</lastBuildDate><atom:link href="https://hackerpaper.kaipfister.de/p/cs_0011047/feed.xml" rel="self" type="application/rss+xml" /><item><title>Dancing links — mentioned by csense</title><link>https://news.ycombinator.com/item?id=49902546</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:49902546</guid><pubDate>Wed, 30 Sep 2026 00:00:55 GMT</pubDate><description>&lt;p&gt;Reinventing the wheel is not always to be avoided. Finding an interesting wheel and trying to build your own equivalent can be an excellent way to improve your skills as a programmer [1]. &amp;quot;Feed it to SAT solver&amp;quot; is a super useful technique every seasoned programmer should have in their toolbelt. If you want to improve your programming skill, I suggest implementing your own version of these two interesting, satisfying algorithms: - DPLL, the classic general-purpose SAT solving algorithm [3]. - Algorithm X (aka Dancing Links), Knuth&amp;#x27;s super elegant search algorithm for solving exact cover…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by ventana</title><link>https://news.ycombinator.com/item?id=49260415</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:49260415</guid><pubDate>Tue, 11 Aug 2026 16:06:48 GMT</pubDate><description>&lt;p&gt;&amp;gt; I implemented branching and backtracking The solvers they describe are indeed based on depth-first search and backtracking; in Python, the backtracking part involves some copying: for v in cands: new_board = [row[:] for row in board] new_board[i][j] = v solved = solve(new_board) For anyone interested in solving sudokus, I recommend reading Knuth&amp;#x27;s Dancing Links paper [1] and implement sudoku solver as an exact cover problem. The idea is to completely get rid of copying the state, switching the pointers of doubly linked lists instead, which speeds up the backtracking part a lot. It&amp;#x27;s a…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by OskarS</title><link>https://news.ycombinator.com/item?id=45317044</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:45317044</guid><pubDate>Sat, 20 Sep 2025 20:20:04 GMT</pubDate><description>&lt;p&gt;Indeed it is, and Donald Knuth spends a substantial part of the latest volume (4B) of The Art of Computer Programming on solving exact cover problems like this using Dancing Links! He presented an earlier version of the algorithm in this legendary article [1], but as good as that article is, the book is even better (and the algorithm improved!). It also has tons of exercises like this. Cannot recommend it highly enough. [1]: https://arxiv.org/abs/cs/0011047&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by mangodrunk</title><link>https://news.ycombinator.com/item?id=42979259</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:42979259</guid><pubDate>Sat, 08 Feb 2025 00:52:50 GMT</pubDate><description>&lt;p&gt;Is this the paper? https://arxiv.org/abs/cs/0011047&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by csense</title><link>https://news.ycombinator.com/item?id=38151691</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:38151691</guid><pubDate>Sun, 05 Nov 2023 15:02:33 GMT</pubDate><description>&lt;p&gt;Neat! Now implement a solver using Knuth&amp;#x27;s famous Dancing Links algorithm [1]. [1] https://arxiv.org/abs/cs/0011047&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by sprawld</title><link>https://news.ycombinator.com/item?id=33480470</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:33480470</guid><pubDate>Sat, 05 Nov 2022 11:33:56 GMT</pubDate><description>&lt;p&gt;Donald Knuth&amp;#x27;s Dancing Links paper is a beautiful exploration of the power of linked lists. He uses a table with doubly linked lists (for rows and cols) to solve omino tiling. The linked lists allow for an elegant unpicking of rows (and re-attaching when backtracking) The paper&amp;#x27;s a really enjoyable read, Knuth&amp;#x27;s tone throughout is &amp;quot;look at this, this is fun&amp;quot; https://arxiv.org/abs/cs/0011047&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — HN submission</title><link>https://news.ycombinator.com/item?id=27749212</link><guid isPermaLink="false">urn:hackerpapers:submission:cs_0011047:27749212</guid><pubDate>Tue, 06 Jul 2021 14:37:42 GMT</pubDate><description>&lt;p&gt;Dancing links – Donald Knuth (2000) [pdf]&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;1 point; 0 discussion replies on HN. &lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and source history&lt;/a&gt;. A submission is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by dragontamer</title><link>https://news.ycombinator.com/item?id=26436817</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:26436817</guid><pubDate>Fri, 12 Mar 2021 15:28:56 GMT</pubDate><description>&lt;p&gt;Knuth&amp;#x27;s Dancing Links is originally from 2001, and was first published to book form in Fasicle 6 (2019). Dancing Links seems to have outstanding performance for a generic cover problem, even on modern cache heavy processors. It seems like the static layout of the links benefits greatly from cache locality. Seriously, study the algorithm before hating on it. EDIT: Knuth&amp;#x27;s original writing style may be &amp;quot;too mathematical&amp;quot; for some. Here&amp;#x27;s a dumbed down version: https://medium.com/javarevisited/building-a-sudoku-solver-in... The original Knuth: https://arxiv.org/abs/cs/0011047 The 2001 code is…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by carapace</title><link>https://news.ycombinator.com/item?id=25741234</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:25741234</guid><pubDate>Tue, 12 Jan 2021 01:49:28 GMT</pubDate><description>&lt;p&gt;&amp;gt; certain algorithms are more intuitive if implemented imperatively. FWIW, &amp;quot;Dancing Links&amp;quot; is a wonderful technique that would be worse than pointless in an immutable language. https://arxiv.org/pdf/cs/0011047.pdf&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by pge</title><link>https://news.ycombinator.com/item?id=20880382</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:20880382</guid><pubDate>Wed, 04 Sep 2019 19:07:23 GMT</pubDate><description>&lt;p&gt;On a related note, Knuth has a cool algorithm to solve exact coverage problems like sudoku (similar logic as Norvig&amp;#x27;s DFS but implemented very differently). It&amp;#x27;s more work to code it than Norvig&amp;#x27;s but worth it for the education:) (and it solves faster) Here&amp;#x27;s the paper describing the algorithm: https://arxiv.org/pdf/cs/0011047.pdf&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — HN submission</title><link>https://news.ycombinator.com/item?id=18669790</link><guid isPermaLink="false">urn:hackerpapers:submission:cs_0011047:18669790</guid><pubDate>Thu, 13 Dec 2018 04:10:01 GMT</pubDate><description>&lt;p&gt;Don Knuth: Dancing Links&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;3 points; 1 discussion reply on HN. &lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and source history&lt;/a&gt;. A submission is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by carapace</title><link>https://news.ycombinator.com/item?id=18236720</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:18236720</guid><pubDate>Wed, 17 Oct 2018 06:50:04 GMT</pubDate><description>&lt;p&gt;Dancing Links (Knuth&amp;#x27;s paper: https://arxiv.org/pdf/cs/0011047.pdf ) &amp;gt; In computer science, dancing links is the technique suggested by Donald Knuth to efficiently implement his Algorithm X. Algorithm X is a recursive, nondeterministic, depth-first, backtracking algorithm that finds all solutions to the exact cover problem. Some of the better-known exact cover problems include tiling, the n queens problem, and Sudoku. ~ https://en.wikipedia.org/wiki/Dancing_Links Also SEQUITUR http://www.sequitur.info/ &amp;gt; Sequitur (or Nevill-Manning algorithm) is a recursive algorithm developed by Craig…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by johnsonjo</title><link>https://news.ycombinator.com/item?id=16036588</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:16036588</guid><pubDate>Sat, 30 Dec 2017 18:28:02 GMT</pubDate><description>&lt;p&gt;I found Knuth’s “Dancing Links” paper [1] very well written and a somewhat easy read (I had to reread certain parts a couple times). I had to write a sudoku solver for one of my classes and I read that dancing links and algorithm x was one way to do it [2]. I then read some things around the internet to apply dancing links to sudoku solving [3] [4]. If you read the Wikipedia entry on exact cover problems there is a section on sudoku as an exact cover problem [5] this is one thing necessary to understand in order to implement a sudoku solver with algorithm x and dancing links. Knuth even talks…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by ChrisLomont</title><link>https://news.ycombinator.com/item?id=9847515</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:9847515</guid><pubDate>Tue, 07 Jul 2015 19:21:37 GMT</pubDate><description>&lt;p&gt;Interestingly, when I run this through an old Dancing Links [1] based solver I wrote a while back for solving general puzzles, it solves the first one in 0.04 seconds, uses 65 columns, 242 rows, does 181510 de-queues, and finds a unique solution. The same solver on the hard version runs in 0.01 seconds, 67 columns, 272 rows, 245626 de-queues, and finds no solutions. So as others have noted, the hard puzzle solution must be some weird rotation, and/or not spaced on &amp;quot;integral&amp;quot; coordinates. Since I don&amp;#x27;t have time to write such a solver, I will leave it for now :) Note: if you have not looked at…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by h_a</title><link>https://news.ycombinator.com/item?id=8871457</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:8871457</guid><pubDate>Sun, 11 Jan 2015 21:46:32 GMT</pubDate><description>&lt;p&gt;Reminds me of Knuth&amp;#x27;s Dancing Links algorithm: http://arxiv.org/pdf/cs/0011047.pdf&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — HN submission</title><link>https://news.ycombinator.com/item?id=6230682</link><guid isPermaLink="false">urn:hackerpapers:submission:cs_0011047:6230682</guid><pubDate>Sat, 17 Aug 2013 23:01:46 GMT</pubDate><description>&lt;p&gt;Knuth&amp;#x27;s Dancing Links Algorithm&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;2 points; 0 discussion replies on HN. &lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and source history&lt;/a&gt;. A submission is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by relaunched</title><link>https://news.ycombinator.com/item?id=5638815</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:5638815</guid><pubDate>Wed, 01 May 2013 16:09:54 GMT</pubDate><description>&lt;p&gt;Dancing Links - Donald Knuth - http://arxiv.org/abs/cs/0011047 Lots of fun and is a weekender, but you can expand it to solve anything from sudoku to all kinds of tiling problems. David Goodger&amp;#x27;s webpage, http://puzzler.sourceforge.net/, solves all sorts of polyform puzzles using DLX algorithm.&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — mentioned by Someone</title><link>https://news.ycombinator.com/item?id=5208468</link><guid isPermaLink="false">urn:hackerpapers:mention:cs_0011047:5208468</guid><pubDate>Tue, 12 Feb 2013 18:17:55 GMT</pubDate><description>&lt;p&gt;http://oeis.org/A000170 hints that there is no such algorithm: &amp;quot;Strong conjecture : there is a constant c around 2.54 such that a(n) is asymptotic to n!/c^n&amp;quot; That would imply that a(n) grows faster than polynomial. That, in turn, would mean that merely counting the number of solutions cannot be done in polynomial time. N-Queens, by the way, becomes simple once you realize that you cannot have two queens at (p,q) and (r,s) if any of the following is true: p = r q = s p-q = r-s p+q = r+s (The first two check for horizontal and vertical attacks, last two for diagonal ones) Real programmers…&lt;/p&gt;&lt;p&gt;&lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and discussion history&lt;/a&gt;. A mention is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item><item><title>Dancing links — HN submission</title><link>https://news.ycombinator.com/item?id=631275</link><guid isPermaLink="false">urn:hackerpapers:submission:cs_0011047:631275</guid><pubDate>Fri, 29 May 2009 00:18:30 GMT</pubDate><description>&lt;p&gt;Dancing links, by Knuth&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;2 points; 0 discussion replies on HN. &lt;a href="https://hackerpaper.kaipfister.de/p/cs_0011047/"&gt;Paper and source history&lt;/a&gt;. A submission is not an endorsement.&lt;/p&gt;</description><category>cs.DS</category></item></channel></rss>
