# fc-solve / fc-solve / site / wml / src / faq.html.wml

 ```Shlomi Fish 68aa992 2012-11-26 Shlomi Fish 60fb3af 2012-11-29 Shlomi Fish 68aa992 2012-11-26 Shlomi Fish 60fb3af 2012-11-29 Shlomi Fish 7ccce47 2012-11-30 Shlomi Fish cc24128 2012-12-05 Shlomi Fish 4382651 2012-11-26 Shlomi Fish 7322e5f 2012-11-29 Shlomi Fish 0de678b 2012-11-30 Shlomi Fish 4382651 2012-11-26 ``` ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175``` ```#include '../template.wml'

I think I found a wrong move in the solution? What can I do?

While it is not unthinkable that Freecell Solver will have a bug and will make a wrong move, it is extremely unlikely that that is the case. Some people have reported that several multi-sequence moves are impossible, but as I demonstrated to them, they were in fact possible.

One can find the maximal number of cards that can be moved as a sequence in Freecell using the formula max_cards = (1 + num_vacant_freecells) * (2 ^ num_vacant_columns) (where “*” is multiplication and “^” is exponentiation.). One can also try using expand-solitaire-multi-cards-moves from the Games-Solitaire-Verify CPAN distribution (by the same author of Freecell Solver), in order to filter solutions and produce ones with multi-card moves expanded into many single-card moves. If you are on Microsoft Windows, you can install DWIM Perl and run it.

I think I found an abuse of Freecell Solver. What should I do?

We received a report or two about various people or companies distributing Freecell Solver along with their products, and the answer is that it is: 1. Likely legal, 2. We don't mind, and 3. We encourage commercial and/or proprietary use of the code or binaries.

Freecell Solver used to be distributed under the Public Domain, but was relicensed to the permissive MIT/X11 licence due to the problematic and not globally accepted nature of the Public Domain, especially in software. (See the page maintained by Rick Moen about it.) As far as we know (and this is not legal advice), the main legal and practical difference between the public domain and the X11 licence, is that one should keep attributing the original copyright holders as rightful holders (while the licence of derivative works may be changed into any other). As far as we are concerned, this is not something we want to enforce, but we still recommend to follow this, to stay on the safe side of the law.

So unless someone sues us for damages for a problem caused by the program or library (which violates the no warrany paragraph of the licence) everything should be fine and the “abuse” of the program is acceptable.

What are the uses of a solver for Patience, such as Freecell Solver?

Freecell Solver is unlikely to help in curing cancer, or solve world hunger, but it still has some uses. One use is determining whether an initial layout of a game, or a layout in mid-play is solvable or not so a human player can know whether he needs to return to an earlier position. The default configuration of Freecell solver may still report a small number of solvable positions as unsolved, but that can be mitigated by passing some command-line flags.

Another use of a Solitaire solver is to find solutions for difficult deals, or attempt to find shorter solutions. Yet another use is to collect statistics from a large number of random deals (say, the Microsoft Windows Freecell deals or PySolFC’s deals), which is part of what Freecell researchers do.

The Freecell implementation for Windows, Freecell 3D has also introduced a “Race against the computer” mode of Freecell, which is an interesting challenge.

Finally, we have more recently started to investigate some “human/computer collaborated” Freecell solving, where a human aided by a Solitaire suite with good solver integration can attempt to solve some difficult deals (for both a human and a computerised solver), by pruning dead ends, and by finding whether reached states are solvable. This provides a combined solving power, that is greater than the sum of both parts.

I Started Writing a Freecell Solver (of my own) but it is too slow. What can I do?

The problem with many naïve Freecell solving solutions is that, while they can succeed in solving many Freecell deals, they may fail spectacularly in the general case. Furthermore, Generalised Freecell (where there is an arbitrary number of ranks) was shown to be an NP-complete problem and as a result, it is unlikely that no efficient solution for solving that can be found.

You can try inspecting the code of Freecell Solver or one of the other solvers for insights, but note that their code (and especially Freecell Solver's) may be somewhat complex, and hard to understand for people with relatively little experience. You can also pursue some of the Freecell Solver documentation as well as the archives of the fc-solve-discuss mailing list for some insights and ideas.

Here is some general tips:

• Make sure that the positions in the graph of the game are represented as a single segment of memory (normally a C struct) and can be compared for equivalence easily (using memcmp() or a similar function).

• Use an efficient data structure to hold the states in the collection such as a hash table or a self-balancing binary tree.

• Often randomising the solution (see Freecell Solver's Random-DFS scan which was inspired by a different solver called Freecell Tool can help a lot).

• Freecell Solver makes heavy use of switch tasking: having several different searches operate on the same board, until the first search yields a solution. This normally yields a solution quicker than a singular scan.

• Consider implementing moves as meta-moves: sequences of several single-card and/or sequence moves that implement a certain ends. This can yield a solution faster than using single-card moves (also known as atomic moves).

Finally, note that we could use a helping hand with Freecell Solver, and the authors of other open-source solvers may be happy for help as well, so if you want to improve something more mature, then contact us.

```
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.