a-star

questions regarding the use of A* with the 15-square puzzle

I'm trying to build an A* solver for a 15-square puzzle. The goal is to re-arrange the tiles so that they appear in their natural positions. You can only slide one tile at a time. Each possible state of the puzzle is a node in the search graph. For the h(x) function, I am using an aggregate sum, across all tiles, of the tile's dis...

Searching in graphs trees with Depth/Breadth first/A* algorithms

I have a couple of questions about searching in graphs/trees: Let's assume I have an empty chess board and I want to move a pawn around from point A to B. A. When using depth first search or breadth first search must we use open and closed lists ? This is, a list that has all the elements to check, and other with all other elements tha...

Fastest cross-platform A* implementation?

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.co...

Simplest C# implementation of A* algorithm?

Hi all, I'm looking for a simple implementation of A* (A star) algorithm in C#. Any pointers? Thanks you. ...

How to avoid that the robot gets trapped in local minimum?

Hi, I have some time occupying myself with motion planning for robots, and have for some time wanted to explore the possibility of improving the opportunities as "potential field" method offers. My challenge is to avoid that the robot gets trapped in "local minimum" when using the "potential field" method. Instead of using a "random wal...

AStar in a specific case in C#

Hello. To an intership, I have use the A* algorithm in the following case : the unit shape is a square of height and width of 1, we can travel from a zone represented by a rectangle from another, but we can't travel outside these predifined areas, we can go from a rectangle to another through a door, represented by a segment on corres...

Can't create a list of elements linked by a "Parent".

I'm trying to create a method (using the A* algorithm) that solves a puzzle and returns the steps to that solution. The solution it's easy.. but I can't return the path to that. I used a list of Nodes and then every time a push back a new Node I set the parent pointing to the Node which new came; list<Node> opened; list<Node> closed; ...

Removing the obstacle that yields the best path from a map after A* traversal

I traverse a 16x16 maze using my own A* implementation. All is well. However, after the traversal, I would like to find out what wall would give me the best alternative path. Apart from removing every block and re-running A* on the maze, what's a more clever and elegant solution? I was thinking give every wall node (ignored by A*), a t...

Finding minimum cut-sets between bounded subgraphs

If a game map is partitioned into subgraphs, how to minimize edges between subgraphs? I have a problem, Im trying to make A* searches through a grid based game like pacman or sokoban, but i need to find "enclosures". What do i mean by enclosures? subgraphs with as few cut edges as possible given a maximum size and minimum size for numbe...

Water jugs heuristic function for A*

Hi all, For the classic water jugs search problem, even for more than three jugs, which are some admissible functions that can be used for the A* search algorithm? Edit: I know about http://www.dave-reed.com/csc550.S02/HW/HW4.html , but that function clearly is not consistent. ...

Getting shortest path between 2 nodes in quickgraph

Hello, i want to ask if there is any way to generate the shortest path from node A to node B without generating the shortest paths to all the other nodes (stop when node B is in the examined set) with A-star in QuickGraph. I want to plug QuickGraph into a game and thus generating all the paths is not allowed from the time limitations th...

Does anyone know where I can find a simple version of the A* algorithm in php?

Or version in a similar language. One that's for all types of maps not just 2d. ...

A* algorithm works OK, but not perfectly. What's wrong?

This is my grid of nodes: I'm moving an object around on it using the A* pathfinding algorithm. It generally works OK, but it sometimes acts wrongly: When moving from 3 to 1, it correctly goes via 2. When going from 1 to 3 however, it goes via 4. When moving between 3 and 5, it goes via 4 in either direction instead of the shorter w...

A* pathfinder obstacle collision problem

I am working on a project with a robot that has to find its way to an object and avoid some obstacles when going to that object it has to pick up. The problem lies in that the robot and the object the robot needs to pick up are both one pixel wide in the pathfinder. In reality they are a lot bigger. Often the A* pathfinder chooses to pl...

Adding waypoints to A* graph search

I have the ability to calculate the best route between a start and end point using A*. Right now, I am including waypoints between my start and end points by applying A* to the pairs in all permutations of my points. Example: I want to get from point 1 to point 4. Additionally, I want to pass through points 2 and 3. I calculate the pe...

Pathfinding in 2D Arrays

Let's say I have this 2D Array map { 0,0,0,0,7,1,1,1,1,1,1,1,1 }, { 0,7,7,7,7,1,1,1,24,1,1,1,1 }, { 0,7,24,24,24,24,24,24,24,1,1,3,1 }, { 0,7,23,23,23,23,23,23,24,1,1,3,1 }, { 0,7,24,23,23,23,23,23,23,1,1,1,1 }, { 0,7,24,23,23,23,23,23,23,1,1,1,1 }, { 0,7,23,23,23,23,23,23,24,1,3,1,1 }, { 0,7,24,24,24,24,24,24,24,1,3,1,1 }, { 0,0,0,0,1,...

PacMan character AI suggestions for optimal next direction

Firstly, this is AI for PacMan and not the ghosts. I am writing an Android live wallpaper which plays PacMan around your icons. While it supports user suggestions via screen touches, the majority of the game will be played by an AI. I am 99% done with all of the programming for the game but the AI for PacMan himself is still extremely w...

iPhone pathfinding implementation

I am trying to create a Pacman AI for the iPhone, not the Ghost AI, but Pacman himself. I am using A* for pathfinding and I have a very simple app up and running which calculates the shortest path between 2 tiles on the game board avoiding walls. So running 1 function to calculate a path between 2 points is easy. Once the function reach...

Performance of an A* search implemented in Clojure

I have implemented an A* search algorithm for finding a shortest path between two states. Algorithm uses a hash-map for storing best known distances for visited states. And one hash-map for storing child-parent relationships needed for reconstruction of the shortest path. Here is the code. Implementation of the algorithm is generic (st...

A* implementation always returns same value

Hi all, I seem to be either losing my mind or misimplementing the A* algorithm: Below is my code, it seems that no matter what values I enter it will always return 360. Am I missing some critical piece of information here? Also before anyone asks yes this is related to a machine learning assignment I received. public class A_...