SlideShare a Scribd company logo
1 of 82
AI I: problem-
solving and search
Lecturer: Tom Lenaerts
Institut de Recherches Interdisciplinaires
et de Développements en Intelligence
Artificielle (IRIDIA)
Université Libre de Bruxelles
TLo (IRIDIA) 2October 13, 2015
Outline
 Problem-solving agents
 A kind of goal-based agent
 Problem types
 Single state (fully observable)
 Search with partial information
 Problem formulation
 Example problems
 Basic search algorithms
 Uninformed
TLo (IRIDIA) 3October 13, 2015
Problem-solving agent
 Four general steps in problem solving:
 Goal formulation
 What are the successful world states
 Problem formulation
 What actions and states to consider give the goal
 Search
 Determine the possible sequence of actions that lead to the states of
known values and then choosing the best sequence.
 Execute
 Give the solution perform the actions.
TLo (IRIDIA) 4October 13, 2015
Problem-solving agent
function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action
static: seq, an action sequence
state, some description of the current world state
goal, a goal
problem, a problem formulation
state ← UPDATE-STATE(state, percept)
if seq is empty then
goal ← FORMULATE-GOAL(state)
problem ← FORMULATE-PROBLEM(state,goal)
seq ← SEARCH(problem)
action ← FIRST(seq)
seq ← REST(seq)
return action
TLo (IRIDIA) 5October 13, 2015
Example: Romania
TLo (IRIDIA) 6October 13, 2015
Example: Romania
 On holiday in Romania; currently in Arad
 Flight leaves tomorrow from Bucharest
 Formulate goal
 Be in Bucharest
 Formulate problem
 States: various cities
 Actions: drive between cities
 Find solution
 Sequence of cities; e.g. Arad, Sibiu, Fagaras, Bucharest,
…
TLo (IRIDIA) 7October 13, 2015
Problem types
 Deterministic, fully observable ⇒ single state problem
 Agent knows exactly which state it will be in; solution is
a sequence.
 Partial knowledge of states and actions:
 Non-observable ⇒ sensorless or conformant problem
 Agent may have no idea where it is; solution (if any) is a sequence.
 Nondeterministic and/or partially observable ⇒
contingency problem
 Percepts provide new information about current state; solution is a
tree or policy; often interleave search and execution.
 Unknown state space ⇒ exploration problem (“online”)
 When states and actions of the environment are unknown.
TLo (IRIDIA) 8October 13, 2015
Example: vacuum world
 Single state, start in #5.
Solution??
TLo (IRIDIA) 9October 13, 2015
Example: vacuum world
 Single state, start in #5.
Solution??
 [Right, Suck]
TLo (IRIDIA) 10October 13, 2015
Example: vacuum world
 Single state, start in #5.
Solution??
 [Right, Suck]
 Sensorless: start in
{1,2,3,4,5,6,7,8} e.g Right
goes to {2,4,6,8}. Solution??
 Contingency: start in {1,3}.
(assume Murphy’s law, Suck
can dirty a clean carpet and
local sensing: [location,dirt]
only. Solution??
TLo (IRIDIA) 11October 13, 2015
Problem formulation
 A problem is defined by:
 An initial state, e.g. Arad
 Successor function S(X)= set of action-state pairs
 e.g. S(Arad)={<Arad → Zerind, Zerind>,…}
intial state + successor function = state space
 Goal test, can be
 Explicit, e.g. x=‘at bucharest’
 Implicit, e.g. checkmate(x)
 Path cost (additive)
 e.g. sum of distances, number of actions executed, …
 c(x,a,y) is the step cost, assumed to be >= 0
A solution is a sequence of actions from initial to goal state.
Optimal solution has the lowest path cost.
TLo (IRIDIA) 12October 13, 2015
Selecting a state space
 Real world is absurdly complex.
State space must be abstracted for problem solving.
 (Abstract) state = set of real states.
 (Abstract) action = complex combination of real actions.
 e.g. Arad →Zerind represents a complex set of possible routes,
detours, rest stops, etc.
 The abstraction is valid if the path between two states is
reflected in the real world.
 (Abstract) solution = set of real paths that are solutions in the real
world.
 Each abstract action should be “easier” than the real problem.
TLo (IRIDIA) 13October 13, 2015
Example: vacuum world
 States??
 Initial state??
 Actions??
 Goal test??
 Path cost??
TLo (IRIDIA) 14October 13, 2015
Example: vacuum world
 States?? two locations with or without dirt: 2 x 22
=8 states.
 Initial state?? Any state can be initial
 Actions?? {Left, Right, Suck}
 Goal test?? Check whether squares are clean.
 Path cost?? Number of actions to reach goal.
TLo (IRIDIA) 15October 13, 2015
Example: 8-puzzle
 States??
 Initial state??
 Actions??
 Goal test??
 Path cost??
TLo (IRIDIA) 16October 13, 2015
Example: 8-puzzle
 States?? Integer location of each tile
 Initial state?? Any state can be initial
 Actions?? {Left, Right, Up, Down}
 Goal test?? Check whether goal configuration is reached
 Path cost?? Number of actions to reach goal
TLo (IRIDIA) 17October 13, 2015
Example: 8-queens problem
 States??
 Initial state??
 Actions??
 Goal test??
 Path cost??
TLo (IRIDIA) 18October 13, 2015
Example: 8-queens problem
Incremental formulation vs. complete-state formulation
 States??
 Initial state??
 Actions??
 Goal test??
 Path cost??
TLo (IRIDIA) 19October 13, 2015
Example: 8-queens problem
Incremental formulation
 States?? Any arrangement of 0 to 8 queens on the board
 Initial state?? No queens
 Actions?? Add queen in empty square
 Goal test?? 8 queens on board and none attacked
 Path cost?? None
3 x 1014
possible sequences to investigate
TLo (IRIDIA) 20October 13, 2015
Example: 8-queens problem
Incremental formulation (alternative)
 States?? n (0≤ n≤ 8) queens on the board, one per column in the n leftmost
columns with no queen attacking another.
 Actions?? Add queen in leftmost empty column such that is not attacking
other queens
2057 possible sequences to investigate; Yet makes no difference
when n=100
TLo (IRIDIA) 21October 13, 2015
Example: robot assembly
 States??
 Initial state??
 Actions??
 Goal test??
 Path cost??
TLo (IRIDIA) 22October 13, 2015
Example: robot assembly
 States?? Real-valued coordinates of robot joint angles; parts of the object
to be assembled.
 Initial state?? Any arm position and object configuration.
 Actions?? Continuous motion of robot joints
 Goal test?? Complete assembly (without robot)
 Path cost?? Time to execute
TLo (IRIDIA) 23October 13, 2015
Basic search algorithms
 How do we find the solutions of previous problems?
 Search the state space (remember complexity of space
depends on state representation)
 Here: search through explicit tree generation
 ROOT= initial state.
 Nodes and leafs generated through successor function.
 In general search generates a graph (same state through
multiple paths)
TLo (IRIDIA) 24October 13, 2015
Simple tree search example
function TREE-SEARCH(problem, strategy) return a solution or failure
Initialize search tree to the initial state of the problem
do
if no candidates for expansion then return failure
choose leaf node for expansion according to strategy
if node contains goal state then return solution
else expand the node and add resulting nodes to the search tree
enddo
TLo (IRIDIA) 25October 13, 2015
Simple tree search example
function TREE-SEARCH(problem, strategy) return a solution or failure
Initialize search tree to the initial state of the problem
do
if no candidates for expansion then return failure
choose leaf node for expansion according to strategy
if node contains goal state then return solution
else expand the node and add resulting nodes to the search tree
enddo
TLo (IRIDIA) 26October 13, 2015
Simple tree search example
function TREE-SEARCH(problem, strategy) return a solution or failure
Initialize search tree to the initial state of the problem
do
if no candidates for expansion then return failure
choose leaf node for expansion according to strategy
if node contains goal state then return solution
else expand the node and add resulting nodes to the search tree
enddo
← Determines search process!!
TLo (IRIDIA) 27October 13, 2015
State space vs. search tree
 A state is a (representation of) a physical configuration
 A node is a data structure belong to a search tree
 A node has a parent, children, … and ncludes path cost, depth, …
 Here node= <state, parent-node, action, path-cost, depth>
 FRINGE= contains generated nodes which are not yet expanded.
 White nodes with black outline
TLo (IRIDIA) 28October 13, 2015
Tree search algorithm
function TREE-SEARCH(problem,fringe) return a solution or failure
fringe ← INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)
loop do
if EMPTY?(fringe) then return failure
node ← REMOVE-FIRST(fringe)
if GOAL-TEST[problem] applied to STATE[node] succeeds
then return SOLUTION(node)
fringe ← INSERT-ALL(EXPAND(node, problem), fringe)
TLo (IRIDIA) 29October 13, 2015
Tree search algorithm (2)
function EXPAND(node,problem) return a set of nodes
successors ← the empty set
for each <action, result> in SUCCESSOR-FN[problem](STATE[node]) do
s ← a new NODE
STATE[s] ← result
PARENT-NODE[s] ← node
ACTION[s] ← action
PATH-COST[s] ← PATH-COST[node] + STEP-COST(node, action,s)
DEPTH[s] ← DEPTH[node]+1
add s to successors
return successors
TLo (IRIDIA) 30October 13, 2015
Search strategies
 A strategy is defined by picking the order of node expansion.
 Problem-solving performance is measured in four ways:
 Completeness; Does it always find a solution if one exists?
 Optimality; Does it always find the least-cost solution?
 Time Complexity; Number of nodes generated/expanded?
 Space Complexity; Number of nodes stored in memory during
