BISCSIGES Short Course Fuzzy Logic and GAFuzzy - PowerPoint PPT Presentation

1 / 82
About This Presentation
Title:

BISCSIGES Short Course Fuzzy Logic and GAFuzzy

Description:

The mammals include whales, monkeys, and elephants. Charlie is a elephant. ... The way one traverses the tree defines SEARCH TYPES. CS 331/531 Dr M M Awais. 15 ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 83
Provided by: michaelb51
Category:

less

Transcript and Presenter's Notes

Title: BISCSIGES Short Course Fuzzy Logic and GAFuzzy


1
REPRESENTATION METHODS
Represent the information Animals are generally
divided into birds and mammals. Birds are further
classified into large birds and small birds.
Small birds include sparrows, and crows. The
large birds are ostriches. The mammals include
whales, monkeys, and elephants. Charlie is a
elephant.
2
Predicate
  • types(Animals, Birds,Mammals)
  • types(Birds, Largebirds, Smallbirds)
  • Etc
  • Unify to answer the queries
  • IS THERE ANY OTHER WAY?

3
Semantic Nets (Graphical Methods)
Animal
Super Class Animal
IS-A
IS-A
Mammal
IS-A
Bird
Large
IS-A
IS-A
IS-A
small
Elephant
whales
instance
instance
Instance
sparrow
crow
charlie
4
Semantic Nets (Graphical Methods)
Animal
IS_A Relation Animal Super Bird Class Mammal
Class
IS-A
IS-A
Mammal
IS-A
Bird
Large
IS-A
IS-A
IS-A
small
Elephant
whales
instance
instance
Instance
sparrow
crow
charlie
5
Semantic Nets (Graphical Methods)
Animal
IS-A
IS-A
Mammal
IS-A
Bird
Large
IS-A
IS-A
IS-A
small
Elephant
whales
instance
instance
Instance
sparrow
crow
charlie
Instance defines a specific instance of a class
6
Semantic Nets (Graphical Methods)
Animal
IS-A
IS-A
Mammal
IS-A
Bird
Large
IS-A
IS-A
IS-A
small
Elephant
whales
instance
instance
Instance
sparrow
crow
charlie
7
Semantic Nets (Graphical Methods)
Animal
IS-A
IS-A
Mammal
IS-A
Bird
Large
IS-A
IS-A
IS-A
small
Elephant
whales
instance
instance
Instance
sparrow
crow
charlie
bananas
likes
Can have attribute link likes for instance,
class, superclass
8
SEARCH METHODS
  • Formulate a problem as a search
  • Can answer queries such as
  • Is CHARLIE an animal?

9
Search Representation
Animal
Level 0 Root node
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
10
Search Representation
Animal
Level 0 Root node
Mammal
Level 1
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
11
Search Representation
Animal
Level 0 Root node
Mammal
Level 1
Bird
small
Large
Elephant
whales
Level 2
sparrow
crow
charlie
12
Search Representation
Animal
Level 0 Root node
Mammal
Level 1
Bird
small
Large
Elephant
whales
Level 2
sparrow
crow
charlie
Level 3
13
Answering Queries
Is charlie an animal? Answer Traverse the
tree If charlie node present then answer is YES
otherwise NO
Animal
Level 0 Root node
Mammal
Level 1
Bird
small
Large
Elephant
whales
Level 2
sparrow
crow
charlie
Level 3
14
Answering Queries
Is charlie an animal? Answer Traverse the
tree If charlie node present then answer is YES
otherwise NO
Animal
Level 0 Root node
Mammal
Level 1
Bird
small
Large
Elephant
whales
Level 2
sparrow
crow
charlie
Level 3
The way one traverses the tree defines SEARCH
TYPES
15
SEARCH METHODS
  • Blind Search
  • Breadth First
  • Depth First
  • Iterative Deepening
  • Heuristic search
  • Hill Climbing
  • Best First
  • A Search

16
Standard Terms
Animal
Root node
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
17
Standard Terms
Animal
Child of Animal node
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
18
Standard Terms
Animal
Mammal
Bird
Bird and Mammal are Siblings
small
Large
Elephant
whales
sparrow
crow
charlie
19
Standard Terms
Animal
Root node
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
GOAL node
Path to a node is the list of nodes from the root
to the goal node.
20
Standard Terms
Animal
Root node
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
GOAL node
Path to a node is the list of nodes to the goal
node (bold lines).
21
How to Traverse the Tree to find PATH?
Animal
Mammal
Bird
small
Large
Elephant
whales
sparrow
crow
charlie
22
ANALYSIS OF SEARCH STRATEGIES
Completeness is the strategy guaranteed to find
a solution where there is one? Time
Complexity How long does it take to find a
solution? Space Complexity How much memory
does it need to perform the
search? Optimality Does the strategy find the
highest quality solution when there are
several different solutions?
23
  • Exhaustive Search
  • One can systematically check every state that is
    reachable from initial state to end out if it is
    a goal state.
  • Search Space
  • The set of all states is the search space
  • For simple/small search space exhaustive search
    is applicable BRUTE FORCE or BLIND SEARCH
  • For complex search space HEURISTIC SEARCH is used

