Table of Contents
As can be seen in state.h
, Freecell Solver
supports two ways to represent a state:
Compact States - in this configuration the data is one buffer of chars, where each card and each stack counter are represented as one character, and each freecell and foundation is one char too.
Determining the locations of every card is done using offset calculation.
This configuration consumes much less memory than Debug States, but it doesn't scale well to games where the stacks can contain a lot of cards. The reason is that every stack be of a fixed size (so offset would be determined by means of multiplication).
This configuration used to be the fastest for limited stack games such as Freecell. After Freecell Solver 2.6.x, it seems that Indirect Stack States has become slightly faster than it.
Indirect Stack States - in this configuration each stack is a pointer to a stack in memory. The stacks are also collected and there is one copy of each stack organisation (say [KS QH 6H]) in memory. Since a pointer to a stack uniquely identifies a stack, the states can be compared by comparing their memory contents.
This is now the default configuration, and in the 2.5.x development tree, many enhancements were done to optimise it. It was benchmarked to be slightly faster than Compact States, even for games like Freecell.