search?
 Time and space complexity are measured in terms of problem
difficulty defined by:
 b - maximum branching factor of the search tree
 d - depth of the least-cost solution
 m - maximum depth of the state space (may be ∞)
TLo (IRIDIA) 31October 13, 2015
Uninformed search strategies
 (a.k.a. blind search) = use only information available in
problem definition.
 When strategies can determine whether one non-goal
state is better than another → informed search.
 Categories defined by expansion algorithm:
 Breadth-first search
 Uniform-cost search
 Depth-first search
 Depth-limited search
 Iterative deepening search.
 Bidirectional search
TLo (IRIDIA) 32October 13, 2015
BF-search, an example
 Expand shallowest unexpanded node
 Implementation: fringe is a FIFO queue
A
TLo (IRIDIA) 33October 13, 2015
BF-search, an example
 Expand shallowest unexpanded node
 Implementation: fringe is a FIFO queue
A
B C
TLo (IRIDIA) 34October 13, 2015
BF-search, an example
 Expand shallowest unexpanded node
 Implementation: fringe is a FIFO queue
A
B C
D E
TLo (IRIDIA) 35October 13, 2015
BF-search, an example
 Expand shallowest unexpanded node
 Implementation: fringe is a FIFO queue
A
B C
D E F G
TLo (IRIDIA) 36October 13, 2015
BF-search; evaluation
 Completeness:
 Does it always find a solution if one exists?
 YES
 If shallowest goal node is at some finite depth d
 Condition: If b is finite
 (maximum num. Of succ. nodes is finite)
TLo (IRIDIA) 37October 13, 2015
BF-search; evaluation
 Completeness:
 YES (if b is finite)
 Time complexity:
 Assume a state space where every state has b successors.
 root has b successors, each node at the next level has again b successors
(total b2
), …
 Assume solution is at depth d
 Worst case; expand all but the last node at depth d
 Total numb. of nodes generated:
b+b2
+b3
+...+bd
+(bd+1
−b)=O(bd+1
)
TLo (IRIDIA) 38October 13, 2015
BF-search; evaluation
 Completeness:
 YES (if b is finite)
 Time complexity:
 Total numb. of nodes generated:
 Space complexity:
 Idem if each node is retained in memory
b+b2
+b3
+...+bd
+(bd+1
−b)=O(bd+1
)
TLo (IRIDIA) 39October 13, 2015
BF-search; evaluation
 Completeness:
 YES (if b is finite)
 Time complexity:
 Total numb. of nodes generated:
 Space complexity:
 Idem if each node is retained in memory
 Optimality:
 Does it always find the least-cost solution?
 In general YES
 unless actions have different cost.
b+b2
+b3
+...+bd
+(bd+1
−b)=O(bd+1
)
TLo (IRIDIA) 40October 13, 2015
BF-search; evaluation
 Two lessons:
 Memory requirements are a bigger problem than its execution
time.
 Exponential complexity search problems cannot be solved by
uninformed search methods for any but the smallest instances.
DEPTH2 NODES TIME MEMORY
2 1100 0.11 seconds 1 megabyte
4 111100 11 seconds 106 megabytes
6 107
19 minutes 10 gigabytes
8 109
31 hours 1 terabyte
10 1011
129 days 101 terabytes
12 1013
35 years 10 petabytes
14 1015
3523 years 1 exabyte
TLo (IRIDIA) 41October 13, 2015
Uniform-cost search
 Extension of BF-search:
 Expand node with lowest path cost
 Implementation: fringe = queue ordered by path