24
GRAPHS AND TREES
  • Graphs-
  • Consist of a set of nodes with links between them
  • links can be directed / undirected
  • Path is the sequence of nodes connected nodes via
    links.
  • Acyclic graphs (Paths linking a node
  • with itself are absent)
  • Trees???

25
  • Tree-
  • A tree is a special kind of graph with only one
    path to each node, usually represented with a
    special root node at the top
  • Relationship between nodes
  • Parent
  • Children
  • Sibling
  • Ancestor Node, Descendant Node, Leaf Node

26
Graphs VS Trees
  • Compare the searches in the two (which is
    efficient)

27
Relating State and Graph Nodes
  • Every physical state of a problem can be
    represented as a node in a graph/tree
  • The link between the nodes represent action
    required to change the states
  • For a navigation problem
  • Link driving action
  • Node cities
  • For the Wumpus world problem
  • Link movement of the agent
  • Node present position of the agent

28
8 Puzzle Problem states vs. nodes
  • A state is a (representation of) a physical
    configuration
  • A node is a data structure constituting part of a
    search tree includes state, parent node, action,
    path cost g(x), depth

29
8 Puzzle Problem states vs. nodes
  • A state is a (representation of) a physical
    configuration
  • A node is a data structure constituting part of a
    search tree includes state, parent node, action,
    path cost g(x), depth

30
Tree search algorithms
  • Basic idea
  • offline, simulated exploration of state space by
    generating successors of already-explored states
    (a.k.a.expanding states)

31
Example Romania
32
Example Romania
  • On holiday in Romania currently in Arad.
  • Flight leaves tomorrow from Bucharest
  • Formulate goal
  • be in Bucharest
  • Formulate problem
  • states various cities
  • actions drive between cities
  • Find solution
  • sequence of cities, e.g., Arad, Sibiu, Fagaras,
    Bucharest

33
Tree search example
34
Tree search example
35
Tree search example
Keep on expanding unless you reach the goal
36
Search strategies
  • A search strategy is defined by picking the order
    of node expansion
  • Strategies are evaluated along the following
    dimensions
  • completeness does it always find a solution if
    one exists?
  • time complexity number of nodes generated
  • space complexity maximum number of nodes in
    memory
  • optimality does it always find a least-cost
    solution?
  • Time and space complexity are measured in terms
    of
  • b maximum branching factor of the search tree
  • d depth of the least-cost solution
  • m maximum depth of the state space (may be 8)

37
Blind Search Strategies
  • Breadth First (Breadth wise expansion)
  • Depth First (Depth wise expansion)
  • Iterative Deepening (combination)

38
Breadth-first search
  • Expand shallowest unexpanded node
  • Implementation
  • FIFO queue, i.e., new successors go at end

39
Breadth-first search
40
Breadth-first search
41
Breadth-first search
42
Properties of breadth-first search
  • Complete? Yes (if b is finite)
  • Time? 1bb2b3 bd b(bd-1) O(bd1)
  • Space? O(bd1) (keeps every node in memory)
  • Optimal? Yes (if cost 1 per step)
  • Space is the bigger problem (more than time)

43
Breath First Algorithm
  • 1. Start with queue initial - state and found
    FALSE
  • While queue not empty and not found do
  • (a) Remove the first node n from queue
  • (b) if N is a goal state then found TRUE
  • (c ) Find all the successor nodes of X, and put
    them on the end of the queue

44
Goal D
  • Open A closed
  • Evaluate A not goal

45
Goal D
  • Open A closed
  • Evaluate A not goal
  • Open B,Cclosed A
  • Evaluate B not goal

46
Goal D
  • Open A closed
  • Evaluate A not goal
  • Open B,Cclosed A
  • Evaluate B not goal
  • Open C,D,Eclosed B,A
  • Evaluate C not goal

47
Goal D
  • Open A closed
  • Evaluate A not goal
  • Open B,Cclosed A
  • Evaluate B not goal
  • Open C,D,Eclosed B,A
  • Evaluate C not goal
  • Open D,E,G,Fclosed C,B,A
  • Evaluate D is goal STOP

