The Freecell Solver Frequently Asked Questions (F.A.Q.) List
Table of Contents
- The Questions
- What is Freecell Solver? What is a solver for Freecell in general?
- What is Solitaire? Is it the Windows implementation of Klondike?
- What is “Microsoft deal #NNN”? What is “MS deal #NNN”? What are the Microsoft Freecell deals?
- Can Freecell Solver solve all the Freecell layouts?
- I think I found a wrong move in the solution? What can I do?
- I think I found an abuse of Freecell Solver. What should I do?
- What are the uses of a solver for Patience/Solitaire card games, such as Freecell Solver?
- Does anyone care about this project? I think no one cares about it except you.
- I started writing a solver for Freecell (of my own) but it is too slow. What can I do?
- May I integrate Freecell Solver into my program? If so - how?
- The Solutions I got are too long. What can I do?
- Which programming language (or programming languages) is Freecell Solver written in?
- Why is Freecell Solver written in C? Why not in another language?
- I found a solvable deal that Freecell Solver reports as unsolvable - should I report it to you?
- Have you completed/finished the work on Freecell Solver? Is it done yet?
- “‘Freecell Solver’? Hasn’t Freecell been solved yet?”
- Is Freecell Solver written in Perl?
- How does Freecell Solver solve Freecell? Which algorithm does it use?
- How does Freecell Solver read the cards and board layout? What kind of input does it accept?
- I found a solution for MS Deal No. 11,982 - should I report it to you?
- What is the runtime complexity of solving Freecell?
- What is PySol? What is PySol FC? Are they solvers as well?
- “Freecell”? Is it the Microsoft/Windows game?
- Is Freecell Solver open source?
- What were the whereabouts of one of the solvers running out of 512 GB (= gigabyte) of RAM?
- Have you considered using machine learning, neural networks, or deep learning for improving the solver?
- Where can I find a GUI for Freecell Solver? I dislike the fact that it is a command line program.
- How is Freecell Solver different from the Black Hole Solitaire Solver?
The Questions
Node LinkWhat is Freecell Solver? What is a solver for Freecell in general?
Node LinkNextFreecell (or “FreeCell”) is a single-player card game (which are generally known as “Patience” or “Solitaire”), where all the cards are played face-up at startup and where no talon is used. There is more information about it in the FreeCell FAQ which is maintained by Michael Keller.
A typical deal of Freecell with 8 columns and 4 reserve cells, looks something like this:
An automated solver for Freecell is a computer program that attempts to solve layouts of Freecell: either initial deals, or often also mid-play states of the game, and emit a solution to completion, or conclude that the layout could not be solved by it. Freecell Solver is one such program, and it is open source under the permissive and common MIT/Expat licence, provided free-of-charge for download or use online, and sports a large number of features. (See its features list.)
One should note that Freecell Solver can solve several other variants of solitaire that are similar enough to Freecell for us to provide support for, but Freecell appears to be the most popular variant out of them, and the name is kept for historical reasons.
What is Solitaire? Is it the Windows implementation of Klondike?
PrevNode LinkNext“Patience” or “Solitaire” are any single-player card game, or at least those played using the standard French playing cards. One such solitaire variant is Klondike which has become associated with card Solitaire in general, and was implemented as a game for Microsoft Windows under the name "Solitaire". Nevertheless, there are many other variants of card Solitaire, and Freecell is one of them.
In some countries, "Solitaire" can also refer to peg solitaire.
You can find a list of solvers for various variants of patience games in our links page.
What is “Microsoft deal #NNN”? What is “MS deal #NNN”? What are the Microsoft Freecell deals?
PrevNode LinkNextMicrosoft shipped several implementations of Freecell for its Windows operating systems called “Microsoft FreeCell” which contributed to popularising the game. They dealt cards with numbered deals using a shuffling algorithm based on inputting the number of the deal into the Microsoft C Run time library pseudorandom number generator. The algorithm for dealing cards was made available by Jim Horne, a Microsoft software developer who implemented Microsoft FreeCell.
While the original MS FreeCell only dealt deals in the range 1 to 32,000, these deals can be extended up to a 31-bit number and were later extended by Freecell Pro to 33-bits dealing.
The Microsoft deals are considered canonical among Freecell researchers in their studies of the game.
For more information, see:
range_solvers_gen_ms_boards.h and gen_ms_boards__rand.h - from the Freecell Solver's source - implementations of the dealing algorithm in optimised C under the MIT/Expat licence.
“Deal cards for FreeCell” on Rosetta Code - implementations in many programming languages, which should be easy-to-understand, but which are under a problematic licence.
The impossible 4-freecells and 5-freecells deals in Freecell Pro’s Range of Deals.
The PyPI pysol_cards module - implementation of the dealing algorithm in python under the MIT/Expat licence.
Freecell::Deal::MS - self-contained, hopefully portable and reliable, implementation in Perl and on CPAN, under the MIT/Expat licence.
Can Freecell Solver solve all the Freecell layouts?
PrevNode LinkNextFirst of all, despite popular belief, a small percentage of the standard 8 columns+4 freecells Freecell layouts are impossible to solve, and even more deals are impossible with fewer than 4 freecells available. What Freecell Solver will do in this case is traverse the entire game graph (given enough time and computer memory) and then report “I could not solve this game.”
That put aside, some deals may be inaccurately reported as unsolvable with the default heuristic. See the link for more information and for a solution.
Part of the confusion may have stemmed from the phrasing in the Microsoft Freecell help file which read “It is believed (though not proven) that every [Freecell] game is winnable.” which referred only to the 32,000 built-in deals and proved to be false as well (because deal #11,982 turned out to be impossible).
Some of the most famous impossible deals are:
Microsoft Deal #11,982.
Recent versions of Microsoft Freecell contain two impossible deals numbered -1 and -2 as a joke.
Theodore Pringle has constructed a deal which is impossible to win with 8 freecells or fewer.
I think I found a wrong move in the solution? What can I do?
PrevNode LinkNextWhile 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-card 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_columns)
(where “*” is multiplication and “^” is exponentiation.). Note that num_columns
refers to the number of intermediate/temporary columns one uses in the the transfer and if you are trying to transfer cards to an empty column, the number will be smaller by a difference of 1.
Note that the web-based solver also has an option to expand such moves into atomic, single-card, moves. One can use it in most modern JavaScript-enabled browsers, and without needing to install any additional software on your computer. Note that we also have set-up a dedicated Online Freecell moves’ expander web application on its own web-page. (Albeit calling it a “web-application” may be somewhat of a stretch.)
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 several single-card moves. If you are on Microsoft Windows, you can install Strawberry Perl to run it.
I think I found an abuse of Freecell Solver. What should I do?
PrevNode LinkNextWe 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/Expat 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 Expat 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 warranty 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/Solitaire card games, such as Freecell Solver?
PrevNode LinkNextFreecell 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. It can also be used to provide hints by giving the first leading moves, when a (human) player gets stuck.
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.
Freecell 3D, a Freecell implementation for Windows, 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 collaboration”-based Freecell solving, where a human aided by a Solitaire suite with a 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 technique, that is greater than the sum of both parts.
Does anyone care about this project? I think no one cares about it except you.
PrevNode LinkNextThe short answer is that: yes, some people care. As of November 2016, I received over 900 E-mails about the project to my private inbox and my fc-solve-discuss group’s folder also contains over 900 E-mails. Furthermore, some people to whom I mentioned my solver in real life, expressed interest in it, in part due to the fact that in Israel, where I live, many people played it on the Israeli military (= “IDF”, “Tzahal”)’s computers during their draft/etc. service. An internal survey conducted in 2004 found that it was the preferable game of 29% of the surveyed soldiers - thanks to the Hebrew wikipedia page about Freecell for the link. One should note that Israel has instated a draft for girls as well as boys, so some of the people who were impressed were females (and often quite attractive ones).
I have written a section in a three-part essay titled “How to achieve world domination” about that and niche software in general.
Freecell may have been declining in popularity lately, but I expect interest in it to continue for a while. Furthermore, the prevalence of Freecell games on mobile devices (e.g: smartphones, tablets) seems to have rekindled interest in Freecell solvers.
I started writing a solver for Freecell (of my own) but it is too slow. What can I do?
PrevNode LinkNextThe problem with many naïve Freecell solving programs 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 likely that no efficient solution for solving that in the general case can be found (but it is possible that some good heuristics can be devised).
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 are 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 search tree. There are libraries implementing them for most popular languages.
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 help to improve something more mature, then contact us.
May I integrate Freecell Solver into my program? If so - how?
PrevNode LinkNextYes, you can, as long as you accept the MIT/Expat licence. We also would appreciate an acknowledgement and a link to the Freecell Solver home page, in the About Dialogue, and in other places.
Now regarding how to integrate: please either use the freecell_solver_user_*
API, or alternatively parse the output of fc-solve with the -p -t -sam -sel flags. The freecell_solver_user_*
API is not documented at the moment, but should be self-explanatory, and there are some examples of using it in the various solvers in the distribution. One useful way to configure a solver handle is to use “fcs_cl.h” which provides an API based on the Freecell Solver command-line and is more convenient than issuing multiple lower-level API calls.
You can opt to put the solver on a separate thread, on a separate process, or alternatively limit the iterations and incrementally increase it, in a pre-emptive multi-tasking fashion.
Good luck and please let us know if you have run into any problems, or, alternatively, if you have been successful.
The Solutions I got are too long. What can I do?
PrevNode LinkNextYou can try using a flares-based preset such as “video-editing” and optionally add --flares-choice fcpro and -fif 10, where 10 can be replaced by a larger (or smaller) number. So the complete command would be:
pi-make-microsoft-freecell-board -t 24 | \ fc-solve -l ve --flares-choice fcpro -fif 10 -
If this still does not work to your satisfaction, you can try constructing a specialised heuristic from the many command line options of Freecell Solver that will yield something. There are some examples for those in the individual flares and soft threads under the “Presets/presets” directory.
Note that some alternative solvers may give shorter solutions, for example Shirl Hart’s solver which has a Java version and a (slower) Perl 5 version (and is also open source).
Which programming language (or programming languages) is Freecell Solver written in?
PrevNode LinkNextThe core Freecell Solver source is written in the GNU11 version of the C11 standard of the C programming language (-std=gnu11
), which is supported by the GCC and clang compilers and compatible compilers. This includes the libfreecell-solver library, most of the user-facing executables using it, and some other related code. Aside from that, there's quite a lot of support code for testing (a.k.a: “quality-assurance”), automation, building, results analysis, and other tasks, written in Perl 5, CMake, Python 3.x, the GNU Bash shell, Ruby, and possibly some other languages. The git repository also contains code and markup in other languages such as JavaScript.
Here are the estimated lines-of-codes-per-language statistics of running SLOCCount by David Wheeler on the “fc-solve/source” sub-directory of the git repository (as of 9 December 2016)
Totals grouped by language (dominant language first): ansic: 27360 (68.34%) perl: 10165 (25.39%) python: 1262 (3.15%) sh: 970 (2.42%) cpp: 277 (0.69%)
Why is Freecell Solver written in C? Why not in another language?
PrevNode LinkNextPart of the reason why Freecell Solver is written in C, is because the first released version (version 0.2) was written in C, and it continued to be maintained in this language. Other reasons are:
C is fast and memory efficient.
C is portable.
The bit-handling operators of C are utilised extensively in the Freecell Solver source.
As opposed to C++, C is easier to get right, is more of a “no-nonsense language”, is less hyped, and does not encourage crazy or pointless practices. Also see what I’ve written about it previously.
Here are a few other links I collected which speak against C++:
“Never trust a programmer who says he knows C++” - by Louis Brandy.
“C++ Joke” - on my technical blog.
“Software-related Quotes” on Ido Kanner’s blog. His blog contains many other entries criticising C++.
Nevertheless, I cannot guarantee that Freecell Solver’s code will remain written in C forever, and that I won’t gradually convert it to C++ or a different language. My main issue with using C++ right now is that I (rationally) fear it will give me too much rope to hang myself, and be too tempting to go wild with advanced features, as well as potentially bring too many unexpected and hard-to-debug problems.
One final note is that the Freecell Solver C source has been compiled to browser-side-compatible JavaScript using Emscripten, so it can be used inside a JavaScript-compatible browser. This was done for making it easy to be tested and used, at the (usually not show-stopping) trade-off of being slower than compiled-to-native-binary-code. Nevertheless, the C code is still maintained directly, and the generated JavaScript code is not idiomatic JavaScript.
I found a solvable deal that Freecell Solver reports as unsolvable - should I report it to you?
PrevNode LinkNextThe default Freecell Solver heuristic may have a small number of deals that are reported as unsolvable despite being solvable. However, you can use scans based on atomic moves to rectify that. See fc-solve --help-configs and the USAGE.html file for more information.
Have you completed/finished the work on Freecell Solver? Is it done yet?
PrevNode LinkNextI am getting asked that a lot, and I find it a strange notion. It is similar to asking if the KDE developers are done working on KDE, or if the developers of the Linux kernel have completed the Linux kernel, or if the Firefox browser is done. Freecell Solver is a fairly large and complex project and there is still a lot of room for improvement, and while I sometimes take a break from working on it, it does not mean I planned to have permanently stopped.
Sometimes, I complete one task and call it a day, but it does not mean that I plan to ever stop working on it. Perhaps when I tell people that “I’m working on Freecell Solver” they assume that this work is temporary, but it has been developed since the year 2000, while taking some breaks.
All that put aside, one should not conclude that Freecell Solver is an immature project or is unusable, just like KDE, the Linux kernel, and Firefox are not immature or unusable. Freecell Solver is not perfect (and will probably never be) but it is still usable in its current state.
Also see:
An earlier blog post about “Finished Projects, Maintained Projects and Those that are Up For Adoption”.
Mark Jason Dominus about "New Versions" - the other side of the coin.
"Good Software Takes Ten Years. Get Used To it." ( Joel on Software )
My tweet - "you divorce wives, not children".
“‘Freecell Solver’? Hasn’t Freecell been solved yet?”
PrevNode LinkNextThis question shows a basic misunderstanding of what Freecell is, and the purpose of a solver for it. Just to clarify the matters, Freecell is a single-player card game, with some rules about what constitutes a legal move, and since there are 52 cards (Ace-to-King in the four suits), which are usually placed in 8 columns (although a different number is possible), there are about 1.75 × 1064 distinct initial layouts (according to the Wikipedia page), and many more if we consider mid-play layouts.
The primary purpose of solvers such as this one is to attempt to solve any arbitrary layouts, while optionally giving the moves to completion. Note that due to the nature of the game, it may be impossible and/or time consuming for some layouts, but hopefully the chance of this risk can be minimised with the more advanced searches.
Is Freecell Solver written in Perl?
PrevNode LinkNextFor some reason, some people assume that I (= Shlomi Fish) wrote Freecell Solver in Perl. That may stem from the fact that I've written a lot of Perl 5 code (see my “Perl Résumé” over at perlresume.org), but it is not, in essence, the case for Freecell Solver.
In fact, the core C libfreecell-solver library, some of the command line executables, and some other code, is written in the GNU11 version of the C programming language, and does not require the Perl runtime to be used.
It is true that the preliminary version of Freecell Solver (that was written before the first “0.2” release and that can be found in the “nostalgia” directory of the version control system) was written in Perl, but that was quickly rewritten in C. The original reason for the rewrite was that the Perl version ran too slowly, but part of the problem was the fact that it was poorly coded, rather than Perl’s fault.
I've kept the code written in C after version 0.2, which was written in it, and have preferred to keep it that way, for performance reasons. Porting a different solver I wrote - for Black Hole Solitaire - from its initial Perl version to C - made it roughly 24 times faster and I naturally find a 24 factor performance decrease unacceptable.
How does Freecell Solver solve Freecell? Which algorithm does it use?
PrevNode LinkNextThe exact algorithm used by “fc-solve” can be configured using the various command line arguments it accepts, which are documented in the README and USAGE files. Furthermore, the “-l” flag can load some predefined configurations, which are essentially a sequence of command line arguments loaded from a file.
Some of the highlights of the methods supported by Freecell Solver are:
Switch-tasking in which different scans are interrupted, swapped with another scan, and then resumed.
Randomised and/or prioritised depth-first-search (DFS) scans, and Best-First-Search (BeFS) scans.
Different types of moves, with configurable order and grouping.
One can instantiate different instances of the solver, that will each solve different deals in different threads or processes.
How does Freecell Solver read the cards and board layout? What kind of input does it accept?
PrevNode LinkNextThe API of the solver accepts a textual representation in a certain well-formed format of the starting layout of the game's board (which may be a layout of a Game in mid-play), parses it, and starts the processing from it. This allows Freecell Solver to accept any arbitrary layout. Not just the initial layouts of Microsoft Freecell or a different Solitaire implementation.
We did not bother with graphically extracting the cards, because it is harder to do, and would have limited the utility and generality of the solver. Nevertheless, the solver can be input with a text layout that was extracted from a graphical screenshot. This seems to be the approach taken by the iPhone Freecell Bot demo.
Note that Freecell Solver also ships with some programs that generate the initial deals of some popular Solitaire implementations. Moreover, some implementations of Solitaire have integrated Freecell Solver, which in turn make them input the board to the solver and use its moves' output to display the solution graphically.
I found a solution for MS Deal No. 11,982 - should I report it to you?
PrevNode LinkNextThat deal was found to be impossible by most human players, and all automated solvers that tried to solve it (including a solver which is written in Haskell, which is a statically-typed programming language, and which code that is written in it tends to exhibit very few bugs.). Nevertheless, we would welcome a proof to the contrary given it actually refers to the actual deal.
For the record, the card arrangement is:
-- -- -- -- -- -- -- -- AH AS 4H AC 2D 6S TS JS 3D 3H QS QC 8S 7H AD KS KD 6H 5S 4D 9H JH 9S 3C JC 5D 5C 8C 9D TD KH 7C 6C 2C TH QH 6D TC 4S 7S JD 7D 8H 9C 2H QD 4C 5H KC 8D 2S 3S
Or arranged with the piles in each text line:
: AH 3D KD JC 6C JD KC : AS 3H 6H 5D 2C 7D 8D : 4H QS 5S 5C TH 8H 2S : AC QC 4D 8C QH 9C 3S : 2D 8S 9H 9D 6D 2H : 6S 7H JH TD TC QD : TS AD 9S KH 4S 4C : JS KS 3C 7C 7S 5H
Here is a screenshot of that deal in PySol.
If, and only if, the cards match, please record a solution using PySol FC and send us the saved game. Make sure you are playing Freecell with exactly four reserves and not some other variant.
Note that NRG Israel reported (in Hebrew) that an Israeli couple was able to solve deal no. 11,982 but they didn't record the solution, and it is possible that it exploited a bug in MS Freecell.
A partial list of the solvers that have failed in finding a solution to #11,982:
The aforementioned solver written in Haskell.
fc-solve / libfreecell-solver - hosted on this site.
The dbm_fc_solver - shares some code with fc-solve and part of the Freecell Solver distribution.
The depth_dbm_fc_solver - shares some code with both dbm_fc_solver and fc-solve.
The original patsolve by Dr. Tom Holroyd.
patsolve-shlomif which shares some code with fc-solve.
Don Woods' Freecell Solver - written in C with available source.
Shirl Hart's solver - written in Java with an earlier version in Perl 5.
Gary Campbell's FCELL.COM - written in x86 assembly for DOS.
FreeCell Java Solver - open source under the GPLv3.
Solvitaire - an open-source (GPLed) solver for many Solitaire variants written in C++.
What is the runtime complexity of solving Freecell?
PrevNode LinkNextGeneralised Freecell (where there is an arbitrary number of ranks) was shown to be an NP-complete problem and as a result, it is likely that no efficient solution for solving that in the general case can be found (but it is possible that some good heuristics can be devised).
That put aside, Freecell is a degenerate case where the number of ranks is fixed at 13 (ace-to-king).
One implication of Generalised Freecell's NP-completeness is that one can devise an algorithm to solve it, that while possibly requiring exponential time, will only require polynomial space (e.g by reducing the algorithm to 3SAT).
What is PySol? What is PySol FC? Are they solvers as well?
PrevNode LinkNextNo, actually PySol FC, which is short for "Python Solitaire Fan Club edition" is an open source suite of card solitaire / patience games, which includes, but is not limited to several Freecell-like variants. While it includes some solver and hints functionality and makes use of Freecell Solver and other solvers, it contains many other features including allowing a human to play the games on their own.
Note that Shlomi Fish, who is the chief maintainer of Freecell Solver, also co-maintains PySol FC so he tends to talk about his work on both.
For some more information, see:
“Freecell”? Is it the Microsoft/Windows game?
PrevNode LinkNextYes, and no. The "Freecell" game (see its wikipedia entry) was invented by Paul Alfille based on an earlier game called "Baker's Game" and was implemented for the PLATO educational computer system back in 1978. The Microsoft Windows Freecell implementation came later and made the game much more well-known and popular, but had some limitations. While Freecell Solver can handle the MS FreeCell deals, parameters and rules perfectly fine, it also has run-time support for many variations on them, and accepts any arbitrary layout of the cards, including those at mid play, as input.
Is Freecell Solver open source?
PrevNode LinkNextFreecell Solver is free and open source software under the permissive and common MIT/Expat licence, and provided free-of-charge for download or use online. You can find the latest development sources in its GitHub repository and call also download release source archive files from the download page. Share and enjoy!
Contributions are welcome.
What were the whereabouts of one of the solvers running out of 512 GB (= gigabyte) of RAM?
PrevNode LinkNextWe were trying to conclusively determine whether MS deal no. 384,243 was winnable or impossible to solve with two freecells. This was done by running the depth_dbm_fc_solver on an HPC node which used x86-64 processors and had 512 gigabytes of RAM. We were given indirect access to it thanks to a certain university. Note that steps were taken to reduce the RAM consumption and it seems unlikely that there were memory leaks in the code.
We have been able to complete a complete scan of all 4 freecell deals in the MS freecell 8.6 milliard range using an AWS node with only 256 GB of RAM and about 40-50 GB of hard disk (though we could probably use less or make use of s3fs-fuse or similar — to save on costs).
It is true that a quote mis-attributed to Bill Gates says “640 kB [of RAM] ought to be enough for anybody” but many computing tasks require much more than that and Freecell is a hard (NP-complete) problem. There may be ways to reduce RAM consumption further using a different algorithm, by distributing calculations, or other techniques. As usual, patches/pull requests or ideas are welcome.
Have you considered using machine learning, neural networks, or deep learning for improving the solver?
PrevNode LinkNextI did, but I didn't get too far, in part due to not investing a lot of time, and in part due to lacking sufficient knowledge. The closest we got may be patsolve which utilises a genetic programming program to calculate optimal parameters (note that I didn't write it originally so I'm hazy about its exact algorithm) and which Freecell Solver can use, and an academic solver that performs poorly compared to some of the solvers of hobbyists, while using methods that were trendy in the academia during the time in which it was written.
Despite common misconception, there are other approaches to AI than machine learning, and AI is: 1. Not "magic". 2. Tends to involve heuristics that while performing well on most inputs, can sometimes take a lot of time in a minority of them. Freecell Solver is not an exception to either item, as even its best performing meta-scans can be time consuming for a small percentage of the input layouts.
Where can I find a GUI for Freecell Solver? I dislike the fact that it is a command line program.
PrevNode LinkNextFreecell Solver provides some APIs written in C (and which can be compiled for browser-side use using Emscripten) which software developers can use to write other apps and front ends. Aside from the command line programs that are part of the Freecell Solver distribution, you can opt to use:
The web-based solver which provides a graphical and animated preview of the solution.
PySol FC - an application for desktops and Android devices, that has integrated Freecell Solver.
KPatience - a desktop game.
We believe competent software developers can write other front ends and wrappers using the provided APIs.
How is Freecell Solver different from the Black Hole Solitaire Solver?
PrevNode LinkFirst of all note that Black Hole Solitaire Solver is different from Freecell Solver, and you may catch me talking about either one.
Otherwise, Black Hole Solitaire Solver was written, after fc-solve, to solve some variants of card solitaire whose rules enabled it to use less memory than a straightforward adaptation of fc-solve's architecture. In theory, Freecell Solver can be modified to solve them, but it will be more wasteful.