I need to program a solver for the game of Peg solitaire / Senku
There's already a question here but the proposed answer is a brute force algorithm with backtracking, which is not the solution I'm looking for.
I need to find some heuristic to apply an A* algorithm. The remaining pegs is not a good heuristic as every move discards one peg so the cost is always uniform.
Any ideas?
Asked
Active
Viewed 3,252 times
2
-
1How about using the average distance between pegs? You don't want to end up with widely separated pegs. – rossum Jul 22 '11 at 23:03
2 Answers
2
I was reading a paper talking about this problem link, and they propose 3 heuristics:
1 - The number of nodes are available for the next step, considering which more available next's steps, better the node.
2 - Number of isolated peg's - as few isolated peg's better the node.
3 - Less peg's in the board better the node.
This may be not the better heuristics for this problem, but seems to be a simple approach.

Felipe R. Saruhashi
- 1,709
- 16
- 22
0
You can do as rossum suggested. Another option would be to use the sum of distances (or some other function of the distances) from the center. Or you could combine the two.

Eran Zimmerman Gonen
- 4,375
- 1
- 19
- 31