cost.
 UC-search is the same as BF-search when all
step-costs are equal.
TLo (IRIDIA) 42October 13, 2015
Uniform-cost search
 Completeness:
 YES, if step-cost > ε (smal positive constant)
 Time complexity:
 Assume C* the cost of the optimal solution.
 Assume that every action costs at least ε
 Worst-case:
 Space complexity:
 Idem to time complexity
 Optimality:
 nodes expanded in order of increasing path cost.
 YES, if complete.
O(bC*/ε
)
TLo (IRIDIA) 43October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
TLo (IRIDIA) 44October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
TLo (IRIDIA) 45October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
TLo (IRIDIA) 46October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I
TLo (IRIDIA) 47October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B
C
D E
H I
TLo (IRIDIA) 48October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I
TLo (IRIDIA) 49October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
TLo (IRIDIA) 50October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
TLo (IRIDIA) 51October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
TLo (IRIDIA) 52October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
F H
TLo (IRIDIA) 53October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
F H
L M
TLo (IRIDIA) 54October 13, 2015
DF-search, an example
 Expand deepest unexpanded node
 Implementation: fringe is a LIFO queue (=stack)
A
B C
D E
H I J K
F H
L M
TLo (IRIDIA) 55October 13, 2015
DF-search; evaluation
 Completeness;
 Does it always find a solution if one exists?
 NO
 unless search space is finite and no loops are possible.
TLo (IRIDIA) 56October 13, 2015
DF-search; evaluation
 Completeness;
 NO unless search space is finite.
 Time complexity;
 Terrible if m is much larger than d (depth of optimal
solution)
 But if many solutions, then faster than BF-search
O(bm
)
TLo (IRIDIA) 57October 13, 2015
DF-search; evaluation
 Completeness;
 NO unless search space is finite.
 Time complexity;
 Space complexity;
 Backtracking search uses even less memory
 One successor instead of all b.
O(bm+1)
O(bm
)
TLo (IRIDIA) 58October 13, 2015
DF-search; evaluation
 Completeness;
 NO unless search space is finite.
 Time complexity;
 Space complexity;
 Optimallity; No
 Same issues as completeness
 Assume node J and C contain goal states
O(bm+1)
O(bm
)
TLo (IRIDIA) 59October 13, 2015
Depth-limited search
 Is DF-search with depth limit l.
 i.e. nodes at depth l have no successors.
 Problem knowledge can be used
 Solves the infinite-path problem.
 If l < d then incompleteness results.
 If l > d then not optimal.
 Time complexity:
 Space complexity:
O(bl
)
O(bl)
TLo (IRIDIA) 60October 13, 2015
Depth-limited algorithm
function DEPTH-LIMITED-SEARCH(problem,limit) return a solution or failure/cutoff
return RECURSIVE-DLS(MAKE-NODE(INITIAL-STATE[problem]),problem,limit)
function RECURSIVE-DLS(node, problem, limit) return a solution or failure/cutoff
cutoff_occurred? ← false
if GOAL-TEST[problem](STATE[node]) then return SOLUTION(node)
else if DEPTH[node] == limit then return cutoff
else for each successor in EXPAND(node, problem) do
result ← RECURSIVE-DLS(successor, problem, limit)
if result == cutoff then cutoff_occurred? ← true
else if result ≠ failure then return result
if cutoff_occurred? then return cutoff else return failure
TLo (IRIDIA) 61October 13, 2015
Iterative deepening search
 What?
 A general strategy to find best depth limit l.
 Goals is found at depth d, the depth of the shallowest
goal-node.
 Often used in combination with DF-search
 Combines benefits of DF- en BF-search
TLo (IRIDIA) 62October 13, 2015
Iterative deepening search
function ITERATIVE_DEEPENING_SEARCH(problem) return a solution or failure
inputs: problem
for depth ← 0 to ∞ do
result ← DEPTH-LIMITED_SEARCH(problem, depth)
if result ≠ cuttoff then return result
TLo (IRIDIA) 63October 13, 2015
ID-search, example
 Limit=0
TLo (IRIDIA) 64October 13, 2015
ID-search, example
 Limit=1
TLo (IRIDIA) 65October 13, 2015
ID-search, example
 Limit=2
TLo (IRIDIA) 66October 13, 2015
ID-search, example
 Limit=3
TLo (IRIDIA) 67October 13, 2015
ID search, evaluation
 Completeness:
 YES (no infinite paths)
TLo (IRIDIA) 68October 13, 2015
ID search, evaluation
 Completeness:
 YES (no infinite paths)
 Time complexity:
 Algorithm seems costly due to repeated generation of certain
states.
 Node generation:
 level d: once
 level d-1: 2
 level d-2: 3
 …
 level 2: d-1
 level 1: d
N(IDS)=(d)b+(d−1)b2
+...+(1)bd
N(BFS)=b+b2
+...+bd
+(bd+1
−b)
O(bd
)
N(IDS)=50+400+3000+20000+100000=123450
N(BFS)=10+100+1000+10000+100000+999990=1111100
Num. Comparison for b=10 and d=5 solution at far right
TLo (IRIDIA) 69October 13, 2015
ID search, evaluation
 Completeness:
 YES (no infinite paths)
 Time complexity:
 Space complexity:
 Cfr. depth-first search
O(bd
)
O(bd)
TLo (IRIDIA) 70October 13, 2015
ID search, evaluation
 Completeness:
 YES (no infinite paths)
 Time complexity:
 Space complexity:
 Optimality:
 YES if step cost is 1.
 Can be extended to iterative lengthening search
 Same idea as uniform-cost search
 Increases overhead.
O(bd
)
O(bd)
TLo (IRIDIA) 71October 13, 2015
Bidirectional search
 Two simultaneous searches from start an goal.
 Motivation:
 Check whether the node belongs to the other fringe before
expansion.
 Space complexity is the most significant weakness.
 Complete and optimal if both searches are BF.
bd/2
+bd/2
≠bd
TLo (IRIDIA) 72October 13, 2015
How to search backwards?
 The predecessor of each node should be efficiently computable.
 When actions are easily reversible.
