30
Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

Embed Size (px)

Citation preview

Page 1: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Artificial Intelligence

By

Mr. Ejaz

http:-owaiscomsian.wordpress.com/

Page 2: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Artificial IntelligenceCourse outline

• Introduction• Problem solving• Generic algorithms• Knowledge Representation and Reasoning• Expert Systems• Uncertainty• Learning• Planning• Advanced topics in AI

Page 3: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Artificial IntelligenceProblem Solving and Search

Muhammad Ejaz

Page 4: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Problem Solving

• The mechanism to find the goal performing some actions to transit from one state to another is known as problem solving.

• Initial state• Operator: description of an action • State space: all states reachable from the initial state by any

sequence action• Path: sequence of actions leading from one state to another• Goal test: which the agent can apply to a single state

description to determine if it is a goal state• Path cost function: assign a cost to a path which the sum of

the costs of the individual actions along the path.

Page 5: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Different types of problem

• Well structured problemsWhen problem description and its rules are

described clearly and unambiguously.• Ill structured problemNo extra information about the problem other

than the definition• No extra information• No heuristics (rules)

Page 6: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Well Defined Problems

• Finding the maximum from a sequence of integers.

• Eight puzzle• 1,2 or 2,1 puzzle• Farmer and goose problem• Water pouring problem

Page 7: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Eight puzzle

Page 8: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Water Pouring Problem

(0,0)

(4,0) (0,3)

(4,3) (3,0)(1,3)

(3,3)(1,0) (0,1)

(4,1)

(2,3)

(2,0) (0,2)

(4,2)

Page 9: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Farmer and goose problem

W F ~ W F GF W F G ~ G F ~W C W C C ~ G FG ~ C F ~ WC F ~ C F W W G~ G G ~ G C C C F C W ~ G W

Page 10: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Think Point

• What will be tree representation of Farmer and goose problem?

Page 11: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Searching For Solutions

• Having formulated some problems…how do we solve them?

• Search through a state space

• Use a search tree that is generated with an initial state and successor functions that define the state space

Page 12: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Different search techniques

• Uninformed SearchOnly the information available in the problem definition

– Also known as blind searching

-Breadth-first search-Depth-first search-Depth-limited search-Iterative deepening search

• Informed Search When sufficient information is provided to reach the

goal.

Page 13: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Breadth-First Search

• Recall from Data Structures the basic algorithm for a breadth-first search on a graph or tree

• Expand the shallowest unexpanded node

• Place all new successors at the end of a FIFO queue

Page 14: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Breadth-First Search

Page 15: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Breadth-First Search

Page 16: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Breadth-First Search

Page 17: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Breadth-First Search

Page 18: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

• Recall from Data Structures the basic algorithm for a depth-first search on a graph or tree

• Expand the deepest unexpanded node

• Unexplored successors are placed on a stack until fully explored

Page 19: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 20: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 21: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 22: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 23: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 24: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 25: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 26: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 27: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 28: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 29: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search

Page 30: Artificial Intelligence By Mr. Ejaz http:-owaiscomsian.wordpress.com/ CIIT Sahiwal

CIIT Sahiwal

Depth-First Search