Professional Documents
Culture Documents
05 AI UninformedSearch Publish (Optimized)
05 AI UninformedSearch Publish (Optimized)
Gloria Virginia
UKDW - Genap 2022/2023
APPLYING AI CONCEPTS
Knowledge
base
Inference
mechanism
• Inference mechanism:
– A program that employs search and pattern matching
techniques
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
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
SEARCHING: STRATEGY
UNINFORMED SEARCH
10
11
A B C
S G
D E F
Possible solutions:
• S-A-B • S-A-B-C
• S-D-A-B-E • S-D-E-B-C
• S-D-A-S-D-E • S-D-E-F-G
• S-A-S-A-S-A-S-A
12
RANDOM SEARCH
13
A B C
S G
D E F
Process:
• S • S-A-D-E-B
• S-A • S-A-D-E-B-E
• S-A-D • S-A-D-E-B-E-F
• S-A-D-E • S-A-D-E-B-E-F-G
14
NOTES
15
• 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
16
2 8 11
3 5 9 12 14
4 6 7 10 13 15 16
Goal
(End)
17
DFS ALGORITHM
18
• 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
19
2 3 4
5 6 7 8 9 10
Goal
(End)
20
BFS ALGORITHM
21
22
NDS ALGORITHM
23
algorithm may go
24
DLS ALGORITHM
1. DEPTH ← some_natural_number
QUEUE ← path only containing the root;
25
26
IDS ALGORITHM
1. DEPTH ← 1
QUEUE ← path only containing the root;
27
28
BIDI ALGORITHM
29
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
30
BIG-O NOTATION
• A common comparison tool for algorithms
• Provides a worst-case measure of the complexity of a search
algorithm
31
• 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
32