problem-solving by search - semantic scholar
TRANSCRIPT
![Page 1: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/1.jpg)
Problem-Solving by Search
CSCI 5582, Fall 2007
![Page 2: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/2.jpg)
Administrivia
• Reading for this week: R+N Chapter 3,sections 1-5
• Problem Set 1 to be posted Sept. 9, due Sept.25
![Page 3: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/3.jpg)
SEND+MORE____MONEY
![Page 4: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/4.jpg)
Visualizing Problems as“Spaces”
• The idea of a “problem space”• Some tractable examples• Search strategies: the essential arsenal• Crucial issues in evaluating search
algorithms• On beyond puzzles
![Page 5: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/5.jpg)
Problem Spaces
• A set of states• Special states: initial state(s), goal state(s)
[Or perhaps a goal test]• Successor function (also called operators in
the cognitive science literature)• In combination, these create a graph to
search
![Page 6: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/6.jpg)
![Page 7: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/7.jpg)
![Page 8: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/8.jpg)
![Page 9: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/9.jpg)
What Else Might We KnowAbout A Problem?
• Constraints on operators• Costs of operators• Reversibility• Metrics for how close we might be to a
solution
![Page 10: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/10.jpg)
Analyzing Search Algorithms
• Completeness (will we solve the problem?)• Optimality(how good is our solution?)• Time (how long will it take us to find a
solution?)• Space (how much memory will it take?)
![Page 11: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/11.jpg)
Uninformed Search: the BasicRepertoire
• Depth-first search• Breadth-first search• Iterative-deepening depth-first search• Bidirectional search
![Page 12: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/12.jpg)
Depth-First Search
Depth-First-Search [Nodes]
IF there are no more nodes
THEN FAIL
ELSE ThisNode First (Nodes)
IF ThisNode is the goal
THEN Return ThisNode
ELSE
ChildNodes Children (ThisNode)
Depth-First-Search
(Append-to-Front ChildNodes
Rest (Nodes))
![Page 13: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/13.jpg)
Breadth-First Search
Breadth-First-Search [Nodes]
IF there are no more nodes
THEN FAIL
ELSE ThisNode First (Nodes)
IF ThisNode is the goal
THEN Return ThisNode
ELSE
ChildNodes Children (ThisNode)
Breadth-First-Search
(Append-to-Front Rest (Nodes)
ChildNodes )
![Page 14: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/14.jpg)
What could we do with moreinformation?
• Search from the most “promising” node(greedy best-first search)
• Combine cost-so-far and future promise(A*)
• Simple (local) strategies: hill-climbing,beam search
![Page 15: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/15.jpg)
What could we do with moreinformation?
• Search from the most “promising” node(greedy best-first search)
• Combine cost-so-far and future promise(A*)
• Simple (local) strategies: hill-climbing,beam search
![Page 16: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/16.jpg)
Best-First-Search [Nodes]IF there are no more nodes THEN FAILThisNode <-- First(Nodes)IF ThisNode is the goal
THEN return ThisNodeELSEChildNodes <-- Children(ThisNode)Best-First-Search
(Sort-by-QualityChildNodesRemove-Node(ThisNode Nodes))
![Page 17: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/17.jpg)
How do we measure the "quality" of astate in our search?
• Least cost so far (uniform cost search)• Apparently closest to goal (greedy search)• Combine least cost and (apparent) nearness
to goal (A* search)
![Page 18: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/18.jpg)
The Basic Idea Behind A* Search
1) Devise an "estimation" function, h, that gives you a plausibleunderestimate of the distance from a given state to the goal.
2) Call the cost of getting from the initial state to the current state g.3) To measure the quality of a given state s, sum the cost (g) of arriving
at this state and the estimate (h) of the cost required to get from s tothe goal.
4) Use best-first search, where g+h is the overall quality function.
![Page 19: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/19.jpg)
Try to find a metric that will be a close (informative) one,butthat won’t overestimate (it should be optimistic).Example: 8-9 puzzle
Number of misplaced tilesSum of Manhattan distance of misplaced tiles (better)Best solution length for (say) tiles 1-4
Example: Choosing a path on a map from city A to BEuclidean distance to B.
How do you estimate distance to the goal? (Or: What’s that “h” function?)
![Page 20: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/20.jpg)
AStar-Best-First-Search [Nodes]IF there are no more nodes THEN FAILThisNode <-- First(Nodes)IF ThisNode is the goal
THEN return ThisNodeELSEChildNodes <-- Children(ThisNode)Astar-Best-First-Search
(Sort-by-Lowest-Cost-plus-EstimateChildNodesRemove-Node(ThisNode Nodes))
![Page 21: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/21.jpg)
How hard is a (search) problem?
• How big is the problem space?• How long is the best solution path? (the
“optimality” issue)• How long does it take to find the best
solution (the time-of-search issue)• What, if any, kinds of special knowledge or
heuristics do we have?
![Page 22: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/22.jpg)
The “optimal” path is awful: Towers of Hanoi
![Page 23: Problem-Solving by Search - Semantic Scholar](https://reader035.vdocument.in/reader035/viewer/2022071417/62ced6769e02907ca33821f9/html5/thumbnails/23.jpg)
The optimal path is (relatively) short, but finding the solutioncan take eons: the traveling salesman problem