Problem Solving & Uninformed Search: Artificial Intelligence
Problem Solving & Uninformed Search: Artificial Intelligence
Applying AI Concepts
Computer
Knowledge Inference
Inputs base mechanism Outputs
2
Applying AI Concepts (2)
• Inference mechanism:
– A program that employs search and pattern matching
techniques
4
Problem Solving by AI
Steps:
1. Problem formulation
➡ Process of deciding what conditions & states to consider,
given a goal
2. Searching
➡ Process of looking for subsequent stages of a
hypothetical journey (an action sequence)
3. Execution
➡ Implementation of the searching method chosen
Searching
• Is a problem-solving technique that enumerates a problem
space from an initial position in search of a goal position (or
solution)
6
Searching (2)
• When solving a problem, it’s convenient to think about the problem/
solution space
• The problem of search is to find a sequence of operators that
transition from the start to goal state
• Elements:
1. Problem state
• define the problem situation & existing condition, i.e. the initial state
2. Goal
• the objective to be achieved; can be more than one
3. Operator
• procedure used for changing from one state to another (an
algorithmic subroutine)
Searching (3)
• Problem space representation:
2. Search tree
8
Searching: Strategy
1. Uninformed search strategy
– Blind Search = naive search
– They are given no information other than its definition
– A general purpose search algorithm, operates in a brute-force
way
Uninformed Search
10
Generate and Test
11
Random Search
12
Notes
13
• Problem:
– It can often lead into deeper & deeper sub-network that
are far from the goal node which may exist at a much
higher level
14
Depth First Search (2)
Root node
(Start)
1
2 8 11
3 5 9 12 14
4 6 7 10 13 15 16
Goal
(End)
15
16
Breadth First Search
• Begin with the root node then examine all nodes in each level
before moving onto the next level
à expand the tree layer by layer, progressing in depth,
until goal is reached
17
2 3 4
5 6 7 8 9 10
Goal
(End)
18
Breadth First Search (3)
1. QUEUE ← path only containing the root
19
Non-Deterministic Search
20
Non-Deterministic Search (2)
1. QUEUE ← path only containing the root
21
Depth-Limited Search
algorithm may go
22
Depth-Limited Search (2)
1. DEPTH ← some_natural_number
QUEUE ← path only containing the root;
23
24
Iterative Deepening Search (2)
1. DEPTH ← 1
QUEUE ← path only containing the root;
25
Bidirectional Search
26
Bidirectional Search (2)
1. QUEUE1 ← path only containing the root;
QUEUE2 ← path only containing the goal;
27
Metrics
1. Time complexity
‣ Measure the worst-case time required to find a solution
2. Space complexity
‣ Measure the memory required during the search
3. Completeness
‣ Measure whether the algorithm find a path of solution
4. Optimality
‣ Measure whether the algorithm find the ‘optimal’ solution
available
28
Big-O Notation
• A common comparison tool for algorithms
29
• Combinatorial explosion:
– It occurs when a small increase in the number of elements
that can be combined increase the number of combinations
to be computed so fast that it quickly reaches computational
limits
– So much time taken by blind search
30