Informed search A* algorithm

Publish in

Documents

183 views

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Description
Informed search A* algorithm. 2013/10/17. Outline. Informed = use problem-specific knowledge Which search strategies? Best-first search and its variants Heuristic functions? How to invent them Local search and optimization Hill climbing, simulated annealing, beam search,…
Transcript
Informed searchA* algorithm2013/10/17Outline
• Informed = use problem-specific knowledge
• Which search strategies?
• Best-first search and its variants
• Heuristic functions?
• How to invent them
• Local search and optimization
• Hill climbing, simulated annealing, beam search,…
• Evolution algorithms
• Previously: tree-searchfunction TREE-SEARCH(problem,fringe) return a solution or failurefringe INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)loop doif EMPTY?(fringe) then return failurenode REMOVE-FIRST(fringe)if GOAL-TEST[problem] applied to STATE[node] succeedsthen return SOLUTION(node)fringe INSERT-ALL(EXPAND(node, problem), fringe)A strategy is defined by picking the order of node expansionBest-first search
• General approach of informed search:
• Best-first search: node is selected for expansion based on an evaluation functionf(n)
• Idea: evaluation function measures distance to the goal.
• Choose node which appears best
• Implementation:
• fringe is queue sorted in decreasing order of desirability.
• Special cases: greedy search, A* search
• A heuristic function
• [dictionary]“A rule of thumb, simplification, or educated guess that reduces or limits the search for solutions in domains that are difficult and poorly understood.”
• h(n)= estimated cost of the cheapest path from node n to goal node.
• If n is goal thenh(n)=0
• More information later.Romania with step costs in km
• hSLD=straight-line distance heuristic.
• In this example f(n)=h(n)
• Expand node that is closest to goal
• = Greedy best-first searchGreedy search exampleArad (366)
• Assume that we want to use greedy search to solve the problem of travelling from Arad to Bucharest.
• The initial state=Arad
• Greedy search exampleAradZerind(374)Sibiu(253)Timisoara(329)
• The first expansion step produces:
• Sibiu, Timisoara and Zerind
• Greedy best-first will select Sibiu.
• If Sibiu is expanded we get:
• Arad, Fagaras, Oradea and Rimnicu Vilcea
• Greedy best-first search will select: Fagaras
• Greedy search exampleAradSibiuFagarasSibiu(253)Bucharest(0)
• If Fagaras is expanded we get:
• Sibiu and Bucharest
• Goal reached !!
• Yet not optimal (see Arad, Sibiu, Rimnicu Vilcea, Pitesti)
• Greedy search, evaluation
• Completeness: NO (cfr. DF-search)
• Check on repeated states
• Minimizing h(n) can result in false starts, e.g. Iasi to Fagaras.
• Greedy search, evaluation
• Completeness: NO (cfr. DF-search)
• Time complexity?
• Cfr. Worst-case DF-search
• (with m is maximum depth of search space)
• Good heuristic can give dramatic improvement.
• Greedy search, evaluation
• Completeness: NO (cfr. DF-search)
• Time complexity:
• Space complexity:
• Keeps all nodes in memory
• Greedy search, evaluation
• Completeness: NO (cfr. DF-search)
• Time complexity:
• Space complexity:
• Optimality? NO
• Same as DF-search
• A* search
• Best-known form of best-first search.
• Idea: avoid expanding paths that are already expensive.
• Evaluation function f(n)=g(n) + h(n)
• g(n) the cost (so far) to reach the node.
• h(n) estimated cost to get from the node to the goal.
• f(n) estimated total cost of path through n to goal.
• A* search
• A* search uses an admissible heuristic
• A heuristic is admissible if it never overestimates the cost to reach the goal
• Are optimistic
• Formally: 1. h(n) <= h*(n) where h*(n) is the true cost from n 2. h(n) >= 0 so h(G)=0 for any goal G.e.g. hSLD(n) never overestimates the actual road distanceRomania exampleA* search example
• Find Bucharest starting at Arad
• A* search example
• Expand Arrad and determine f(n) for each node
• Best choice is Sibiu
• A* search example
• Expand Sibiu and determine f(n) for each node
• f(Fagaras)=c(Sibiu,Fagaras)+h(Fagaras)=239+179=415
• f(RimnicuVilcea)=c(Sibiu,RimnicuVilcea)+
• h(RimnicuVilcea)=220+192=413
• Best choice is RimnicuVilcea
• A* search example
• Expand Rimnicu Vilcea and determine f(n) for each node
• f(Craiova)=c(Rimnicu Vilcea, Craiova)+h(Craiova)=360+160=526
• f(Pitesti)=c(Rimnicu Vilcea, Pitesti)+h(Pitesti)=317+100=417
• f(Sibiu)=c(Rimnicu Vilcea,Sibiu)+h(Sibiu)=300+253=553
• Best choice is Fagaras
• A* search example
• Expand Fagaras and determine f(n) for each node
• f(Sibiu)=c(Fagaras, Sibiu)+h(Sibiu)=338+253=591
• f(Bucharest)=c(Fagaras,Bucharest)+h(Bucharest)=450+0=450
• Best choice is Pitesti !!!
• A* search example
• Expand Pitesti and determine f(n) for each node
• f(Bucharest)=c(Pitesti,Bucharest)+h(Bucharest)=418+0=418
• Best choice is Bucharest !!!
• Optimal solution (only if h(n) is admissable)
• Note values along optimal path !!
• Optimality of A*(standard proof)
• Suppose suboptimal goal G2 in the queue.
• Let n be an unexpanded node on a shortest to optimal goal G.
• f(G2 ) = g(G2 ) since h(G2 )=0> g(G) since G2 is suboptimal>= f(n) since h is admissibleSince f(G2) > f(n), A* will never select G2 for expansionBUT … graph search
• Discards new paths to repeated state.
• Previous proof breaks down
• Solution:
• Add extra bookkeeping i.e. remove more expensive of two paths.
• Ensure that optimal path to any repeated state is always first followed.
• Extra requirement on h(n): consistency (monotonicity)
• Consistency
• A heuristic is consistent if
• If h is consistent, we have
• i.e. f(n) is nondecreasing along any path.Optimality of A*(more usefull)
• A* expands nodes in order of increasing f value
• Contours can be drawn in state space
• Uniform-cost search adds circles.
• F-contours are gradually
• Added: 1) nodes with f(n)<C*2) Some nodes on the goalContour (f(n)=C*).Contour I has allNodes with f=fi, wherefi < fi+1.A* search, evaluation
• Completeness: YES
• Since bands of increasing f are added
• Unless there are infinitly many nodes with f<f(G)
• A* search, evaluation
• Completeness: YES
• Time complexity:
• Number of nodes expanded is still exponential in the length of the solution.
• A* search, evaluation
• Completeness: YES
• Time complexity: (exponential with path length)
• Space complexity:
• It keeps all generated nodes in memory
• Hence space is the major problem not time
• A* search, evaluation
• Completeness: YES
• Time complexity: (exponential with path length)
• Space complexity:(all nodes are stored)
• Optimality: YES
• Cannot expand fi+1 until fi is finished.
• A* expands all nodes with f(n)< C*
• A* expands some nodes with f(n)=C*
• A* expands no nodes with f(n)>C*
• Heuristic functions
• E.g for the 8-puzzle
• Avg. solution cost is about 22 steps (branching factor +/- 3)
• Exhaustive search to depth 22: 3.1 x 1010 states.
• A good heuristic function can reduce the search process.
• Heuristic functions
• E.g for the 8-puzzle knows two commonly used heuristics
• h1 = the number of misplaced tiles
• h1(s)=8
• h2 = the sum of the distances of the tiles from their goal positions (Manhattan distance).
• h2(s)=3+1+2+2+2+3+3+2=18
• Heuristic quality
• Effective branching factor b*
• Is the branching factor that a uniform tree of depth d would have in order to contain N+1 nodes.
• Measure is fairly constant for sufficiently hard problems.
• Can thus provide a good guide to the heuristic’s overall usefulness.
• A good value of b* is 1.
• Heuristic quality and dominance
• 1200 random problems with solution lengths from 2 to 24.
• If h2(n) >= h1(n) for all n (both admissible)
• then h2 dominates h1 and is better for searchInventing admissible heuristics
• Admissible heuristics can be derived from the exact solution cost of a relaxed version of the problem:
• Relaxed 8-puzzle for h1 : a tile can move anywhere
• As a result, h1(n) gives the shortest solution
• Relaxed 8-puzzle for h2 : a tile can move to any adjacent square.
• As a result, h2(n) gives the shortest solution.The optimal solution cost of a relaxed problem is no greater than the optimal solution cost of the real problem.Inventing admissible heuristics
• Admissible heuristics can also be derived from the solution cost of a subproblem of a given problem.
• This cost is a lower bound on the cost of the real problem.
• Pattern databases store the exact solution to for every possible subproblem instance.
• The complete heuristic is constructed using the patterns in the DB
• Inventing admissible heuristics
• Another way to find an admissible heuristic is through learning from experience:
• Experience = solving lots of 8-puzzles
• An inductive learning algorithm can be used to predict costs for other states that arise during search.
• Tree search algorithmfunction TREE-SEARCH(problem,fringe) return a solution or failurefringe INSERT(MAKE-NODE(INITIAL-STATE[problem]), fringe)loop doif EMPTY?(fringe) then return failurenode REMOVE-FIRST(fringe)if GOAL-TEST[problem] applied to STATE[node] succeedsthen return SOLUTION(node)fringe INSERT-ALL(EXPAND(node, problem), fringe)Tree search algorithm (2)function EXPAND(node,problem) return a set of nodessuccessors the empty setfor each <action, result> in SUCCESSOR-FN[problem](STATE[node]) dos a new NODE STATE[s]  result PARENT-NODE[s]  node ACTION[s]  action PATH-COST[s]  PATH-COST[node]+ STEP-COST(node, action,s) DEPTH[s]  DEPTH[node]+1 add s to successorsreturnsuccessors
Related Search

