Modelling and Solving English Peg Solitaire Chris Jefferson, Angela Miguel, Ian Miguel, Armagan Tarim. AI Group Department of Computer Science University.

Slides:



Advertisements
Similar presentations
Problem Solving Well-formed predicate calculus expressions provide a means of describing objects and relations in a problem domain and inference rule.
Advertisements

Exploiting Symmetry in Planning Maria Fox Durham Planning Group University of Durham, UK.
BackTracking Algorithms
Case study 5: balanced academic curriculum problem Joint work with Brahim Hnich and Zeynep Kiziltan (CPAIOR 2002)
Anany Levitin ACM SIGCSE 1999SIG. Outline Introduction Four General Design Techniques A Test of Generality Further Refinements Conclusion.
Introduction to Algorithms
Optimal Rectangle Packing: A Meta-CSP Approach Chris Reeson Advanced Constraint Processing Fall 2009 By Michael D. Moffitt and Martha E. Pollack, AAAI.
Search in AI.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
CPSC 322, Lecture 18Slide 1 Planning: Heuristics and CSP Planning Computer Science cpsc322, Lecture 18 (Textbook Chpt 8) February, 12, 2010.
Maths of Constraint Satisfaction, Oxford, March 2006 Constraint Programming Models for Graceful Graphs Barbara Smith.
Shirokuro : A Backtracking Approach Benjamin Bush Faculty Advisors: Dr. Russ Abbott, Dr. Gary Brookfield Department of Computer Science, Department of.
Discrete Mathematics Lecture 4 Harper Langston New York University.
Constraint Satisfaction Problems
Matrix Modelling Pierre Flener (Uppsala) Alan M. Frisch (York) Brahim Hnich, Zeynep Kiziltan (Uppsala) Ian Miguel, and Toby Walsh (York)
Creating Difficult Instances of the Post Correspondence Problem Presenter: Ling Zhao Department of Computing Science University of Alberta March 20, 2001.
1 Data Structures A program solves a problem. A program solves a problem. A solution consists of: A solution consists of:  a way to organize the data.
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
7 INVERSE FUNCTIONS. The common theme that links the functions of this chapter is:  They occur as pairs of inverse functions. INVERSE FUNCTIONS.
Modeling the Covering Test Problem Brahim Hnich, Steven Prestwich, and Evgeny Selensky Cork Constraint Computation Center UCC Supported by SFI.
CGRASS A System for Transforming Constraint Satisfaction Problems Alan Frisch, Ian Miguel (York) Toby Walsh (Cork)
26 April 2013Lecture 5: Constraint Propagation and Consistency Enforcement1 Constraint Propagation and Consistency Enforcement Jorge Cruz DI/FCT/UNL April.
Chapter 5 Outline Formal definition of CSP CSP Examples
Intelligence for Games and Puzzles1 Solitaire Puzzle The solitaire puzzle is played with 32 pegs.
Global Constraints for Lexicographic Orderings Alan Frisch, Ian Miguel (University of York) Brahim Hnich, Toby Walsh (4C) Zeynep Kiziltan (Uppsala University)
Modelling a Steel Mill Slab Design Problem Alan Frisch, Ian Miguel, Toby Walsh AI Group University of York.
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
Tractable Symmetry Breaking Using Restricted Search Trees Colva M. Roney-Dougal, Ian P. Gent, Tom Kelsey, Steve Linton Presented by: Shant Karakashian.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
Graph Algorithms. Definitions and Representation An undirected graph G is a pair (V,E), where V is a finite set of points called vertices and E is a finite.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
Jinsong Guo Jilin University, China Background  Filtering techniques are used to remove some local inconsistencies in the search algorithms solving.
Solving Problems by searching Well defined problems A probem is well defined if it is easy to automatically asses the validity (utility) of any proposed.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
Course Overview  What is AI?  What are the Major Challenges?  What are the Main Techniques?  Where are we failing, and why?  Step back and look at.
CP Summer School Modelling for Constraint Programming Barbara Smith 3. Symmetry, Viewpoints.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
Foundations of Constraint Processing, Fall 2004 October 3, 2004Interchangeability in CSPs1 Foundations of Constraint Processing CSCE421/821, Fall 2004:
Robust Planning using Constraint Satisfaction Techniques Daniel Buettner and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
Assigning Judges to Competitions Using Tabu Search Approach Amina Lamghari Jacques A. Ferland Computer science and OR dept. University of Montreal.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Analysis & Design of Algorithms (CSCE 321)
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
Balanced Billing Cycles and Vehicle Routing of Meter Readers by Chris Groër, Bruce Golden, Edward Wasil University of Maryland, College Park American University,
By J. Hoffmann and B. Nebel
Constraint Programming for the Diameter Constrained Minimum Spanning Tree Problem Thiago F. Noronha Celso C. Ribeiro Andréa C. Santos.
Constraint Satisfaction Problems (CSPs) Introduction
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems vs. Finite State Problems
7 INVERSE FUNCTIONS.
Announcements Final Exam on August 17th Wednesday at 16:00.
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Propagation
Example Fill in the grid so that every row, column and box contains each of the numbers 1 to 9:
Objective of This Course
Graphplan/ SATPlan Chapter
MURI Kickoff Meeting Randolph L. Moses November, 2008
Class #19 – Monday, November 3
Test Case Test case Describes an input Description and an expected output Description. Test case ID Section 1: Before execution Section 2: After execution.
Haskell Tips You can turn any function that takes two inputs into an infix operator: mod 7 3 is the same as 7 `mod` 3 takeWhile returns all initial.
Constraints and Search
Game Playing Fifth Lecture 2019/4/11.
Types of topology. Bus topology Bus topology is a network type in which every computer and network device is connected to single cable. When it has exactly.
Graphplan/ SATPlan Chapter
Graphplan/ SATPlan Chapter
Presentation transcript:

