a-star

A-star: heuristic for multiple goals

╄→гoц情女王★ 提交于 2019-12-29 07:43:11
问题 Let's consider a simple grid, where any point is connected with at most 4 other points (North-East-West-South neighborhood). I have to write program, that computes minimal route from selected initial point to any of goal points, which are connected (there is route consisting of goal points between any two goals). Of course there can be obstacles on grid. My solution is quite simple: I'm using A* algorithm with variable heuristic function h(x) - manhattan distance from x to nearest goal point.

Is A* returning a constant fscore expected under these conditions? If so how do I tie break better?

99封情书 提交于 2019-12-25 02:26:52
问题 EDIT: I answered my own question. I cant post it as an answer because I have less than 10 rep. I have included it as an edit under the line of ~~~~~~~~~~. I believe this question does not require a code sample as it is about the algorithm. not a specific implementation. Suppose you have a grid of nodes each of which are connected to four neighbours with edge weight one (i.e. there is no diagonal movement). The heuristic being used is Manhattan distance. The start is in the upper left corner,

A* vs trees in longest path

僤鯓⒐⒋嵵緔 提交于 2019-12-24 05:55:51
问题 Let T be a tree in which each node represents a state. The root represents the initial state. An edge going from a parent to a child specifies an action that can be performed on the parent in order to change state (the new state will be the child). Each edge is associated with a gain, i.e., I gain something by transitioning from the parent state to the child state. Moreover, suppose that each path from the root to a leaf node has length Q. My objective is the one of finding the most promising

A* for finding shortest path and avoiding lines as obstacles

狂风中的少年 提交于 2019-12-23 18:01:03
问题 I have to get the (shortest)/(an optimal) distance between two points in 2D. I have to avoid shapes that are lines, that may be connected together. Any suggestion on how to represent the nodes I can travel on? I have thought of making a grid, but this doesn't sound very accurate or elegant. I would consider a node as unwalkable if any point of a line is inside a square (with the node being the center of the square). An example would be going from point A to B. Is the grid the recommended way

Path finding Algorithms : A* Vs Jump Point Search

夙愿已清 提交于 2019-12-22 04:31:43
问题 I know that A* is better than Dijkstra's algorithm because it takes heuristic values into account, but from A* and Jump Point search which is the most efficient algorithm for finding the shortest path in an environment with obstacles? and what are the differences? 回答1: Jump Point Search is an improved A* based on some conditions on the graph. Thus, if you meet these conditions (uniform-cost grid mostly), JPS is strictly better than A* (same optimality, best cases can be order of magnitudes

Can somebody explain in Manhattan dstance for the 8 puzzle in java for me?

随声附和 提交于 2019-12-22 01:32:04
问题 i am writing an A* algorithm which can solve the 8-puzzle in Java, so far i have implemented DFS, BFS, A* using the number of tiles out of place and i just need to implement it using the heuristic for the Manhattan distance. As you are probably aware the Manhattan distance is the sum of each tiles displacement in relation to its current position and its index in the goal state. I have googled around and found these stack over flow topics: Calculating Manhattan Distance Manhattan distance in A

AStar - explanation of name

心不动则不痛 提交于 2019-12-21 07:16:32
问题 I am looking for an explanation why the AStar / A* algorithm is called AStar. All similar (shortest path problem) algorithms are often named like its developer(s), so what is AStar standing for? 回答1: There were algorithms called A1 and A2. Later, it was proved that A2 was optimal and in fact also the best algorithm possible, so he gave it the name A* which symbolically includes all possible version numbers. Source: In 1964 Nils Nilsson invented a heuristic based approach to increase the speed

What's the difference between best-first search and A* search?

落花浮王杯 提交于 2019-12-20 09:49:51
问题 In my text book I noticed that both these algorithms work almost exactly the same, I am trying to understand what's the major difference between them . The textbook traversed this example using A* the same way it did with best-first search . Any help would be appreciated. 回答1: Best-first search algorithm visits next state based on heuristics function f(n) = h with lowest heuristic value (often called greedy). It doesn't consider cost of the path to that particular state. All it cares about is

Fastest cross-platform A* implementation?

*爱你&永不变心* 提交于 2019-12-20 08:56:01
问题 With so many implementations available, what is the fastest executing (least CPU intensive, smallest binary), cross-platform (Linux, Mac, Windows, iPhone) A* implementation for C++ using a small grid? Implementations Google returns: http://www.heyes-jones.com/astar.html (Most links on that site are dead.) http://www.grinninglizard.com/MicroPather (Said to be slower than Heyes-Jones'.) http://www.ceng.metu.edu.tr/~cuneyt/codes.html (Generic C++ code.) http://swampthingtom.blogspot.com/2007/07

Heuristic for using A* to find the path with the highest gain

夙愿已清 提交于 2019-12-20 03:09:09
问题 Suppose that I want to change the logic in A*, trying to find the most useful path (i.e., the one with the highest gain) instead of finding the shortest path (i.e., the one with the lowest cost). In my case, a goal is not fixed as a unique ending node. A node is defined as any node having distance B from the starting point. In the vanilla version ("finding the shortest path") I am required to not overestimate the cost (i.e., finding a heuristic that is less or equal to the real cost). In my