CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6)...
-
date post
19-Dec-2015 -
Category
Documents
-
view
223 -
download
0
Transcript of CPSC 322, Lecture 10Slide 1 Finish Search Computer Science cpsc322, Lecture 10 (Textbook Chpt 3.6)...
CPSC 322, Lecture 10 Slide 1
Finish SearchComputer Science cpsc322, Lecture 10
(Textbook Chpt 3.6)
January, 25, 2010
CPSC 322, Lecture 10 Slide 2
Lecture Overview
• Optimal Efficiency• Pruning Cycles and Repeated states Examples
• Dynamic Programming• 8-puzzle Applet• Search Recap
CPSC 322, Lecture 8 Slide 3
Optimal efficiency of A*
• In fact, we can prove something even stronger about A*: in a sense (given the particular heuristic that is available) no search algorithm could do better!
• Optimal Efficiency: Among all optimal algorithms that start from the same start node and use the same heuristic h, A* expands the minimal number of paths.
CPSC 322, Lecture 10 Slide 4
Lecture Overview
• Optimal Efficiency Example• Pruning Cycles and Repeated states Examples
• Dynamic Programming• 8-puzzle Applet• Search Recap
CPSC 322, Lecture 10 Slide 6
Lecture Overview
• Optimal Efficiency Example• Pruning Cycles and Repeated states Examples
• Dynamic Programming• 8-puzzle Applet• Search Recap
CPSC 322, Lecture 9 Slide 7
Idea: for statically stored graphs, build a table of dist(n) the actual distance of the shortest path from node n to a goal.This is the perfect……..This can be built backwards from the goal:
Dynamic Programming
otherwisemdistmn
ngoalisifndist
Amn )(),(costmin
),(_0)(
,
a
b
cg
2
31
3
g
b
c
a
2d
1
2
CPSC 322, Lecture 9 Slide 8
But there are at least two main problems:• You need enough space to store the graph.• The dist function needs to be recomputed for each goal
Dynamic ProgrammingThis can be used locally to determine what to do.From each node n go to its neighbor which minimizes
a
b
c
g2
3
4
3
d
3
21
3
)(m)cost(n, mdist
2
1
2
CPSC 322, Lecture 10 Slide 9
Lecture Overview
• Optimal Efficiency Example• Pruning Cycles and Repeated states Examples
• Dynamic Programming• 8-puzzle Applet• Search Recap
CPSC 322, Lecture 8 Slide 10
• The AI-Search animation system
http://www.cs.rmit.edu.au/AI-Search/Product/
• To examine Search strategies when they are applied to the 8puzzle
• Compare only DFS, BFS and A* (with only the two heuristics we saw in class )
DFS, BFS, A* Animation Example
• With default start state and goal
• DFS will find Solution at depth 32• BFS will find Optimal solution depth 6• A* will also find opt. sol.
expanding much less nodes
CPSC 322, Lecture 9 Slide 11
nPuzzles are not always solvable
Half of the starting positions for the n-puzzle are impossible to resolve (for more info on 8puzzle) http://www.isle.org/~sbay/ics171/project/unsolvable
• So experiment with the AI-Search animation system with the default configurations.
• If you want to try new ones keep in mind that you may pick unsolvable problems
CPSC 322, Lecture 10 Slide 12
Lecture Overview
• Optimal Efficiency Example• Pruning Cycles and Repeated states Examples
• Dynamic Programming• 8-puzzle Applet• Search Recap
CPSC 322, Lecture 10 Slide 13
Recap SearchSelectio
nComplete Optimal Time Space
DFS LIFO N N O(bm) O(mb)
BFS FIFO Y Y O(bm) O(bm)
IDS(C) LIFO Y Y O(bm) O(mb)
LCFS min cost Y Y O(bm) O(bm)
BFS min h N N O(bm) O(bm)
A* min f Y Y O(bm) O(bm)
B&B LIFO + pruning
N Y O(bm) O(mb)
IDA* LIFO Y Y O(bm) O(mb)
MBA* min f N Y O(bm) O(bm)
CPSC 322, Lecture 10 Slide 14
Recap Search (some qualifications)
Complete Optimal Time Space
DFS N N O(bm) O(mb)
BFS Y Y O(bm) O(bm)
IDS(C) Y Y O(bm) O(mb)
LCFS Y Y ? O(bm) O(bm)
BFS N N O(bm) O(bm)
A* Y Y ? O(bm) O(bm)
B&B N Y ? O(bm) O(mb)
IDA* Y Y O(bm) O(mb)
MBA* N Y O(bm) O(bm)
CPSC 322, Lecture 10 Slide 15
Search in PracticeComplete Optimal Time Space
DFS N N O(bm) O(mb)
BFS Y Y O(bm) O(bm)
IDS(C) Y Y O(bm) O(mb)
LCFS Y Y O(bm) O(bm)
BFS N N O(bm) O(bm)
A* Y Y O(bm) O(bm)
B&B N Y O(bm) O(mb)
IDA* Y Y O(bm) O(mb)
MBA* N Y O(bm) O(bm)
BDS Y Y O(bm/2) O(bm/2)
CPSC 322, Lecture 10 Slide 16
Search in Practice (cont’)
Many paths to
solution, no ∞ paths?
Informed?
Large branching factor?
CPSC 322, Lecture 10 Slide 17
(Adversarial) Search: ChessDeep Blue’s Results in the second tournament:
• second tournament: won 3 games, lost 2, tied 1
• 30 CPUs + 480 chess processors
• Searched 126.000.000 nodes per sec
• Generated 30 billion positions per move reaching depth 14 routinely
• Iterative Deepening with evaluation function (similar to a heuristic) based on 8000 features (e.g., sum of worth of pieces: pawn 1, rook 5, queen 10)
CPSC 322, Lecture 2 Slide 18
Modules we'll cover in this course: R&Rsys
Environment
Problem
Query
Planning
Deterministic
Stochastic
Search
Arc Consisten
cy
Search
Search Value
Iteration
Var. Elimination
Constraint Satisfacti
on
Logics
STRIPS
Belief Nets
Vars + Constrai
nts
Decision Nets
Markov Processes
Var. Elimination
Static
Sequential
RepresentationReasoningTechnique
CPSC 322, Lecture 3 Slide 20
CSPs: Radio link frequency assignment
Source: INRIA
Assigning frequencies to a set of radio links defined between pairs of sites in order to avoid interferences.
Constraints on frequency depend on position of the links and on physical environment .
Sample Constraint network
CPSC 322, Lecture 10 Slide 21
Planning & Scheduling: Logistics
Dynamic Analysis and Replanning Tool (Cross & Walker)
• logistics planning and scheduling for military transport
• used for the first time in the 1991 Gulf War by the US
• problems had 50,000 entities (e.g., vehicles); different starting points and destinations
Source: DARPA
Same techniques can be use for non-military applications:
e.g., Emergency Evacuation
CPSC 322, Lecture 11 Slide 22
Standard Search vs. Specific R&R systemsConstraint Satisfaction (Problems):
• State• Successor function• Goal test• Solution• Heuristic function
Planning : • State• Successor function• Goal test• Solution• Heuristic function
Inference• State• Successor function• Goal test• Solution• Heuristic function