Experimental Analysis of
Golf Solitaire

Jan Wolter
April 11, 2013

[General Introduction]

The Game

To start a game of Golf we deal a tableau consisting of seven stacks of five cards each. One additional card is dealt to start the foundation. The remainding 16 cards become the stock.

You may, at any time, deal a card from the stock to the top of the foundation pile. The only other cards that can be played are the top cards of the seven tableau stacks. The only place they can be played to is the single foundation pile. A tableau card can be played to the foundation if it is one higher or one lower than the top card of the foundation. Suits do not matter.

Traditionally you may not play any card on a King, and you can only play a Two on an Ace, but these rules are often relaxed. For the purposes of this note, I'll refer to the common variants as follows:

Game Cards Playable on Kings Cards Playable on Aces
Golf-A NoneTwos
Golf-B QueensTwos
Golf-C Queens or AcesTwos or Kings

Politaire implements "Golf-B" under the name "Golf". You can read the rules or play the game. Politaire implements "Golf-C" under the name "Putt Putt". You can read the rules or play the game. The game is also available in many other solitaire programs.

Golf is sometimes scored as follows, with low scores being better:

"Par" is considered to be 45 points over nine deals, or 5 points per game.

Solver

I programmed a depth-first-search solver for Golf. It uses heuristics to decide which moves to try first, though the heuristics are pretty simple-minded - in Golf-A and Golf-B it likes playing Kings and Aces, and in all games it likes playing from tableau piles containing lots of cards. If it reaches a position from which no further moves are possible, it backtracks and tries another alternatives. All visited states are kept in a hash table, so when we revisit a state that we have previously ignored, we can immediately backtrack.

This solver is a bit slower than some others I have built, so the numbers of runs in my experiments are lower.

Results

I ran the solver on the first hundred-thousand Politaire games, seeds zero through 99999. The results for the different variations are shown below:
Game Percent Won Average Cards Removed
(out of 35 tableau cards)
Golf-A 26.1% 32.4
Golf-B 45.1% 33.5
Golf-C 93.0% 34.9
The average number of cards removed is quite high. Even when the win rate is low, it is usually possible to remove most cards. If we'd been keeping score using the standard scoring method, then the positive part of the score would have averaged 2.6, 1.5 and 0.1 per game for the three variants. My solver didn't try to maximize the number of cards left on the stock (or even report that value) so I don't have any statistics on the negative part of the score.

Clearly the ability to play Queens on Kings, or to wrap between Ace and King makes a very substantial difference in the difficulty of the game.

The distribution of the number of tableau cards moved to the foundation is shown in the charts below. Removing all 35 cards on the tableau counts as a win.

Distribution of Number of Removable Tableau Cards in 100,000 Random Golf Deals
Golf-A; Golf-B; Golf-C
I'm almost tempted to graph this on a logrithmic scale, since the large values dwarf the low values, but all values can be seen if you hover a mouse over the graph.

No games were encountered where no cards could be removed from the tableau, though such games are certainly possible, and would probably show up in a larger sample. The most intractable game encountered, in which only one card could be removed in both Golf-A and Golf-B, was seed 98270. That deal is solvable under Golf-C rules however. Seed 79848 allows only 5 cards to be removed, no matter which variant you are playing.

Related Games

Golf Rush is a variation of Golf which uses a triangular tableau, seven piles of cards, the first with one card, the next with two cards, and so on, until the last pile has seven cards. Because the tableau contains only 28 cards instead of 35, this game is easier than standard Golf. I ran a solver on the first 100,000 politaire seeds for this game, allowing Queens to be played on Kings, but not Aces on Kings or vice versa. 73.6% of games were found to be winnable, compared to 45.1% for Golf-B. 27.5 of the 28 cards on the tableau were removed on average.

Panther Creek is a four-deck version of Golf, played on a 12x12 tableau (but playing Queens on Kings is allowed). Lincoln Greens is the same game, but it allows wrapping between Ace and King. With 208 cards in play, these games are a bit out of reach of my dumb solver. It can win some games, but it gets lost in combinatorial explosion if the game is at all hard. Of the first hundred Panther Creek games, it could solve 42% of games, but since it couldn't prove any unsolvable, this is only a lower bound on the number of solvable games. It did a bit better with Lincoln Green, solving 97% of the first 1000 games.

The games Black Hole and All In A Row are very similar to Golf. I have a separate page studying about those.