TLo (IRIDIA) 73October 13, 2015
Summary of algorithms
Criterion Breadth-
First
Uniform-
cost
Depth-First Depth-
limited
Iterative
deepening
Bidirectional
search
Complete? YES* YES* NO YES,
if l ≥ d
YES YES*
Time bd+1
bC*/e
bm
bl
bd
bd/2
Space bd+1
bC*/e
bm bl bd bd/2
Optimal? YES* YES* NO NO YES YES
TLo (IRIDIA) 74October 13, 2015
Repeated states
 Failure to detect repeated states can turn a solvable
problems into unsolvable ones.
TLo (IRIDIA) 75October 13, 2015
Graph search algorithm
 Closed list stores all expanded nodes
function GRAPH-SEARCH(problem,fringe) return a solution or failure
closed ← an empty set
fringe ← INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)
loop do
if EMPTY?(fringe) then return failure
node ← REMOVE-FIRST(fringe)
if GOAL-TEST[problem] applied to STATE[node] succeeds
then return SOLUTION(node)
if STATE[node] is not in closed then
add STATE[node] to closed
fringe ← INSERT-ALL(EXPAND(node, problem), fringe)
TLo (IRIDIA) 76October 13, 2015
Graph search, evaluation
 Optimality:
 GRAPH-SEARCH discard newly discovered paths.
 This may result in a sub-optimal solution
 YET: when uniform-cost search or BF-search with constant step
cost
 Time and space complexity,
 proportional to the size of the state space
(may be much smaller than O(bd
)).
 DF- and ID-search with closed list no longer has linear
space requirements since all nodes are stored in closed
list!!
TLo (IRIDIA) 77October 13, 2015
Search with partial information
 Previous assumption:
 Environment is fully observable
 Environment is deterministic
 Agent knows the effects of its actions
What if knowledge of states or actions is incomplete?
TLo (IRIDIA) 78October 13, 2015
Search with partial information
 (SLIDE 7) Partial knowledge of states and actions:
 sensorless or conformant problem
 Agent may have no idea where it is; solution (if any) is a sequence.
 contingency problem
 Percepts provide new information about current state; solution is a
tree or policy; often interleave search and execution.
 If uncertainty is caused by actions of another agent: adversarial
problem
 exploration problem
 When states and actions of the environment are unknown.
TLo (IRIDIA) 79October 13, 2015
Conformant problems
 start in {1,2,3,4,5,6,7,8}
e.g Right goes to
{2,4,6,8}. Solution??
 [Right, Suck, Left,Suck]
 When the world is not
fully observable: reason
about a set of states that
migth be reached
=belief state
TLo (IRIDIA) 80October 13, 2015
Conformant problems
 Search space of belief
states
 Solution = belief state
with all members goal
states.
 If S states then 2S
belief
states.
 Murphy’s law:
 Suck can dirty a clear
square.
TLo (IRIDIA) 81October 13, 2015
Belief state of vacuum-world
TLo (IRIDIA) 82October 13, 2015
Contingency problems
 Contingency, start in {1,3}.
 Murphy’s law, Suck can dirty a clean
carpet.
 Local sensing: dirt, location only.
 Percept = [L,Dirty] ={1,3}
 [Suck] = {5,7}
 [Right] ={6,8}
 [Suck] in {6}={8} (Success)
 BUT [Suck] in {8} = failure
 Solution??
 Belief-state: no fixed action
sequence guarantees solution
 Relax requirement:
 [Suck, Right, if [R,dirty] then Suck]
 Select actions based on
contingencies arising during
execution.

More Related Content

What's hot

State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniquesKirti Verma
 
Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)Nazir Ahmed
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceSahil Kumar
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligencegrinu
 
4 informed-search
4 informed-search4 informed-search
4 informed-searchMhd Sb
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
State Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxState Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxRSAISHANKAR
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)Bablu Shofi
 
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Garry D. Lasaga
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence Lalit Birla
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search techniqueKapil Dahal
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data MiningAtul Khanna
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculusRajendran
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAsst.prof M.Gokilavani
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Yasir Khan
 

What's hot (20)

State space search and Problem Solving techniques
State space search and Problem Solving techniquesState space search and Problem Solving techniques
State space search and Problem Solving techniques
 
Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)
 
Genetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial IntelligenceGenetic Algorithms - Artificial Intelligence
Genetic Algorithms - Artificial Intelligence
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
Hill climbing algorithm
Hill climbing algorithmHill climbing algorithm
Hill climbing algorithm
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
State Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxState Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptx
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
Introduction Artificial Intelligence a modern approach by Russel and Norvig 1
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
 
Genetic algorithms in Data Mining
Genetic algorithms in Data MiningGenetic algorithms in Data Mining
Genetic algorithms in Data Mining
 
I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
Predicate calculus
Predicate calculusPredicate calculus
Predicate calculus
 
AI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptxAI_Session 10 Local search in continious space.pptx
AI_Session 10 Local search in continious space.pptx
 
Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence Knowledge Representation in Artificial intelligence
Knowledge Representation in Artificial intelligence
 

Similar to AI I: problem-solving and search techniques explained

2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdfAmirMohamedNabilSale
 
Ai lecture 04(unit-02)
Ai lecture  04(unit-02)Ai lecture  04(unit-02)
Ai lecture 04(unit-02)vikas dhakane
 
Ai lecture 06(unit-02)
Ai lecture 06(unit-02)Ai lecture 06(unit-02)
Ai lecture 06(unit-02)vikas dhakane
 
Using Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataUsing Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataAnalyticsWeek
 
Seven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersSeven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersKevlin Henney
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 aiRadhika Srinivasan
 
SDRule-L: Managing Semantically Rich Business Decision Processes
SDRule-L: Managing Semantically Rich Business Decision ProcessesSDRule-L: Managing Semantically Rich Business Decision Processes
SDRule-L: Managing Semantically Rich Business Decision ProcessesChristophe Debruyne
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial IntelligenceMhd Sb
 
Julia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJulia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJiahao Chen
 
Algorithms AIMA 3 Edition
Algorithms AIMA 3 EditionAlgorithms AIMA 3 Edition
Algorithms AIMA 3 EditionLori Moore
 
AI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxAI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxYousef Aburawi
 
Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018Codemotion
 
Introduction to Machine Learning and Deep Learning
Introduction to Machine Learning and Deep LearningIntroduction to Machine Learning and Deep Learning
Introduction to Machine Learning and Deep LearningTerry Taewoong Um
 
Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)CS, NcState
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsSlimAmiri
 

Similar to AI I: problem-solving and search techniques explained (20)

