100 likes | 182 Views
CGDD4003 – Spring 2010. A* Path Planning. Background. Developed in 1968 Searches state space Move from start state to goal state (source and destination) Iteratively expands options based upon Adjacent states (transition via “moves”) Heuristics. Workings of A*. A* (pronounced A star):
E N D
CGDD4003 – Spring 2010 A* Path Planning
Background • Developed in 1968 • Searches state space • Move from start state to goal state (source and destination) • Iteratively expands options based upon • Adjacent states (transition via “moves”) • Heuristics
Workings of A* • A* (pronounced A star): • Maintains an Open and Closed sets • Keeps working on “most promising” state • Generates successors of current state • Successors “placed” into Open or Closed set • Updates Open state if it already exists in Open • Maintains “parent path” for each node
Attributes of Each State • Heuristic estimate g(v) from start to v • CostFromStart(v) • Heuristic estimate h(v) from v to goal • CostToGoal(v) • Total path estimate t(v) • Used to select “most promising” • TotalCost(v) • t(v) = g(v) + h(v)
A* Algorithm: Initialize Initialize(start, goal, agent) Open = {} Closed = {} s = start CostFromStart[s] = 0 CostToGoal[s] = PathCostEstimate(start, goal, agent) [s] = null Open += s
A* Algorithm: Search A_Star_Search(start, goal, agent) Initialize(start, goal, agent) while Open != {} s = Open.Pop() if (s == goal) construct path backward using values return true else for each v Adjacency[s] cost = CostFromStart[s] + w(s, v, agent) if (cost < CostFromStart[v]) or (v Open and v Closed) [v] = s CostFromStart[v] = cost CostToGoal[v] = PathCostEstimate(v, goal, agent) TotalCost[v] = cost + CostToGoal[v] if (v Closed) remove v from Closed if (v Open) adjust v’s location in Open // move “up” else Open.Push(v) Closed.Push(s) return false
Estimation/Heuristic Function CostToGoal(v) = 0 CostToGoal(v) = 1
Properties ofHeuristics in A* • CostToGoal[v] estimate always decreases • PathCostEstimate(v) is the deciding factor • If PCE(v) is small, search space increases • If PCE(v) is big, search space decreases • But PCE must be <= true cost to ensure optimal path • If PCE > true cost, we’ll generate sub-optimal path • But do so in better (quicker) time!
PCE Heuristic Comparison Non-overestimating heuristic Overestimating heuristic
Considerations of A* • A significant consideration in A* path planning is memory • Must maintain Open and Closed sets • These take up large amounts of space • O(breadthdepth) • A* also requires us to re-sort the Open list frequently (which can be costly)