Modelling and Solving English Peg Solitaire Chris Jefferson, Angela Miguel, Ian Miguel, Armagan Tarim. AI Group Department of Computer Science University of York

English Peg Solitaire The French variant has a slightly larger board, and is considerably more difficult BeforeAfter Horizontal or vertical moves: Initial:Goal:

Solitaire: Interesting Features A challenging search problem. Highly symmetric. Symmetries of the board, symmetries of moves. Planning-style problem. Not usually tackled directly with constraint satisfaction/integer programming.

Model A: IP 31 moves required to solve a single-peg reversal. Exploit this in the modelling. bState[i,j,t] . describes the state of the board at time-step t = 0, …, 31. M[i,j,t,d] . denotes whether a move was made from location i, j at time-step t. d in {N, S, E, W}.

Model A: IP Move Conditions: `1’ means move made. Connecting board states. Consider all moves affecting a position

Model A: IP One move at a time: Objective function. Minimise:

Model B: CSP Rather than record the board state, model B records the sequence of moves required: moves[t] Each transition is assigned a unique number: No.Trans.No.Trans.No.Trans. 0 2, ,0 3 4, ,0 6 2, ,3 1 2, ,2 4 4,  2 7 3, ,3 2 3, ,2 5 2, ,1 8… 4, ,1

Model B: CSP Problem constraints can be stated on moves[] alone. Consider transition 0: 2, , 0 at time-step t. The following must hold at time-step t-1. There must be pegs at 2, 0 and 3, 0. There must be a hole at 4, 0. Ensure by imposing constraints on moves[1..t-1]: Drawback: many such constraints needed. Some of very large size

Model C = A + B: CSP Combines models A and B to remove some of the problems of both. Maintains: bState[i,j,t], moves[t]. Discards (A): M[], board state connection constraints. Discards (B): Large arity constraints on moves[]. Channelling constraints are added to maintain consistency between the two representations. These connect bState[i,j,t], moves[t], bState[i,j,t+1]. t bState[t] moves[] bState[t+1] constrains

Model C Channelling Constraints These constraints closely resemble pre- and post- conditions of an AI Planning-style operator. Changes(i,j): set of transitions that change the state of i, j pegIn(i,j): set of transitions that place a peg at i, j pegOut(i,j): set of transitions that remove a peg from i, j

Results: Central Solitaire Model A (IP): No solution in 12 hours. Several alternative formulations also failed. Reason: artificial objective function, hence no tight bounds to exploit. Model B (CP): Exhausts memory. Model C (A+B, CP solver): 16 seconds. So: Develop model C further. Apply to other variations of Solitaire.

Pagoda Functions Used to spot dead-ends early. Value assigned to each board position such that: Given positions a, b, c in a horizontal/vertical line: a+b  c. Pagoda value of a board state: Sum of values at positions where there is a peg. Monotonically decreasing as moves made: Pagoda condition: If pagoda value for an intermediate position is less than that of final position, backtrack. abcabc

Pagoda Functions: Examples For a single-peg Solitaire reversal at position i, j, want pagoda functions with non-zero entries at i, j. Otherwise no pruning. A rotation of one of these three gives a useful pagoda function for every board position:

Board Symmetries Rotation. Reflection. Break rotational symmetry by selecting 1 st move: Reflection symmetry persists. Remove 5,2  3,2:

Board Symmetries Further into the search are both broken and re- established, depending on the moves made. Breaking this symmetry is a possible application for SBDS or SBDD.

Symmetries of Independent Moves Many pairs of moves can be performed in any order without affecting the rest of the solutions. Two transitions are independent iff: The set of pegs upon which they operate do not intersect. Break this symmetry by ordering adjacent entries in moves[]: independent(moves[i], moves[i+1])  moves[i]  moves[i+1] This problem extends to larger sets of transitions. If 2 is independent of {3, 1}, can have 2, 3, 1 and 3, 1, 2.

Results: Solitaire Reversals Compared Model C against state of the art AI planning systems: Blackbox 4.2, FastForward 2.3, HSP 2.0, and Stan 4. Experiments on the full set of single-peg reversals. Although many board positions symmetrical, these positions are distinguished by the transition ordering. Transitions chosen in ascending order. No.Trans.No.Trans.No.Trans. 0 2, ,0 3 4, ,0 6 2, ,3 1 2, ,2 4 4,  2 7 3, ,3 2 3, ,2 5 2, ,1 8… 4, ,1

Solitaire Reversals via AI Planning >1hr >1hr 18 >1hr >1hr >1hr >1hr - >1hr >1hr >1hr 620 >1hr 574 >1hr >1hr BBox4.2 FF2.3 HSP2.0 Stan4 Bbox, FF most successful, achieve a high percentage of coverage. Note how symmetric positions differ. - memory exhausted. - >1hr >1hr

Solitaire Reversals via Model C ,3 >1hr >1hr >1hr >1hr Basic Pair Sym Breaking Pagoda Functions Pagoda+Sym Less robust. Bad value ordering? Sym breaking, pagoda help. Blank: all >1hr

Model C + Corner Bias Value Ordering ,3 >1hr >1hr >1hr >1hr Basic Pair Sym Breaking Pagoda Functions Pagoda+Sym Taking symmetry back into account, can now cover all but one reversal Blank: all >1hr

Symmetric Paths There are often multiple ways of arriving at the same board state. Some are due to independent moves. Others are not:

Symmetric Paths Find all solutions to a given depth. Group the transition sequences that lead to identical positions. Insert constraints that allow one representative per group. DepthSolutions Found Solutions Pruned Constraints Added Time (s) < Total

Fool’s Solitaire An optimisation variant. Reach a position where no further moves are possible in the shortest sequence of moves. Not easily stated as an AI planning problem. Shows the flexibility of the CP and IP approaches.

Fool’s Solitaire: IP Model Moves, connection of board states same as model A. New objective function. Minimise: C[i,j,t]=1 iff there is a peg at position i,j with a legal move.

Fool’s Solitaire: CP Model Modified version of model C. An extra transition, deadEnd, is added to the domain of the moves[] variables. Assigned when no other move is possible. deadEnd transition is only allowed when no other transitions are possible. Preconditions based on bState[]. If deadEnd at moves[t], then also at all following time-steps:

Fool’s Solitaire: Results CP, reverse instantiation order: 20s IP, iterative approach: 27s

Conclusions Basic, and ineffective CP and IP models combined into a superior CP model. Another instance of the utility of channelling between two complementary models. Each allows easy statement of different aspects of the problem: Model A: preconditions on state changes without considering entire move history. Model B: one move at once, combines 3 state changes into a single token.

Conclusions Encouraging results versus dedicated AI planning systems. Lessons learned should generalise to other sequential planning-style problems. Channelling constraints specify action pre- and post-conditions. Breaking symmetry of independent actions/paths.

Future Work Further configurations of English Solitaire. Other optimisation variants: Minimise number of draughts-like multiple moves using a single peg. Proving unsolvability. Large search space to explore. Will need improved symmetry breaking. French Solitaire.