Skip to main content
QUICK REVIEW

[Paper Review] Dancing links

Donald E. Knuth|arXiv (Cornell University)|Nov 15, 2000
Constraint Satisfaction and Optimization5 references185 citations
TL;DR

This paper introduces 'dancing links,' a technique to accelerate depth-first search in combinatorial puzzles like polyomino tiling and the N-Queens problem. By using reversible operations on doubly linked lists and a ghost square to unify constraints, the method enables efficient, heuristic-driven search that achieves excellent performance, solving the 19-hexiamond tiling and N-Queens for N up to 18.

ABSTRACT

The author presents two tricks to accelerate depth-first search algorithms for a class of combinatorial puzzle problems, such as tiling a tray by a fixed set of polyominoes. The first trick is to implement each assumption of the search with reversible local operations on doubly linked lists. By this trick, every step of the search affects the data incrementally. The second trick is to add a ghost square that represents the identity of each polyomino. Thus puts the rule that each polyomino be used once on the same footing as the rule that each square be covered once. The coding simplifies to a more abstract form which is equivalent to 0-1 integer programming. More significantly for the total computation time, the search can naturally switch between placing a fixed polyomino or covering a fixed square at different stages, according to a combined heuristic. Finally the author reports excellent performance for his algorithm for some familiar puzzles. These include tiling a hexagon by 19 hexiamonds and the N queens problem for N up to 18.

Motivation & Objective

  • To improve the efficiency of depth-first search algorithms for combinatorial puzzles such as polyomino tiling and the N-Queens problem.
  • To unify the constraints of using each polyomino exactly once and covering each square exactly once through a unified data structure.
  • To enable dynamic heuristic switching between placing a fixed polyomino or covering a fixed square during search.
  • To reduce total computation time through optimized data manipulation and constraint representation.

Proposed method

  • Represent each search assumption as a reversible local operation on doubly linked lists, enabling incremental updates during backtracking.
  • Introduce a ghost square to represent the identity of each polyomino, embedding the 'use once' rule into the same framework as the 'cover once' rule.
  • Reformulate the problem into an abstract 0-1 integer programming form, simplifying the coding logic.
  • Allow the search to dynamically choose between placing a polyomino or covering a square based on a combined heuristic.
  • Use the dancing links data structure to efficiently manage and update the search state during recursive exploration.

Experimental results

Research questions

  • RQ1How can depth-first search be accelerated in combinatorial puzzle problems like tiling and N-Queens?
  • RQ2Can the constraints of unique polyomino usage and unique square coverage be unified in a single data structure?
  • RQ3What performance gains are achievable by combining reversible operations and heuristic-driven search order?
  • RQ4To what extent can the dancing links technique scale to hard combinatorial puzzles such as hexiamond tiling?

Key findings

  • The dancing links technique significantly reduces total computation time by enabling efficient, incremental updates via reversible operations on doubly linked lists.
  • The use of a ghost square unifies the treatment of polyomino usage and square coverage, simplifying the algorithm and improving maintainability.
  • The method supports dynamic heuristic switching between placing polyominoes and covering squares, enhancing search efficiency.
  • The algorithm successfully solves the 19-hexiamond tiling problem, a well-known hard combinatorial puzzle.
  • The approach achieves excellent performance for the N-Queens problem, solving instances up to N = 18.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.