Top Banner
CSCI 4310 Lecture 2: Search
19

CSCI 4310

Jan 06, 2016

Download

Documents

Arnold Burger

CSCI 4310. Lecture 2: Search. Search Techniques. Search is Fundamental to Many AI Techniques. Semantic Networks. Nodes: objects in the domain Links: Relationships between objects OOP: link is an “is a” relationship Meaning depends on the application - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CSCI 4310

CSCI 4310Lecture 2: Search

Page 2: CSCI 4310

Search Techniques

Search is Fundamental to Many AI Techniques

Page 3: CSCI 4310

Semantic Networks Nodes: objects in the domain Links: Relationships between

objects

OOP: link is an “is a” relationship

Meaning depends on the application

This abstract concept is put into practice in Ch. 4

Page 4: CSCI 4310

Semantic Nets

Book Converts to Trees

Page 5: CSCI 4310

Search What should a goal-based program do

when none of the actions it can currently perform result in a goal state?

Choose an action that at least leads to a state that is closer to a goal than the current state. Heuristics

Refine our search procedure, or narrow the search space.

Page 6: CSCI 4310

Definitions State: finite representation of the world at a

given time.

Operator: a function that transforms one state into another (also called rule, transition, successor function, production, action).

Initial state: world state at the beginning.

Goal state: desired world state (can be several)

Goal test: test to determine if the goal has been reached.

Page 7: CSCI 4310

Definitions Reachable goal: a state reachable via a

sequence of operators. State space: set of all reachable states from

initial state (possibly infinite). Cost function: a function that assigns a cost

to each operation. The ‘path cost’ is the TOTAL cost of getting from the start to the goal.

Performance: cost of the final operator sequence cost of finding the sequence

Path: A sequence of actions leading from one state to another.

Solution: A path from the initial state to a state that satisfies the goal test (goal state).

Page 8: CSCI 4310

Depth First Search

Uninformed search DFS applet

Page 9: CSCI 4310

Depth First Search

dfs (node v) { visit(v); for each child w of v dfs(w);}

O(bm) time complexityb: max branching factorm: max depthCan be implemented with only storing

the ‘current’ path: O(bm) space

Page 10: CSCI 4310

Depth First Search

Use when all partial paths reach dead ends or become complete paths after a reasonable number of steps

Can use fewer resources than BFS

Page 11: CSCI 4310

Breadth First Search

Uninformed search

Page 12: CSCI 4310

Breadth First Search

O(bd) time and space complexityb: max branching factord: depth of solution

DEPTH 0

DEPTH 1

DEPTH 2

Page 13: CSCI 4310

Breadth First Search

BFS may use more memory, but will not get stuck in blind alleys, and will always find the shortest path first.

BFS may be more appropriate when exploring very large search spaces where there is an expected solution which takes a relatively small number of steps, or when you are interested in all the solutions.

Page 14: CSCI 4310

Summary: Uninformed Search Problem formulation and

representation is key! Implementation as expanding directed

graph of states and transitions Appropriate for problems where no

solution is known and many combinations must be tried

Problem space is of exponential size in the number of world states -- NP-hard problems

Fails due to lack of space and/or time.

Page 15: CSCI 4310

From a Higher Level

Task discriminator

Many AI ‘searching’ techniques DFS or BFS Heuristic Rule-based system Genetic Algorithm …

Page 16: CSCI 4310

“Macro”-search

NeuralNetwork Rule

BasedExpertSystem

Facial recognitionalgorithm

StairClimbing

What do I do next?

Page 17: CSCI 4310

Limited Cross-disciplinary systems We have made impressive

progress in machines that… Play chess Diagnose medical problems Climb stairs

But no robot can walk down stairs and then play a game of chess? Why

Page 18: CSCI 4310

A simple example, but the task of task determination is difficult

How do you do this as a human? Goal-driven behaviors and divide

and conquer can help

Page 19: CSCI 4310

Reading

Chapters 2 in Winston Chapters 2-3 in Buckland