ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
backtrack Directory Reference

Files

 
Anagrams.h
 The anagrams (exercise 16.8): the strings made of all the characters of a given one, in any order, that split into words of a dictionary, written with spaces between the words.
 
Enumeration.h
 The enumeration of the feasible solutions by backtrack (section 16.2): a solution is a vector \( S[ 0 .. n - 1 ] \), each \( S[ i ] \) taken from the choices that \( S[ 0 .. i - 1 ] \) allows; each choice is tried, the solutions are processed, and the search goes on recursively from \( S[ 0 .. i ] \), i.e., a visit in depth of the tree of the choices.
 
FastExactCover.h
 The engineered exact cover with colors, beyond the book [see DancingLinks.h for Knuth's Algorithm X written as the text describes it]: the exact covering with colors (XCC, Knuth's Algorithm C) on sparse sets instead of linked lists, the dancing cells of Knuth's program SSXCC after the design of Solnon.
 
KnightTour.h
 The tour of the knight (exercise 16.6): a path of the knight that visits every square of an \( n \times n \) board once.
 
NQueens.h
 The \( n \) queens (exercise 16.5): \( n \) queens on an \( n \times n \) board, no two on a row, a column or a diagonal.
 
SatSolvers.h
 Two solvers of the satisfiability of a formula in conjunctive normal form [see Problems.h for the formula and the backtrack of the reductions], after Knuth (section 7.2.2.2 of The Art of Computer Programming), beyond the book.
 
Sudoku.h
 The Sudoku (reality check of section 16.3 and exercise 16.7), of size \( n^2 \times n^2 \) with the numbers \( 1 , \ldots , n^2 \), \( n = 3 \) the classic one: the squares are filled in order, each with the numbers that check() allows, no equal number on its row, its column and its block of \( n \times n \), and the search backtracks when a square has none.