Previous Document

Website Promotion - 2 usability 7 text appearance

Next Document

Pdf download Josiah s Fire: Autism Stole His Words, God Gave Him a Voice E-book full

Related Documents Sep 24, 2017

A Local Search Genetic Algorithm for the Job Shop Scheduling Problem Sep 26, 2017

Cuckoo Search (CS) Algorithm - File Exchange - MATLAB Central Nov 7, 2017

The Future Search - A Critique of Vision 2030 Nov 20, 2017

Supporting Exploratory People Search: A Study of Factor Transparency and User Control Dec 11, 2017

A Tabu Search-based Algorithm for Mixed-Integer Nonlinear Problems and Its Application to Integrated Process and Control System Design Dec 19, 2017

Paper 25-A Harmony Search Based Algorithm for Detecting Distributed Predicates Feb 12, 2018

Trauma Informed Care: A Sociocoltural Perspective Feb 20, 2018

[PDF] Download The Informed Patient: A Complete Guide to a Hospital Stay (The Culture and Politics of Health Care Work) Ebook | READ ONLINE Mar 4, 2018

Lecture 6: 25/4/1435 Informed search strategies Mar 5, 2018

Focused Crawling in Depression Portal Search: A Feasibility Study Thanh Tin Tang (ANU)

View more...
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us. Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x