Artificial Intelligence Lecture No. 6 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Problem Solving and Search Andrea Danyluk September 9, 2013.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
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.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Problem Solving What is AI way of solving problem?
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence Chapter 3: Solving Problems by Searching
Introduction to Artificial Intelligence Problem Solving Ruth Bergman Fall 2002.
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?
Solving problems by searching
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Solving problems by searching This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
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.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Artificial Intelligence
Problem Solving Agents
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2007 Lecture #2.
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 3 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 3 –Problem Solving Agents State space search –Programming Assignment Thursday.
1 Fahiem Bacchus, University of Toronto CSC384: Intro to Artificial Intelligence Search I ● Required Readings: Chapter 3. We won’t cover the material in.
Solving problems by searching
Solving problems by searching A I C h a p t e r 3.
Artificial Intelligence Lecture No. 8 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
G5AIAI Introduction to AI
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Solving problems by searching
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Artificial Intelligence Lecture No. 6
Problem Solving by Searching
Artificial Intelligence
Solving problems by searching
Solving problems by searching
Artificial Intelligence
EA C461 – Artificial Intelligence Problem Solving Agents
L2. Problem Solving Using Search
Solving problems by searching
Solving problems by searching
ARTIFICIAL INTELLIGENCE
Two – One Problem Legal Moves: Slide Rules: 1s’ move right Hop
Two – One Problem Legal Moves: Slide Rules: 1s’ move right Hop
Solving problems by searching
Solving Problems by Searching
CS440/ECE 448 Lecture 4: Search Intro
Solving problems by searching
Presentation transcript:

Artificial Intelligence Lecture No. 6 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology (CIIT) Islamabad, Pakistan.

Summary of Previous Lecture Different types of Environments IA examples based on Environment Agent types – Simple reflex agents – Reflex agents with state/model – Goal-based agents – Utility-based agents

Today’s Lecture Problem solving by searching What is Search? Problem formulation Search Space Definitions Goal-formulation Searching for Solutions Visualize Search Space as a Graphs

Problem-Solving Agent In which we look at how an agent can decide what to do by systematically considering the outcomes of various sequences of actions that it might take. - Stuart Russell & Peter Norvig

5 Problem solving agent A kind of Goal-based agent. Decide what to do by searching sequences of actions that lead to desirable states.

Problem Definition Initial state : starting point Operator: description of an action State space: all states reachable from the initial state by any sequence action Path: sequence of actions leading from one state to another Goal test: which the agent can apply to a single state description to determine if it is a goal state Path cost function: assign a cost to a path which the sum of the costs of the individual actions along the path.

What is Search? Search is the systematic examination of states to find path from the start/root state to the goal state. The set of possible states, together with operators defining their connectivity the search space. The output of a search algorithm is a solution, that is, a path from the initial state to a state that satisfies the goal test. In real life search usually results from a lack of knowledge. In AI too search is merely a offensive instrument with which to attack problems that we can't seem to solve any better way.

Search groups Search techniques fall into three groups: 1.Methods which find any start - goal path, 2.Methods which find the best path, 3.Search methods in the face of opponent.

Search An agent with several immediate options of unknown value can decide what to do by first examining different possible sequences of actions that lead to states of known value, and then choosing the best one. This process is called search. A search-algorithm takes a problem as input and returns a solution in the form of an action sequence.

Problem formulation What are the possible states of the world relevant for solving the problem? What information is accessible to the agent? How can the agent progress from state to state? Follows goal-formulation. Courtesy: Dr. Franz J. Kurfess

Well-defined problems and solutions A problem is a collection of information that the agent will use to decide what to do. Information needed to define a problem: – The initial state that the agent knows itself to be in. – The set of possible actions available to the agent. Operator denotes the description of an action in terms of which state will be reached by carrying out the action in a particular state. Also called Successor function S. Given a particular state x, S (x) returns the set of states reachable from x by any single action.

State space and a path State space is the set of all states reachable from the initial state by any sequence of actions. Path in the state space is simply any sequence of actions leading from one state to another.

