Solving Problems by Searching What is Problem-Solving?, State and Search Space - State graph, - Search ( State + Search), - Search Space . State and Search Space, - Eight Puzzle, - Robot Assembly, - Towers of Hanoi, - Rubik’s Cube, Searching Trees Methods, - Search Trees, - AND/OR Trees, - Game Trees. Search Methods, - Breadth-First Search, - Depth-First Search, Explore: Topics based Research Areas: @Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
36
Embed
Solving Problems by Searching - portals.au.edu.pkportals.au.edu.pk/imc/Content/course/lecs/Lecture-3 (Solving Proble… · - Between state and goal, there are intermediate states
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Solving Problems by Searching
What is Problem-Solving?,
State and Search Space
- State graph,
- Search ( State + Search),
- Search Space .
State and Search Space,
- Eight Puzzle,
- Robot Assembly,
- Towers of Hanoi,
- Rubik’s Cube,
Searching Trees Methods,
- Search Trees,
- AND/OR Trees,
- Game Trees.
Search Methods,
- Breadth-First Search,
- Depth-First Search,
Explore: Topics based
Research Areas:
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
1. What is Problem-Solving?
Problem-solving agents decide;
- what to do by finding sequences of
actions that lead to desirable states. (e.g.,
multi-ways to reach at destination).
- how the agent can formulate an
appropriate view of the problem.
The problem type that results from
the formulation process will
depend on the knowledge
available to the agent:
SimpleProblemSolvingAgent(percept)
state = UpdateState(state, percept)
if sequence is empty then
goal = FormulateGoal(state)
problem = FormulateProblem(state, goal)
sequence = Search(problem)
action = First(sequence)
sequence = Rest(sequence)
Return action
How an agent can decide what to do by systematically considering
the outcomes of various sequences of actions that it might take.
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space
State:-
To define a problem
- visualize a solution, or select a search method having various states
as input.
States often took help to express the problem in graphical terms.
Drawing a graph of the problem showing ;
- various problem states and how they are interconnected.
The resulting graph is usually referred to a state graph or state space.
INITIAL
STATE
PROCEDURES GOAL (S)
CONTROL
STRATEGY
Figure: The relationship between the initial states, procedures, and goal(s) in the search process@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Cont…)
State:- State graph: Description
The problem is to just reach the destination.
- Between state and goal, there are intermediate states or nodes are often called subgoals.
The nodes in a state graph are interconnected by arcs or links.
- these arcs usually have arrows showing the direction from one state to the next.
The number on the arcs represent the distance between nodes.
Problem:-
It is difficult to represent a state graph in software form (as shown in
Figure).
- Goal is just reaching destination, no value for the least amount of time
covering the shortest distance.
- Also, it facilitates as non-parallel processing.
Due to above difficulty, state graph is converted into a search tree.@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Cont…)
State:- State graph
Figure shows a state graph for a simple problem;
- attempting to find the best path from one city, the source (S), to another city, the
destination or goal (G).
The state graph is a map showing the various possible intermediate
towns and cities to reach the “desired destination”.
Figure: A state graph showing alternate routines from the start state (S) to the goal (G).
F
S B
A
C
D
E
H
G3
4
9
7
5
6
86
2
4
5
Alphabets = Names of cities,
Numbers = distance (Kms)
Covering distance = 20 km/min
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space
Search ( State + Search):-
Search expands the importance of AI.
What choices are we searching through?
– Problem solving
Action combinations (move 1, then move 3, then move 2...).
– Natural language
Ways to map words to parts of speech.
– Computer vision
Ways to map features to object model.
– Machine learning
Possible concepts that fit examples seen so far.
– Motion planning
Sequence of moves to reach goal destination.
An intelligent agent is trying to find a set or sequence of actions to
achieve a goal.
This is a goal-based agent.@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space
Search ( State + 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
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search SpaceSearch Space Definitions:-
Major factors used in searching process are;
• State
– A description of a possible state of the world. (e.g., total states).
– Includes all features of the world that are pertinent to the problem.
• Initial state
– Description of all pertinent aspects of the state in which the agent starts the
search.
• Goal test
– Conditions the agent is trying to meet (e.g., have $1M, reaching destination).
• Goal state
– Any state which meets the goal condition. (e.g., total combinations to reach
goal)
– Thursday, have $1M, live in baseball match.
– Friday, have $1M, live in TV show.
• Action
– Function that maps (transitions) from one state to another. (e.g., all
combination in 1 map)@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Cont…)Search Space Definitions:-
• Major factors used in searching process are;
• Problem formulation
– Describe a general problem as a search problem. (e.g., reach with safety).
• 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).@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Class Participation)
Apply all “10 major factors” used in searching process by considering following
examples:-
1) Initial state (e.g., Arad) , Goal test (e.g., at Bucharest)
2) Initial state (e.g., Arad) , Goal test (e.g., at Bucharest)
• State
• Initial state
• Goal test
• Goal state
• Action
• Problem
formulation
• Solution
• Solution cost
• Search
• Execution@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Cont…)Search Space Definitions:-
• Overall block flow diagram of basic searching process as;
• State
• Initial state
• Goal test
• Goal state
• Action
• Problem
formulation
• Solution
• Solution cost
• Search
• Execution
OPERATOR (S)(Solution, Solution cost)
CONTROL
STRATEGY(Search, Execution)
DATA BASE
- Initial States
- State
- Goal
- Goal State
- Action
- Problem formulation
Figure: The basic search process.
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)
2. State and Search Space (Cont…)Search Space :- 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 applet
@Copyrights: Advanced Artificial Intelligence Organized by Dr. Ahmad Jalal (http://portals.au.edu.pk/imc/)