5 csp
5 csp5 csp
5 csp
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf2.a-CMPS 403-F20-Session 2-Search Problems.pdf
2.a-CMPS 403-F20-Session 2-Search Problems.pdf
 
Ai lecture 04(unit-02)
Ai lecture  04(unit-02)Ai lecture  04(unit-02)
Ai lecture 04(unit-02)
 
Ai lecture 06(unit-02)
Ai lecture 06(unit-02)Ai lecture 06(unit-02)
Ai lecture 06(unit-02)
 
Using Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigDataUsing Topological Data Analysis on your BigData
Using Topological Data Analysis on your BigData
 
Seven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java ProgrammersSeven Ineffective Coding Habits of Many Java Programmers
Seven Ineffective Coding Habits of Many Java Programmers
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai
 
SDRule-L: Managing Semantically Rich Business Decision Processes
SDRule-L: Managing Semantically Rich Business Decision ProcessesSDRule-L: Managing Semantically Rich Business Decision Processes
SDRule-L: Managing Semantically Rich Business Decision Processes
 
2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence2-Agents- Artificial Intelligence
2-Agents- Artificial Intelligence
 
Julia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performanceJulia: Multimethods for abstraction and performance
Julia: Multimethods for abstraction and performance
 
Algorithms AIMA 3 Edition
Algorithms AIMA 3 EditionAlgorithms AIMA 3 Edition
Algorithms AIMA 3 Edition
 
AI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxAI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptx
 
Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018Mario Fusco - Lazy Java - Codemotion Milan 2018
Mario Fusco - Lazy Java - Codemotion Milan 2018
 
Lazy java
Lazy javaLazy java
Lazy java
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
 
Lazy Java
Lazy JavaLazy Java
Lazy Java
 
Introduction to Machine Learning and Deep Learning
Introduction to Machine Learning and Deep LearningIntroduction to Machine Learning and Deep Learning
Introduction to Machine Learning and Deep Learning
 
Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)Next Generation “Treatment Learning” (finding the diamonds in the dust)
Next Generation “Treatment Learning” (finding the diamonds in the dust)
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , probloms
 

More from Mhd Sb

AI ch6
AI ch6AI ch6
AI ch6Mhd Sb
 
AI ch5
AI ch5AI ch5
AI ch5Mhd Sb
 
AI ch4
AI ch4AI ch4
AI ch4Mhd Sb
 
AI ch3
AI ch3AI ch3
AI ch3Mhd Sb
 
Ai ch2
Ai ch2Ai ch2
Ai ch2Mhd Sb
 
Ai ch1
Ai ch1Ai ch1
Ai ch1Mhd Sb
 
6 games
6 games6 games
6 gamesMhd Sb
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceMhd Sb
 

More from Mhd Sb (8)

AI ch6
AI ch6AI ch6
AI ch6
 
AI ch5
AI ch5AI ch5
AI ch5
 
AI ch4
AI ch4AI ch4
AI ch4
 
AI ch3
AI ch3AI ch3
AI ch3
 
Ai ch2
Ai ch2Ai ch2
Ai ch2
 
Ai ch1
Ai ch1Ai ch1
Ai ch1
 
6 games
6 games6 games
6 games
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 

Recently uploaded

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgsaravananr517913
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 

Recently uploaded (20)

Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfgUnit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
Unit7-DC_Motors nkkjnsdkfnfcdfknfdgfggfg
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 

