Pedagogical Possibilities for the N-Puzzle Problem Zdravko Markov Central Connecticut State University, Ingrid Russell University of Hartford,

Slides:



Advertisements
Similar presentations
Announcements Course TA: Danny Kumar
Advertisements

Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
An Introduction to Artificial Intelligence
Todd W. Neller Gettysburg College
PROBLEM SOLVING AND SEARCH
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
Part2 AI as Representation and Search
Blind Search1 Solving problems by searching Chapter 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
Artificial Intelligence for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CPSC 322 Introduction to Artificial Intelligence October 27, 2004.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence
Relational Data Mining in Finance Haonan Zhang CFWin /04/2003.
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 580 Artificial Intelligence Problem Spaces and Search Fall 2008 Jingsong.
Implementing the Intelligent Systems Knowledge Units of Computing Curricula 2001 Ingrid Russell Todd Neller.
CSC344: AI for Games Lecture 4: Informed search
Solving problems by searching
Solving Problems by Searching
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Logic Programming Lecture 7: Search Strategies: Problem representations Depth-first, breadth-first, and AND/OR search.
Project MLExAI Machine Learning Experiences in AI Ingrid Russell, University.
WAES 3308 Numerical Methods for AI
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
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.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Artificial Intelligence LECTURE 4 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
1 Solving problems by searching 171, Class 2 Chapter 3.
Ch. 13 Ch. 131 jcmt CSE 3302 Programming Languages CSE3302 Programming Languages (notes?) Dr. Carter Tiernan.
Neural Heuristics For Problem Solving: Using ANNs to Develop Heuristics for the 8-Puzzle by Bambridge E. Peterson.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
MDPs (cont) & Reinforcement Learning
Artificial Intelligence for Games Informed Search (2) Patrick Olivier
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Slides by: Eric Ringger, adapted from slides by Stuart Russell of UC Berkeley. CS 312: Algorithm Design & Analysis Lecture #36: Best-first State- space.
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
A* Path Finding Ref: A-star tutorial.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Pedagogical Possibilities for the 2048 Puzzle Game Todd W. Neller.
Implementation: General Tree Search
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Solving problems by searching A I C h a p t e r 3.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Computing & Information Sciences Kansas State University Wednesday, 04 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 17 of 42 Wednesday, 04 October.
Computing & Information Sciences Kansas State University Friday, 13 Oct 2006CIS 490 / 730: Artificial Intelligence Lecture 21 of 42 Friday, 13 October.
For Monday Read chapter 4 exercise 1 No homework.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Problem Solving by Searching
Artificial Intelligence
Search.
Search.
Presentation transcript:

Pedagogical Possibilities for the N-Puzzle Problem Zdravko Markov Central Connecticut State University, Ingrid Russell University of Hartford, Todd Neller Gettysburg College, Neli Zlatareva Central Connecticut State University, This work was partially supported by NSF CCLI-A&I Award Number

Project MLExAI Enhance the student learning experience in the introductory Artificial Intelligence (AI) course by: Introducing Machine Learning (ML) elements into the AI course. Implementing a set of unifying ML laboratory projects to tie together the core AI topics. Developing, applying, and testing an adaptable framework for the presentation of core AI topics.

Solving the N-Puzzle Problem Project Good framework for illustrating the classical AI search in an interesting and motivating way. Suitable for introducing students to Analytical (Explanation-Based) Learning (EBL) using search. Hands-on experiments with search algorithms combined with an EBL component give students a deep, experiential understanding of both search and EBL.

The N-Puzzle Game Initial Configuration Goal Configuration 5 → Down 6 → Down 2 → Left 3 → Up 6 → Right 5 → Up 8 → Left Moves Large state space (3x3)!/2 = Not all states are reachable from a given state

State Space Representation (Prolog) ABC DEF B0C DEF 0BC DEF % Empty tile (0) in position A % Slide B left arc(s(0,B,C,D,E,F),s(B,0,C,D,E,F)). % Slide D up arc(s(0,B,C,D,E,F),s(D,B,C,0,E,F)). DBC 0EF s(A,B,C,D,E,F) Variables A,B,V,D,E,F  [1,5] 0 – empty tile

