Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1032625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:06:24+00:00 2026-05-16T14:06:24+00:00

Given an arbitary peg solitaire board configuration, what is the most effecient way to

  • 0

Given an arbitary peg solitaire board configuration, what is the most effecient way to compute any series of moves that results in the “end game” position.

For example, the standard starting position is:

..***..
..***..
*******
***O***
*******
..***..
..***..

And the “end game” position is:

..OOO..
..OOO..
OOOOOOO
OOO*OOO
OOOOOOO
..OOO..
..OOO..

Peg solitare is described in more detail here: Wikipedia, we are considering the “english board” variant.

I’m pretty sure that it is possible to solve any given starting board in just a few secconds on a reasonable computer, say an P4 3Ghz.

Currently this is my best strategy:

def solve:
    for every possible move:
        make the move.
        if we haven't seen a rotation or flip of this board before:
            solve()
            if solved: return
        undo the move.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:06:25+00:00Added an answer on May 16, 2026 at 2:06 pm

    The wikipedia article you link to already mentions that there only 3,626,632 possible board positions, so it it easy for any modern computer to do an exhaustive search of the space.

    Your algorithm above is right, the trick is implementing the “haven’t seen a rotation or flip of this board before”, which you can do using a hash table. You probably don’t need the “undo the move” line as a real implementation would pass the board state as an argument to the recursive call so you would use the stack for storing the state.

    Also, it is not clear what you might mean by “efficient”.

    If you want to find all sequences of moves that lead to a winning stage then you need to do the exhaustive search.

    If you want to find the shortest sequence then you could use a branch-and-bound algorithm to cut off some search trees early on. If you can come up with a good static heuristic then you could try A* or one of its variants.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given any arbitrary, one-line string, my goal is to render it into a bitmap
Given four (x,y) pairs that represent the four corners of an arbitrary polygon (quadrilateral)
Given some arbitrary url: view.php?viewid=blahblahblah Is there a way I can encode a query
Given an arbitrary python object, what's the best way to determine whether it is
I know that the total number of permutations for a given base is the
Given an arbitrary string, what is an efficient method of finding duplicate phrases? We
Given an arbitrary sequence of points in space, how would you produce a smooth
Given an arbitrary file descriptor, can I make it blocking if it is non-blocking?
Given some arbitrary SQL I would like to get the data types of the
Basically i just want to do an arbitrary operation using given arguments of arbitrary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.