Path A B D Path Cost The cost in reaching D
from A Path cost 2 A to B1, B to
D1 (assuming a unit cost between nodes)
48
Uniform-cost search
  • Expand least-cost unexpanded node
  • Implementation
  • queue ordered by path cost
  • Equivalent to breadth-first if step costs all
    equal

49
Depth-first search
  • Expand deepest unexpanded node
  • Implementation
  • LIFO queue, i.e., put successors at front

50
Depth-first search
51
Depth-first search
52
Depth-first search
53
Depth-first search
54
Depth-first search
55
Depth-first search
56
Depth-first search
57
Depth-first search
58
Depth-first search
59
Depth-first search
60
Depth-first search
61
Properties of depth-first search
  • Complete? No fails in infinite-depth spaces,
    spaces with loops
  • Modify to avoid repeated states along path
  • ? complete in finite spaces
  • Time? O(bm) terrible if m is much larger than d
  • but if solutions are dense, may be much faster
    than breadth-first
  • Space? O(bm), i.e., linear space!
  • Optimal? No

62
Depth First
1. Start with agenda initial - state and
found FALSE 2. While agenda not empty and not
found do (a) Remove the first node N from
agenda (b) if N is not in visited then (I) Add
N to visited (II) if N is a goal state then
found TRUE (III) Put Ns successors on the
front of the stack
63
Goal C
  • OpenA,closed
  • Evaluate A not a goal

64
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal

65
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal

66
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal

67
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal
  • OpenI,E,CclosedH,D,B,A
  • Evaluate I not a goal

68
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal
  • OpenI,E,CclosedH,D,B,A
  • Evaluate I not a goal
  • OpenE,CclosedI,H,D,B,A
  • Evaluate E not a goal

69
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal
  • OpenI,E,CclosedH,D,B,A
  • Evaluate I not a goal
  • OpenE,CclosedI,H,D,B,A
  • Evaluate E not a goal
  • OpenJ,K,CclosedE,I,H,D,B,A
  • Evaluate J not a goal

70
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal
  • OpenI,E,CclosedH,D,B,A
  • Evaluate I not a goal
  • OpenE,CclosedI,H,D,B,A
  • Evaluate E not a goal
  • OpenJ,K,CclosedE,I,H,D,B,A
  • Evaluate J not a goal
  • OpenK,CclosedK, E,I,H,D,B,A
  • Evaluate K not a goal

71
Goal C
  • OpenA,closed
  • Evaluate A not a goal
  • OpenB,CclosedA
  • Evaluate B not a goal
  • OpenD,E,CclosedB,A
  • Evaluate D not a goal
  • OpenH,I,E,CclosedD,B,A
  • Evaluate H not a goal
  • OpenI,E,CclosedH,D,B,A
  • Evaluate I not a goal
  • OpenE,CclosedI,H,D,B,A
  • Evaluate E not a goal
  • OpenJ,K,CclosedE,I,H,D,B,A
  • Evaluate J not a goal
  • OpenK,CclosedJ,E,I,H,D,B,A
  • Evaluate K not a goal
  • OpenCclosedK,E,I,H,D,B,A
  • Evaluate C is goal STOP

72
Depth-limited search
  • depth-first search with depth limit L
  • nodes at depth L have no successors
  • Do not apply depth first after a certain depth

73
Iterative deepening search L0
For depth 0, evaluate the root node and stop
74
Iterative deepening search L1
75
Iterative deepening search L1
76
Iterative deepening search L1
77
Iterative deepening search L2
78
Iterative deepening search L2
79
Iterative deepening search L3
80
Iterative deepening search
  • Number of nodes generated in a depth-limited
    search to depth d with branching factor b
  • NDLS b0 b1 b2 bd-2 bd-1 bd
  • Number of nodes generated in an iterative
    deepening search to depth d with branching factor
    b
  • NIDS (d1)b0 d b1 (d-1)b2 3bd-2
    2bd-1 1bd
  • For b 10, d 5,
  • NDLS 1 10 100 1,000 10,000 100,000
    111,111
  • NIDS 6 50 400 3,000 20,000 100,000
    123,456
  • Overhead (123,456 - 111,111)/111,111 11

81
Properties of iterative deepening search
  • Complete? Yes
  • Time? (d1)b0 d b1 (d-1)b2 bd O(bd)
  • Space? O(bd)
  • Optimal? Yes, if step cost 1

82
Summary of algorithms
Write a Comment
User Comments (0)
About PowerShow.com