Why Prolog? Prolog code is concise and easily understood. Can be used at query level only. Access the database and run algorithms without actual programming. Suits well other important AI topics such as FOL, KR and Reasoning. Meta-programming features allow straightforward implementation of EBL techniques. Free implementations available, e.g. SWI-Prolog (

Sample Queries % Access database (one-move transitions) ?- arc(s(0,1,2,3,4,5),X). X = s(1,0,2,3,4,5) ; X = s(3,1,2,0,4,5) % A three-move solution does not exist ?- arc(s(0,4,5,1,2,3),X),arc(X,Y),arc(Y,s(4,2,5,1,0,3)). No % Find a two-move solution ?- arc(s(0,4,5,1,2,3),X),arc(X,s(4,2,5,1,0,3)). X = s(0,4,5,1,2,3) % Use the path predicate to find multiple move solutions ?- path(s(0,4,5,1,2,3),s(4,2,5,1,0,3),P). P = [s(4,0,5,1,2,3)]; P = [s(4,0,5,1,2,3),s(0,4,5,1,2,3),s(4,0,5,1,2,3)]

Sample Student Assignments Implement the state space representation of the 8- puzzle problem. Investigate the state space by experimenting with state space transitions at query level. What is the branching factor? Are there repeated states and how many? Use the path predicate to find paths between states. Investigate when and why infinite loops occur. What kind of search does the path predicate implement – depth-first or breadth-first?

Search breadth_first(+[[Start]],+Goal,-Path,-ExploredNodes) (+ Input, - Output) ?- breadth_first([[s(4,5,3,0,1,2)]],s(1,2,3,4,5,0),P,N), length(P,L). P = [s(1,2,3,4,5,0),s(1,2,3,4,0,5),s(1,0,3,4,2,5), s(0,1,3,4,2,5),s(4,1,3,0,2,5),s(4,1,3,2,0,5), s(4,1,3,2,5,0), s(4,1,0,2,5,3),...] N = 1197 L = 19

Sample Student Assignments Run uninformed and informed search algorithms (depth- first, breadth-first, iterative deepening, best-first, A-star, beam search) to solve s(4,5,3,0,1,2) => s(1,2,3,4,5,0). Represent the 8-puzzle problem s(2,3,5,0,1,4,6,7,8) => s(0,1,2,3,4,5,6,7,8). Try breadth-first, iterative deepening and depth-first. Explain why depth-first fails. Use heuristic search for s(2,3,5,0,1,4,6,7,8) => s(0,1,2,3,4,5,6,7,8). Try best-first, A-star and beam search. For beam search use n = 100, 10, 1. Explain why beam search fails with n=1? Collect statistics and analyze the time and space complexity of the above problems.

Explanation-Based Learning Target concept - state space search heuristic. Training example - good (efficient) solution of a state space search. Domain theory - state space representation. Operationality criteria - constraints associated with the state space search.

EBL in the N-Puzzle domain 1. Training example s(4,5,3,0,1,2)  s(5,1,3,4,2,0) 2. Verify if this is an instance of the target concept ?- breadth_first([[s(4,5,3,0,1,2)]],s(5,1,3,4,2,0),P,N). P = [s(5,1,3,4,2,0),s(5,1,3,4,0,2),s(5,0,3,4,1,2), s(0,5,3,4,1,2),s(4,5,3,0,1,2)] N = Explanation-Based Generalization (EBG) A  4, B  5, C  3, E  1, F  2, 0 remains 4. Add a new transition (new fact in the beginning of the database) arc(s(A,B,C,0,E,F), s(B,E,C,A,F,0)).

Speed-up Learning Before EBL (without arc(s(A,B,C,0,E,F),s(B,E,C,A,F,0)) ) ?- breadth_first([[s(4,5,3,0,1,2)]],s(1,2,3,4,5,0),P,N), length(P,L). P = [s(1,2,3,4,5,0),s(1,2,3,4,0,5),s(1,0,3,4,2,5), s(0,1,3,4,2,5),s(4,1,3,0,2,5),s(4,1,3,2,0,5), s(4,1,3,2,5,0), s(4,1,0,2,5,3),...] N = 1197 L = 19 After EBL (with arc(s(A,B,C,0,E,F),s(B,E,C,A,F,0)) ) ?- breadth_first([[s(4,5,3,0,1,2)]],s(1,2,3,4,5,0),P,N), length(P,L). P = [s(1,2,3,4,5,0),s(1,2,3,4,0,5),s(1,0,3,4,2,5), s(0,1,3,4,2,5),s(4,1,3,0,2,5),s(4,1,3,2,0,5), s(4,1,3,2,5,0), s(4,1,0,2,5,3),...] N = 647 L = 13

Sample Student Assignments Identify useful search heuristics and generate and verify the corresponding EBL training examples. Perform experiments with training examples and update the state transition database. Measure the improvement after the EBL step in terms of time and space complexity. Evaluate the effect of learning if too many or bad examples are supplied.

Conclusion N-puzzle project is used in an AI class in Spring Other projects developed in the framework of MLExAI are also tested Student surveys show positive results More tests and evaluations are ongoing All projects and other material are available at MLExAI web page at