Lecture 6: Problem Solving Dr John Levine 52236 Algorithms and Complexity February 10th 2006.

Slides:



Advertisements
Similar presentations
Order of complexity. Consider four algorithms 1.The naïve way of adding the numbers up to n 2.The smart way of adding the numbers up to n 3.A binary search.
Advertisements

Artificial Intelligence: Knowledge Representation
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Lecture 8: Informed Search Dr John Levine Algorithms and Complexity February 27th 2006.
Lecture 12: Revision Lecture Dr John Levine Algorithms and Complexity March 27th 2006.
Part2 AI as Representation and Search
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.4) January, 14, 2009.
Search in AI.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
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.
Algorithmic Complexity Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Blind State-Space Search Notes for Ch.11 of Bratko For CSCE 580 Sp03 Marco.
CS 206 Introduction to Computer Science II 09 / 10 / 2008 Instructor: Michael Eckmann.
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?
CS 206 Introduction to Computer Science II 09 / 05 / 2008 Instructor: Michael Eckmann.
Complexity 19-1 Parallel Computation Complexity Andrei Bulatov.
CS 206 Introduction to Computer Science II 01 / 28 / 2009 Instructor: Michael Eckmann.
The Future of Artificial Intelligence John Paxton Montana State University August 14, 2003.
1 Section 2.3 Complexity of Algorithms. 2 Computational Complexity Measure of algorithm efficiency in terms of: –Time: how long it takes computer to solve.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Analysis of Algorithm Lecture 3 Recurrence, control structure and few examples (Part 1) Huma Ayub (Assistant Professor) Department of Software Engineering.
Discrete Mathematics Algorithms. Introduction  An algorithm is a finite set of instructions with the following characteristics:  Precision: steps are.
1 State Space of a Problem Lecture 03 ITS033 – Programming & Algorithms Asst. Prof.
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.15.
Chapter 12 Recursion, Complexity, and Searching and Sorting
1 CO Games Development 1 Week 11 Search Methods Gareth Bellaby.
Problems you shouldn’t tackle. Problem Complexity.
Lecture 4: Sorting Algorithms Prof Branestawm’s Sorting Challenge.
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.
Program Efficiency & Complexity Analysis. Algorithm Review An algorithm is a definite procedure for solving a problem in finite number of steps Algorithm.
Lecture 7: Uninformed Search Dr John Levine Algorithms and Complexity February 13th 2006.
Assignment 2 (from last week) This is a pen-and-paper exercise, done in the same groups as for Practical 1 Your answer can be typeset or hand-written There.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
3.3 Complexity of Algorithms
Advanced Artificial Intelligence Lecture 2: Search.
PROBLEM SOLVING – BASIC SEARCH METHODS 12/8/2015Dr. Sunil Kumar 1.
Algorithm Analysis Part of slides are borrowed from UST.
Lecture # 39 What Can’t Be Computed?. Computability Tractable problems (P): Can be solved by a a computer is some deterministic (reasonable) polynomial.
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
CS 206 Introduction to Computer Science II 09 / 18 / 2009 Instructor: Michael Eckmann.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
CS 206 Introduction to Computer Science II 01 / 30 / 2009 Instructor: Michael Eckmann.
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
Complexity Analysis. 2 Complexity The complexity of an algorithm quantifies the resources needed as a function of the amount of input data size. The resource.
Chapter VI What should I know about the sizes and speeds of computers?
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.
Data Structures and Algorithms in Parallel Computing Lecture 8.
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.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
John Levine, Computer and Information Sciences, Strathclyde University 1 Algorithms and Complexity 2: Complexity Notation.
Warm Up HW check. Each cylinder is equivalent to two blocks. The balance problem is equivalent to x + 5 = 3x + 1, where a cylinder represents x and the.
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.
Solving problems by searching
Knowledge Representation
Introduction to Algorithms
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Introduction Defining the Problem as a State Space Search.
Teach A level Computing: Algorithms and Data Structures
Dynamic Programming.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Artificial Intelligence CIS 342
Presentation transcript:

