Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

PROBLEM

SOLVING
Engr. Muzammil Iqbal
GENERATE AND TEST

Tester Correct
Possible Solutions Solutions
Solution
Generator

Incorrect
Solutions
REPRESENTATION OF
PROBLEM
 Text form or description form

 Graphical representation

 Tree representation
 Semantic networks
SWITCHING ON THE LIGHT
(GRAPHICAL FORM)
OFF OFF OFF

ON OFF OFF OFF ON OFF OFF OFF ON

ON ON OFF ON OFF ON OFF ON ON ON ON OFF ON OFF ON OFF ON ON


FARMER & GOOSE PROBLEM
Farmer
Grain
Grain
Goose
Farmer
Fox
Fox
Goose

Farmer
Farmer
Fox Fox Goose Farmer
Fox
Goose Grain Goose
Grain
Grain
Farmer
Farmer Fox
Farmer Fox Fox
Goose Goose
Goose Grain Grain
Grain

Fox
Fox
Farmer
Goose
Farmer
Goose
Grain
Grain
FARMER & GOOSE PROBLEM
(TREE REPRESENTATION)
Fa, Fo, Gr, Go

Fa, Fo, Gr, Go Fa, Fo, Gr, Go Fa, Fo, Gr, Go

Fa, Fo, Gr, Go Fa, Fo, Gr, Go Fa, Fo, Gr, Go Fa, Fo, Gr, Go Fa, Fo, Gr, Go Fa, Fo, Gr, Go

Fa, Fo, Gr, Go

Fa, Fo, Gr, Go

Fa, Fo, Gr, Go


WHAT IS PROBLEM SOLVING?
 “To approach the target given with a problem statement or the requirement (some information)
is the description of Problem solving”
 Components:
1. Problem statement
2. Target
3. Starting point
4. Operator
5. Mechanism
CATEGORIES OF PROBLEM
 Well structured problems:
 Clear representation
 Understandable statement scenarios or levels of problem
 Clear target or solution
 Operator to help for solution
 Well defined mechanism

 Ill structured problems


PROBLEM SOLVING
APPROACHES IN AI
 Solution focused approach
 Attempt to solution
OFF OFF OFF

ON OFF OFF OFF ON OFF OFF OFF ON

ON ON OFF ON OFF ON OFF ON ON ON ON OFF ON OFF ON OFF ON ON

 Nodes represent “states”


 Arrows represent “operator”
 Highlighted nodes represent “Goal state”
 The total representation can be termed as “Solution space”
SEARCHING (SOLUTION TO PROBLEM
SOLVING)

Airport

Q1
Q2

Q5 Q3 Q4

Hotel
TREE AND GRAPH
TERMINOLOGY
 “A” is the “root node” A
 “A, B, C … J” are “nodes” B C
 “B” is a child of “A”
 “A” is ancestor of “D” D
E F G
H
 “D” is a descendant of “A”
 “D, E, F, G, I, J” are “leaf nodes”
I
 Arrows represent “edges” or “links”
J
PROBLEM FORMULATION
USING GRAPHS
3 3
A B C
2

4 4
S G

3 D E F 2
1 3
TREE SEARCH
S

D
A
E
B A
D F
B
C
E B
E A G
C
C
D B E
F
F
D F
C
G G
G
SEARCH STRATEGIES
 Blind search – Uninformed
 Goal directed
 Data directed
 Bidirectional
 Depth First Search
 Breadth First Search

 Informed search – Heuristic (Problem domain ideas)


 Any path problem or non optimal search
 Optimal solution search
SIMPLE SEARCH ALGORITHM
 Let S be the start state

1. Initialize Q with the start node Q = (S) as only entry; set Visited = (S)
2. If Q is empty, fail. Else pick node X from Q
3. If X is a goal, return X, we have reached the goal
4. (Otherwise) Remove X from Q
5. Find all the children of node X not in visited
6. Add these to Q; add children of X to visited
7. Go to step 2

You might also like