AI I: problem-solving and search techniques explained

  • 1. AI I: problem- solving and search Lecturer: Tom Lenaerts Institut de Recherches Interdisciplinaires et de Développements en Intelligence Artificielle (IRIDIA) Université Libre de Bruxelles
  • 2. TLo (IRIDIA) 2October 13, 2015 Outline  Problem-solving agents  A kind of goal-based agent  Problem types  Single state (fully observable)  Search with partial information  Problem formulation  Example problems  Basic search algorithms  Uninformed
  • 3. TLo (IRIDIA) 3October 13, 2015 Problem-solving agent  Four general steps in problem solving:  Goal formulation  What are the successful world states  Problem formulation  What actions and states to consider give the goal  Search  Determine the possible sequence of actions that lead to the states of known values and then choosing the best sequence.  Execute  Give the solution perform the actions.
  • 4. TLo (IRIDIA) 4October 13, 2015 Problem-solving agent function SIMPLE-PROBLEM-SOLVING-AGENT(percept) return an action static: seq, an action sequence state, some description of the current world state goal, a goal problem, a problem formulation state ← UPDATE-STATE(state, percept) if seq is empty then goal ← FORMULATE-GOAL(state) problem ← FORMULATE-PROBLEM(state,goal) seq ← SEARCH(problem) action ← FIRST(seq) seq ← REST(seq) return action
  • 5. TLo (IRIDIA) 5October 13, 2015 Example: Romania
  • 6. TLo (IRIDIA) 6October 13, 2015 Example: Romania  On holiday in Romania; currently in Arad  Flight leaves tomorrow from Bucharest  Formulate goal  Be in Bucharest  Formulate problem  States: various cities  Actions: drive between cities  Find solution  Sequence of cities; e.g. Arad, Sibiu, Fagaras, Bucharest, …
  • 7. TLo (IRIDIA) 7October 13, 2015 Problem types  Deterministic, fully observable ⇒ single state problem  Agent knows exactly which state it will be in; solution is a sequence.  Partial knowledge of states and actions:  Non-observable ⇒ sensorless or conformant problem  Agent may have no idea where it is; solution (if any) is a sequence.  Nondeterministic and/or partially observable ⇒ contingency problem  Percepts provide new information about current state; solution is a tree or policy; often interleave search and execution.  Unknown state space ⇒ exploration problem (“online”)  When states and actions of the environment are unknown.
  • 8. TLo (IRIDIA) 8October 13, 2015 Example: vacuum world  Single state, start in #5. Solution??
  • 9. TLo (IRIDIA) 9October 13, 2015 Example: vacuum world  Single state, start in #5. Solution??  [Right, Suck]
  • 10. TLo (IRIDIA) 10October 13, 2015 Example: vacuum world  Single state, start in #5. Solution??  [Right, Suck]  Sensorless: start in {1,2,3,4,5,6,7,8} e.g Right goes to {2,4,6,8}. Solution??  Contingency: start in {1,3}. (assume Murphy’s law, Suck can dirty a clean carpet and local sensing: [location,dirt] only. Solution??
  • 11. TLo (IRIDIA) 11October 13, 2015 Problem formulation  A problem is defined by:  An initial state, e.g. Arad  Successor function S(X)= set of action-state pairs  e.g. S(Arad)={<Arad → Zerind, Zerind>,…} intial state + successor function = state space  Goal test, can be  Explicit, e.g. x=‘at bucharest’  Implicit, e.g. checkmate(x)  Path cost (additive)  e.g. sum of distances, number of actions executed, …  c(x,a,y) is the step cost, assumed to be >= 0 A solution is a sequence of actions from initial to goal state. Optimal solution has the lowest path cost.
  • 12. TLo (IRIDIA) 12October 13, 2015 Selecting a state space  Real world is absurdly complex. State space must be abstracted for problem solving.  (Abstract) state = set of real states.  (Abstract) action = complex combination of real actions.  e.g. Arad →Zerind represents a complex set of possible routes, detours, rest stops, etc.  The abstraction is valid if the path between two states is reflected in the real world.  (Abstract) solution = set of real paths that are solutions in the real world.  Each abstract action should be “easier” than the real problem.
  • 13. TLo (IRIDIA) 13October 13, 2015 Example: vacuum world  States??  Initial state??  Actions??  Goal test??  Path cost??
  • 14. TLo (IRIDIA) 14October 13, 2015 Example: vacuum world  States?? two locations with or without dirt: 2 x 22 =8 states.  Initial state?? Any state can be initial  Actions?? {Left, Right, Suck}  Goal test?? Check whether squares are clean.  Path cost?? Number of actions to reach goal.
  • 15. TLo (IRIDIA) 15October 13, 2015 Example: 8-puzzle  States??  Initial state??  Actions??  Goal test??  Path cost??
  • 16. TLo (IRIDIA) 16October 13, 2015 Example: 8-puzzle  States?? Integer location of each tile  Initial state?? Any state can be initial  Actions?? {Left, Right, Up, Down}  Goal test?? Check whether goal configuration is reached  Path cost?? Number of actions to reach goal
  • 17. TLo (IRIDIA) 17October 13, 2015 Example: 8-queens problem  States??  Initial state??  Actions??  Goal test??  Path cost??
  • 18. TLo (IRIDIA) 18October 13, 2015 Example: 8-queens problem Incremental formulation vs. complete-state formulation  States??  Initial state??  Actions??  Goal test??  Path cost??
  • 19. TLo (IRIDIA) 19October 13, 2015 Example: 8-queens problem Incremental formulation  States?? Any arrangement of 0 to 8 queens on the board  Initial state?? No queens  Actions?? Add queen in empty square  Goal test?? 8 queens on board and none attacked  Path cost?? None 3 x 1014 possible sequences to investigate
  • 20. TLo (IRIDIA) 20October 13, 2015 Example: 8-queens problem Incremental formulation (alternative)  States?? n (0≤ n≤ 8) queens on the board, one per column in the n leftmost columns with no queen attacking another.  Actions?? Add queen in leftmost empty column such that is not attacking other queens 2057 possible sequences to investigate; Yet makes no difference when n=100
  • 21. TLo (IRIDIA) 21October 13, 2015 Example: robot assembly  States??  Initial state??  Actions??  Goal test??  Path cost??
  • 22. TLo (IRIDIA) 22October 13, 2015 Example: robot assembly  States?? Real-valued coordinates of robot joint angles; parts of the object to be assembled.  Initial state?? Any arm position and object configuration.  Actions?? Continuous motion of robot joints  Goal test?? Complete assembly (without robot)  Path cost?? Time to execute
  • 23. TLo (IRIDIA) 23October 13, 2015 Basic search algorithms  How do we find the solutions of previous problems?  Search the state space (remember complexity of space depends on state representation)  Here: search through explicit tree generation  ROOT= initial state.  Nodes and leafs generated through successor function.  In general search generates a graph (same state through multiple paths)
  • 24. TLo (IRIDIA) 24October 13, 2015 Simple tree search example function TREE-SEARCH(problem, strategy) return a solution or failure Initialize search tree to the initial state of the problem do if no candidates for expansion then return failure choose leaf node for expansion according to strategy if node contains goal state then return solution else expand the node and add resulting nodes to the search tree enddo
  • 25. TLo (IRIDIA) 25October 13, 2015 Simple tree search example function TREE-SEARCH(problem, strategy) return a solution or failure Initialize search tree to the initial state of the problem do if no candidates for expansion then return failure choose leaf node for expansion according to strategy if node contains goal state then return solution else expand the node and add resulting nodes to the search tree enddo
  • 26. TLo (IRIDIA) 26October 13, 2015 Simple tree search example function TREE-SEARCH(problem, strategy) return a solution or failure Initialize search tree to the initial state of the problem do if no candidates for expansion then return failure choose leaf node for expansion according to strategy if node contains goal state then return solution else expand the node and add resulting nodes to the search tree enddo ← Determines search process!!
  • 27. TLo (IRIDIA) 27October 13, 2015 State space vs. search tree  A state is a (representation of) a physical configuration  A node is a data structure belong to a search tree  A node has a parent, children, … and ncludes path cost, depth, …  Here node= <state, parent-node, action, path-cost, depth>  FRINGE= contains generated nodes which are not yet expanded.  White nodes with black outline
  • 28. TLo (IRIDIA) 28October 13, 2015 Tree search algorithm function TREE-SEARCH(problem,fringe) return a solution or failure fringe ← INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe) loop do if EMPTY?(fringe) then return failure node ← REMOVE-FIRST(fringe) if GOAL-TEST[problem] applied to STATE[node] succeeds then return SOLUTION(node) fringe ← INSERT-ALL(EXPAND(node, problem), fringe)
  • 29. TLo (IRIDIA) 29October 13, 2015 Tree search algorithm (2) function EXPAND(node,problem) return a set of nodes successors ← the empty set for each <action, result> in SUCCESSOR-FN[problem](STATE[node]) do s ← a new NODE STATE[s] ← result PARENT-NODE[s] ← node ACTION[s] ← action PATH-COST[s] ← PATH-COST[node] + STEP-COST(node, action,s) DEPTH[s] ← DEPTH[node]+1 add s to successors return successors
  • 30. TLo (IRIDIA) 30October 13, 2015 Search strategies  A strategy is defined by picking the order of node expansion.  Problem-solving performance is measured in four ways:  Completeness; Does it always find a solution if one exists?  Optimality; Does it always find the least-cost solution?  Time Complexity; Number of nodes generated/expanded?  Space Complexity; Number of nodes stored in memory during search?  Time and space complexity are measured in terms of problem difficulty defined by:  b - maximum branching factor of the search tree  d - depth of the least-cost solution  m - maximum depth of the state space (may be ∞)
  • 31. TLo (IRIDIA) 31October 13, 2015 Uninformed search strategies  (a.k.a. blind search) = use only information available in problem definition.  When strategies can determine whether one non-goal state is better than another → informed search.  Categories defined by expansion algorithm:  Breadth-first search  Uniform-cost search  Depth-first search  Depth-limited search  Iterative deepening search.  Bidirectional search
  • 32. TLo (IRIDIA) 32October 13, 2015 BF-search, an example  Expand shallowest unexpanded node  Implementation: fringe is a FIFO queue A
  • 33. TLo (IRIDIA) 33October 13, 2015 BF-search, an example  Expand shallowest unexpanded node  Implementation: fringe is a FIFO queue A B C
  • 34. TLo (IRIDIA) 34October 13, 2015 BF-search, an example  Expand shallowest unexpanded node  Implementation: fringe is a FIFO queue A B C D E
  • 35. TLo (IRIDIA) 35October 13, 2015 BF-search, an example  Expand shallowest unexpanded node  Implementation: fringe is a FIFO queue A B C D E F G
  • 36. TLo (IRIDIA) 36October 13, 2015 BF-search; evaluation  Completeness:  Does it always find a solution if one exists?  YES  If shallowest goal node is at some finite depth d  Condition: If b is finite  (maximum num. Of succ. nodes is finite)
  • 37. TLo (IRIDIA) 37October 13, 2015 BF-search; evaluation  Completeness:  YES (if b is finite)  Time complexity:  Assume a state space where every state has b successors.  root has b successors, each node at the next level has again b successors (total b2 ), …  Assume solution is at depth d  Worst case; expand all but the last node at depth d  Total numb. of nodes generated: b+b2 +b3 +...+bd +(bd+1 −b)=O(bd+1 )
  • 38. TLo (IRIDIA) 38October 13, 2015 BF-search; evaluation  Completeness:  YES (if b is finite)  Time complexity:  Total numb. of nodes generated:  Space complexity:  Idem if each node is retained in memory b+b2 +b3 +...+bd +(bd+1 −b)=O(bd+1 )
  • 39. TLo (IRIDIA) 39October 13, 2015 BF-search; evaluation  Completeness:  YES (if b is finite)  Time complexity:  Total numb. of nodes generated:  Space complexity:  Idem if each node is retained in memory  Optimality:  Does it always find the least-cost solution?  In general YES  unless actions have different cost. b+b2 +b3 +...+bd +(bd+1 −b)=O(bd+1 )
  • 40. TLo (IRIDIA) 40October 13, 2015 BF-search; evaluation  Two lessons:  Memory requirements are a bigger problem than its execution time.  Exponential complexity search problems cannot be solved by uninformed search methods for any but the smallest instances. DEPTH2 NODES TIME MEMORY 2 1100 0.11 seconds 1 megabyte 4 111100 11 seconds 106 megabytes 6 107 19 minutes 10 gigabytes 8 109 31 hours 1 terabyte 10 1011 129 days 101 terabytes 12 1013 35 years 10 petabytes 14 1015 3523 years 1 exabyte
  • 41. TLo (IRIDIA) 41October 13, 2015 Uniform-cost search  Extension of BF-search:  Expand node with lowest path cost  Implementation: fringe = queue ordered by path cost.  UC-search is the same as BF-search when all step-costs are equal.
  • 42. TLo (IRIDIA) 42October 13, 2015 Uniform-cost search  Completeness:  YES, if step-cost > ε (smal positive constant)  Time complexity:  Assume C* the cost of the optimal solution.  Assume that every action costs at least ε  Worst-case:  Space complexity:  Idem to time complexity  Optimality:  nodes expanded in order of increasing path cost.  YES, if complete. O(bC*/ε )
  • 43. TLo (IRIDIA) 43October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A
  • 44. TLo (IRIDIA) 44October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C
  • 45. TLo (IRIDIA) 45October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E
  • 46. TLo (IRIDIA) 46October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I
  • 47. TLo (IRIDIA) 47October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I
  • 48. TLo (IRIDIA) 48October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I
  • 49. TLo (IRIDIA) 49October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K
  • 50. TLo (IRIDIA) 50October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K
  • 51. TLo (IRIDIA) 51October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K
  • 52. TLo (IRIDIA) 52October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K F H
  • 53. TLo (IRIDIA) 53October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K F H L M
  • 54. TLo (IRIDIA) 54October 13, 2015 DF-search, an example  Expand deepest unexpanded node  Implementation: fringe is a LIFO queue (=stack) A B C D E H I J K F H L M
  • 55. TLo (IRIDIA) 55October 13, 2015 DF-search; evaluation  Completeness;  Does it always find a solution if one exists?  NO  unless search space is finite and no loops are possible.
  • 56. TLo (IRIDIA) 56October 13, 2015 DF-search; evaluation  Completeness;  NO unless search space is finite.  Time complexity;  Terrible if m is much larger than d (depth of optimal solution)  But if many solutions, then faster than BF-search O(bm )
  • 57. TLo (IRIDIA) 57October 13, 2015 DF-search; evaluation  Completeness;  NO unless search space is finite.  Time complexity;  Space complexity;  Backtracking search uses even less memory  One successor instead of all b. O(bm+1) O(bm )
  • 58. TLo (IRIDIA) 58October 13, 2015 DF-search; evaluation  Completeness;  NO unless search space is finite.  Time complexity;  Space complexity;  Optimallity; No  Same issues as completeness  Assume node J and C contain goal states O(bm+1) O(bm )
  • 59. TLo (IRIDIA) 59October 13, 2015 Depth-limited search  Is DF-search with depth limit l.  i.e. nodes at depth l have no successors.  Problem knowledge can be used  Solves the infinite-path problem.  If l < d then incompleteness results.  If l > d then not optimal.  Time complexity:  Space complexity: O(bl ) O(bl)
  • 60. TLo (IRIDIA) 60October 13, 2015 Depth-limited algorithm function DEPTH-LIMITED-SEARCH(problem,limit) return a solution or failure/cutoff return RECURSIVE-DLS(MAKE-NODE(INITIAL-STATE[problem]),problem,limit) function RECURSIVE-DLS(node, problem, limit) return a solution or failure/cutoff cutoff_occurred? ← false if GOAL-TEST[problem](STATE[node]) then return SOLUTION(node) else if DEPTH[node] == limit then return cutoff else for each successor in EXPAND(node, problem) do result ← RECURSIVE-DLS(successor, problem, limit) if result == cutoff then cutoff_occurred? ← true else if result ≠ failure then return result if cutoff_occurred? then return cutoff else return failure
  • 61. TLo (IRIDIA) 61October 13, 2015 Iterative deepening search  What?  A general strategy to find best depth limit l.  Goals is found at depth d, the depth of the shallowest goal-node.  Often used in combination with DF-search  Combines benefits of DF- en BF-search
  • 62. TLo (IRIDIA) 62October 13, 2015 Iterative deepening search function ITERATIVE_DEEPENING_SEARCH(problem) return a solution or failure inputs: problem for depth ← 0 to ∞ do result ← DEPTH-LIMITED_SEARCH(problem, depth) if result ≠ cuttoff then return result
  • 63. TLo (IRIDIA) 63October 13, 2015 ID-search, example  Limit=0
  • 64. TLo (IRIDIA) 64October 13, 2015 ID-search, example  Limit=1
  • 65. TLo (IRIDIA) 65October 13, 2015 ID-search, example  Limit=2
  • 66. TLo (IRIDIA) 66October 13, 2015 ID-search, example  Limit=3
  • 67. TLo (IRIDIA) 67October 13, 2015 ID search, evaluation  Completeness:  YES (no infinite paths)
  • 68. TLo (IRIDIA) 68October 13, 2015 ID search, evaluation  Completeness:  YES (no infinite paths)  Time complexity:  Algorithm seems costly due to repeated generation of certain states.  Node generation:  level d: once  level d-1: 2  level d-2: 3  …  level 2: d-1  level 1: d N(IDS)=(d)b+(d−1)b2 +...+(1)bd N(BFS)=b+b2 +...+bd +(bd+1 −b) O(bd ) N(IDS)=50+400+3000+20000+100000=123450 N(BFS)=10+100+1000+10000+100000+999990=1111100 Num. Comparison for b=10 and d=5 solution at far right
  • 69. TLo (IRIDIA) 69October 13, 2015 ID search, evaluation  Completeness:  YES (no infinite paths)  Time complexity:  Space complexity:  Cfr. depth-first search O(bd ) O(bd)
  • 70. TLo (IRIDIA) 70October 13, 2015 ID search, evaluation  Completeness:  YES (no infinite paths)  Time complexity:  Space complexity:  Optimality:  YES if step cost is 1.  Can be extended to iterative lengthening search  Same idea as uniform-cost search  Increases overhead. O(bd ) O(bd)
  • 71. TLo (IRIDIA) 71October 13, 2015 Bidirectional search  Two simultaneous searches from start an goal.  Motivation:  Check whether the node belongs to the other fringe before expansion.  Space complexity is the most significant weakness.  Complete and optimal if both searches are BF. bd/2 +bd/2 ≠bd
  • 72. TLo (IRIDIA) 72October 13, 2015 How to search backwards?  The predecessor of each node should be efficiently computable.  When actions are easily reversible.
  • 73. TLo (IRIDIA) 73October 13, 2015 Summary of algorithms Criterion Breadth- First Uniform- cost Depth-First Depth- limited Iterative deepening Bidirectional search Complete? YES* YES* NO YES, if l ≥ d YES YES* Time bd+1 bC*/e bm bl bd bd/2 Space bd+1 bC*/e bm bl bd bd/2 Optimal? YES* YES* NO NO YES YES
  • 74. TLo (IRIDIA) 74October 13, 2015 Repeated states  Failure to detect repeated states can turn a solvable problems into unsolvable ones.
  • 75. TLo (IRIDIA) 75October 13, 2015 Graph search algorithm  Closed list stores all expanded nodes function GRAPH-SEARCH(problem,fringe) return a solution or failure closed ← an empty set fringe ← INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe) loop do if EMPTY?(fringe) then return failure node ← REMOVE-FIRST(fringe) if GOAL-TEST[problem] applied to STATE[node] succeeds then return SOLUTION(node) if STATE[node] is not in closed then add STATE[node] to closed fringe ← INSERT-ALL(EXPAND(node, problem), fringe)
  • 76. TLo (IRIDIA) 76October 13, 2015 Graph search, evaluation  Optimality:  GRAPH-SEARCH discard newly discovered paths.  This may result in a sub-optimal solution  YET: when uniform-cost search or BF-search with constant step cost  Time and space complexity,  proportional to the size of the state space (may be much smaller than O(bd )).  DF- and ID-search with closed list no longer has linear space requirements since all nodes are stored in closed list!!
  • 77. TLo (IRIDIA) 77October 13, 2015 Search with partial information  Previous assumption:  Environment is fully observable  Environment is deterministic  Agent knows the effects of its actions What if knowledge of states or actions is incomplete?
  • 78. TLo (IRIDIA) 78October 13, 2015 Search with partial information  (SLIDE 7) Partial knowledge of states and actions:  sensorless or conformant problem  Agent may have no idea where it is; solution (if any) is a sequence.  contingency problem  Percepts provide new information about current state; solution is a tree or policy; often interleave search and execution.  If uncertainty is caused by actions of another agent: adversarial problem  exploration problem  When states and actions of the environment are unknown.
  • 79. TLo (IRIDIA) 79October 13, 2015 Conformant problems  start in {1,2,3,4,5,6,7,8} e.g Right goes to {2,4,6,8}. Solution??  [Right, Suck, Left,Suck]  When the world is not fully observable: reason about a set of states that migth be reached =belief state
  • 80. TLo (IRIDIA) 80October 13, 2015 Conformant problems  Search space of belief states  Solution = belief state with all members goal states.  If S states then 2S belief states.  Murphy’s law:  Suck can dirty a clear square.
  • 81. TLo (IRIDIA) 81October 13, 2015 Belief state of vacuum-world
  • 82. TLo (IRIDIA) 82October 13, 2015 Contingency problems  Contingency, start in {1,3}.  Murphy’s law, Suck can dirty a clean carpet.  Local sensing: dirt, location only.  Percept = [L,Dirty] ={1,3}  [Suck] = {5,7}  [Right] ={6,8}  [Suck] in {6}={8} (Success)  BUT [Suck] in {8} = failure  Solution??  Belief-state: no fixed action sequence guarantees solution  Relax requirement:  [Suck, Right, if [R,dirty] then Suck]  Select actions based on contingencies arising during execution.