1 / 8

Peg Solitaire with Depth First Search

Peg Solitaire with Depth First Search. By: Iris Garcia. Peg Solitaire. Single-player board game with pegs that can come in many different shapes such as: Cross Square Pyramid Triangle The purpose of the game is to eliminate all pegs by jumping over them, similar to the game of Checkers.

farrah-head
Download Presentation

Peg Solitaire with Depth First Search

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Peg Solitaire with Depth First Search By: Iris Garcia

  2. Peg Solitaire • Single-player board game with pegs that can come in many different shapes such as: • Cross • Square • Pyramid • Triangle • The purpose of the game is to eliminate all pegs by jumping over them, similar to the game of Checkers.

  3. Peg Board The simplest peg solitaire design is the triangular peg board, often referred to as the “Cracker Barrel” design. This design is similar to an equilateral triangle where each edge has the same number of pegs, and each row has one more peg than the row above it. The Board can be represented as a tree in order to implement how to traverse it.

  4. Depth First Search Algorithm DepthFirstSearch(Board b, Peg start) { If (Grandchild.isEmpty()) Jump(); updateBoard(); //updates empty peg, location, etc. else backtrack(); // backtrack to previous and/or try right child }

  5. Class Diagram

  6. Sequence Diagram

  7. Use Case Diagram

  8. References Darby, Gary. "Peg Solitaire Game." DelphiForFun Home. 31 Mar. 2009 <http://www.delphiforfun.org/Programs/PegSolitaire.htm>. This source offers background information on several different techniques in solving Peg Solitaire. It also includes different representations of Peg Solitaire other than the "Cracker Barrel" design. It also implies that the Depth First Search as one of the most effective solutions. Matos, Armando B. "Depth-first search solves Peg Solitaire." Computer and Information Science Papers CiteSeer Publications ResearchIndex. 31 Mar. 2009 <http://citeseer.ist.psu.edu/600260.html>. This article by Armando B. Matos goes into detail about using the Depth-First Search to solve the Peg Solitaire problem. Matos uses a tree to represent the pegs instead of a graph and gives computation type for implementing this algorithm with different representations of Peg Solitaire. Muhammad, Rashid B. "Depth First Search (DFS)." Depth First Search (DFS). Kent State University. 31 Mar. 2009 <http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/depthSearch.htm>. This source explains the uses of depth-first search and details its algorithm. Neller, Todd. "Uninformed Search." Gettysburg College Computer Science. Gettysburg College. 31 Mar. 2009 <http://cs.gettysburg.edu/~tneller/resources/ai-search/uninformed-java/index.html>. This source describes Peg Solitaire in a triangular hex grid, and gives a documented example of the source code. O'Brien, Daniel M. "Peg Board Puzzle Solution Page." Daniel M. O'Brien - bootstrap page. 31 Mar. 2009 <http://www.danobrien.ws/PegBoard.html>. This source gives a more detail analysis of solutions for the "Cracker Barrel" or triangulated representation of Peg Solitaire.

More Related