Search Space Definitions Problem formulation – Describe a general problem as a search problem Solution – Sequence of actions that transitions the world from the initial state to a goal state Solution cost (additive) – Sum of the cost of operators – Alternative: sum of distances, number of steps, etc. Search – Process of looking for a solution – Search algorithm takes problem as input and returns solution – We are searching through a space of possible states Execution – Process of executing sequence of actions (solution)

Goal-formulation What is the goal state? What are important characteristics of the goal state? How does the agent know that it has reached the goal? Are there several possible goal states? – Are they equal or are some more preferable? Courtesy: Dr. Franz J. Kurfess

Goal We will consider a goal to be a set of world states – just those states in which the goal is satisfied. Actions can be viewed as causing transitions between world states.

Looking for Parking Going home; need to find street parking Formulate Goal: Car is parked Formulate Problem: States: street with parking and car at that street Actions: drive between street segments Find solution: Sequence of street segments, ending with a street with parking

Example Problem Start Street Street with Parking

Search Example Formulate goal: Be in Bucharest. Formulate problem: states are cities, operators drive between pairs of cities Find solution: Find a sequence of cities (e.g., Arad, Sibiu, Fagaras, Bucharest) that leads from the current state to a state meeting the goal condition

Problem Formulation A search problem is defined by the 1.Initial state (e.g., Arad) 2.Operators (e.g., Arad -> Zerind, Arad -> Sibiu, etc.) 3.Goal test (e.g., at Bucharest) 4.Solution cost (e.g., path cost)

Examples (2) Vacuum World 8 possible world states 3 possible actions: Left/Right/ Suck Goal: clean up all the dirt= state(7) or state(8)

Vacuum World States: S 1, S 2, S 3, S 4, S 5, S 6, S 7, S 8 Operators: Go Left, Go Right, Suck Goal test : no dirt left in both squares Path Cost: each action costs 1. S1S1 S2S2 S3S3 S6S6 S5S5 S4S4 S7S7 S8S8

Example Problems – Eight Puzzle States: tile locations Initial state: one specific tile configuration Operators: move blank tile left, right, up, or down Goal: tiles are numbered from one to eight around the square Path cost: cost of 1 per move (solution cost same as number of most or path length) Eight Puzzle

Single-State problem and Multiple-States problem World is accessible  agent’s sensors give enough information about which state it is in (so, it knows what each of its action does), then it calculate exactly which state it will be after any sequence of actions. Single-State problem world is inaccessible  agent has limited access to the world state, so it may have no sensors at all. It knows only that initial state is one of the set {1,2,3,4,5,6,7,8}. Multiple- States problem

Think of the graph defined as follows: – the nodes denote descriptions of a state of the world, e.g., which blocks are on top of what in a blocks scene, and where the links represent actions that change from one state to the other. – A path through such a graph (from a start node to a goal node) is a "plan of action" to achieve some desired goal state from some known starting state. It is this type of graph that is of more general interest in AI.

Searching for Solutions Visualize Search Space as a Tree States are nodes Actions are edges Initial state is root Solution is path from root to goal node Edges sometimes have associated costs States resulting from operator are children

Directed graphs A graph is also a set of nodes connected by links but where loops are allowed and a node can have multiple parents. We have two kinds of graphs to deal with: directed graphs, where the links have direction (one-way streets).

Undirected graphs undirected graphs where the links go both ways. You can think of an undirected graph as shorthand for a graph with directed links going each way between connected nodes.

Searching for solutions: Graphs or trees The map of all paths within a state-space is a graph of nodes which are connected by links. Now if we trace out all possible paths through the graph, and terminate paths before they return to nodes already visited on that path, we produce a search tree. Like graphs, trees have nodes, but they are linked by branches. The start node is called the root and nodes at the other ends are leaves. Nodes have generations of descendents. The aim of search is not to produce complete physical trees in memory, but rather explore as little of the virtual tree looking for root-goal paths.

Search Problem Example (as a tree) (start: Arad, goal: Bucharest.)

Summery of Today’s Lecture Problem solving by searching What is Search? Problem formulation Search Space Definitions Goal-formulation Examples Searching for Solutions Visualize Search Space as a Graphs Directed graphs and Undirected graphs