Http://www.cnblogs.com/grenet/p/3145800.html
Best elaboration on Dancing list I found. In Chinese.
Traditional backtracing is a heuristic-like procedure. Say, there was N items to try with one by one, when N[i] was picked, all rest n[i + 1, N-1] items would being tested one by E, too. What's more, due to recursive calls, there is a lot intermediate caching necessary to contain intermediate states. Very blindly procedure correct?
Traditional backtracing is like, you are trying to find a place on the ground, because you cannot see through blocks. OK, so the computer god Donald Knuth invented a smarter tool-dancing links. This is a helicopter floating above the city. You is able to see all blocks, and does some bookkeeping with constant time!
Dancing Links, enables do a simplified, lightweighted backtracing:
-Say n[i] conflicts with N[J], n[k], etc.. J, K > I, so if N[i] is picked, N[j], n[k] be eliminated (O (1) List update OPS) from candidate list automatically!
-During above procedures, you don ' t need extra buffer to store intermediate states:modified dancing links it is! So what wanna recover when backtracing? Similar const time Recover do that! (O (1) List update OPS)
Here are a more complex and interesting example:
http://m.blog.csdn.net/blog/mu399/7627862 (Tetris, Sudoku, N-queens)
Dancing links-nuclear Weapon for Exact Cover problems