Lecture 6: Problem Solving Dr John Levine Algorithms and Complexity February 10th 2006

Class admin No lab today and no lab next Monday Lab work starts next week Work in groups of no more than 6 (self selected) Single 2 hour session in the Kelvin lab (60 seats) Finding a slot – Fri 11-1? Thu 11 for lecture? Alternative 1: Mon 11-1? Alternative 2: Fri 1-3, moving the people doing the practical to a different slot

The story so far Lecture 1: Why algorithms are so important Lecture 2: Big-Oh notation, a first look at different complexity classes (log, linear, log-linear, quadratic, polynomial, exponential, factorial) Lecture 3: simple search in a list of items is O(n) with unordered data but O(log n) with ordered data, and can be even faster with a good indexing scheme and parallel processors Lecture 4: sorting: random sort O(n!), naïve sort is O(n 2 ), bubblesort is O(n 2 ), quicksort is O(n log n)

The story so far Lecture 5: more on sorting: why comparison sort is O(n log n), doing better than O(n log n) by not doing comparisons (e.g. bucket sort) Lecture 6: harder search: how to represent a problem in terms of states and moves Lecture 7: uninformed search through states using an agenda: depth-first search and breadth-first search Lecture 8: making it smart: informed search using heuristics; how to use heuristic search without losing optimality – the A* algorithm

Problem Solving using Search Many diverse problems involve search: Route finding Blocks World planning 15-puzzle Rubik’s cube Travelling salesman problem Crisis management Logistics planning

What are Problems? Each of these problems can be characterised by: Problem states, including the start state and the goal state Legal moves, or actions which transform problem states into other states Example: Rubik’s cube The start state is the muddled up cube, the goal is to have the state in which all sides are the same colour and the moves are the rotations of sides of the cube

Solutions Solutions are sequences of moves which transform the start state into the goal state The quality of the solution required will affect the amount of work we need to do –any solution will do –fixed amount of time, return best solution –near optimal solution needed –optimal solution needed

How to Solve it In general, problems can be solved using –knowledge –search –or some combination of the two

Formulating Problems A good formulation saves work –less search for the answer Three requirements for a search algorithm: –formal structures to describe the states –rules for manipulating them –identifying what constitutes a solution This gives us a state space representation

State Space Representation A state space comprises –states: snapshots of the problem –operators: how to move from one state to another Example problem: Towers of Hanoi Only move one disc at a time Never put a larger disc on top of a smaller one

State Space Search Problem solving using state space search consists of the following four steps: 1.Design a representation for states (including the initial state and the goal state) 2.Characterise the operators 3.Build a goal state recogniser 4.Search through the state space somehow by considering (in some or other order) the states reachable from the initial and goal states

Example: Blocks World A “classic” problem in AI planning The aim is to rearrange the blocks using the single robot arm so that the configuration in the goal state is achieved An optimal solution performs the transformation using as few steps as possible Any solution: linear complexity Optimal solution: exponential complexity (NP hard) C A B B A C

Blocks World Representation The blocks world problem can be represented as: States: stacks are lists, states are sets of stacks e.g. initial state = { [a,b],[c] } Transitions between states can be done using a single move operator: move(x,y) picks up object x and puts it on y (which may be the table) { [a,b,c] }  { [b,c],[a] } by applying move(a,table) { [a],[b,c] }  { [a,b,c] } by applying move(a,b)

Blocks World Representation NextStates(State)  list of legal moves and resulting states e.g. NextStates({ [a,b],[c] })  { [a],[b],[c] } by applying move(a,table) { [b],[a,c] } by applying move(a,b) { [c,a,b] } by applying move(c,a) Goal(State) returns true if State is identical with the goal state Search the space: start with the start state, explore reachable states, continue until the goal state is found

The Power of Search In May 1997, Garry Kasparov is beaten by Deep Blue Deep Blue is not a conventional computer: it uses specialised hardware to search 200,000,000 chess positions per second Is Deep Blue intelligent?