Crate puzzle24

Source

Structs§

ArrayGrid24
DefaultPatternDB
The “default” pattern DB, as given in [PATTERN_IDX]. (And described in the paper referenced by mod.rs)
DfsStack
Invariant: stack.len( ) == path.len( ) + 1
PackedGrid24
We pack cells as 5 bits each, requiring a total of 125 bits.
Pattern6Puzzle
Puzzle24
Invariant: grid[ gap_cell ] contains tile 0
PuzzleCell
A cell inside a 24-puzzle. The cell represents the fixed location within the grid, which stores a tile.
PuzzleTile
A tile, contained in a cell within a 24-puzzle.

Enums§

Dir
State

Constants§

EXAMPLE_PUZZLES
Ten 24-puzzles taken from the paper: “Finding Optimal Solutions to the Twenty-Four Puzzle” by Richard E. Korf and Larry A. Taylor

Traits§

Heuristic
Puzzle24Grid
A Puzzle24 represents a 5x5 grid of cells containing tiles [0..24]. Tile 0 represents the gap.

Functions§

solve_dfs
solve_dfs_state
solve_ita