Questions tagged [path-finding]

Pathfinding generally refers to the problem of finding the shortest route between two points, subject to any obstacles. Pathfinding has application in a wide range of areas including robotics and game development. Algorithms for pathfinding tend to be closely related to graph and tree search algorithms.

Pathfinding generally refers to the problem of finding the shortest route between two points, subject to any obstacles. Pathfinding has application in a wide range of areas including robotics and game development. Algorithms for pathfinding tend to be closely related to graph and tree search algorithms.

Significant Literature

External Links

Related Tags

1746 questions
15
votes
5 answers

Pathfinding 2D Java game?

I'm currently writing a very basic Java game based on the idea of Theme Hospital. I'm quite new to Java and am currently studying at the university my first year. I have done Java for nearly two years now on and off, but I'm finally devoting my time…
Relequestual
  • 11,631
  • 6
  • 47
  • 83
15
votes
1 answer

How do I adapt AStar in Godot to platformers?

I've been looking for a robust method of pathfinding for a platformer based game I'm developing and A* looks like it's the best method available. I noticed there is a demo for the AStar implementation in Godot. However, it is written for a grid/tile…
Matthew
  • 768
  • 1
  • 11
  • 25
14
votes
4 answers

Are there any usable path-finding libraries for python?

I'm working on a real-time isometric RPG in python, and wish to target mobile devices as a platform. The main area where I'm having difficulties is with my pathfinding. I have tried a few algorithms including A* and a few tweaks to better fit the…
theheadofabroom
  • 20,639
  • 5
  • 33
  • 65
14
votes
1 answer

Correct formulation of the A* algorithm

I'm looking at definitions of the A* path-finding algorithm, and it seems to be defined somewhat differently in different places. The difference is in the action performed when going through the successors of a node, and finding that a successor is…
Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
14
votes
6 answers

Finding the shortest path to visit all non-blocked squares on a grid

Let's say you have a grid like this (made randomly): Now let's say you have a car starting randomly from one of the while boxes, what would be the shortest path to go through each one of the white boxes? You can visit each white box as many times…
Laz
  • 6,036
  • 10
  • 41
  • 54
14
votes
7 answers

What is the most efficient way of finding a path through a small world graph?

I have a sea of weighted nodes with edges linking clusters of nodes together. This graph follows the typical small world layout. I wish to find a path finding algorithm, which isn't costly on processor power, to find a path along the best possible…
Setori
  • 10,326
  • 11
  • 40
  • 46
14
votes
3 answers

What is a good 2D grid-based path-finding algorithm?

I'm currently writing a 2D game in Javascript using the HTML5 element. It's coming along very nicely, but i have run into a problem. The level design for my game is a grid (so path cost moving from one cell to the north/south/east/west cell…
creXALBO
  • 307
  • 1
  • 3
  • 13
13
votes
2 answers

How to detect squares on a grid which can NEVER be part of a shortest path after adding blocks?

I have a grid with a start, finish, and some walls. Units take the shortest path (moving only up/down/left/right) from the start to the finish, without passing through walls. The user is allowed to add as many extra walls as they want to change…
12
votes
2 answers

Algorithm to find the shortest path, with obstacles

I have a collection of Points which represents a grid, I'm looking for an algorithm that gets me the shortest distance between point A and B. The catch being any point (excluding A and B) can have an obstacle obstructing the path, and thus must be…
Valchris
  • 1,451
  • 2
  • 14
  • 33
12
votes
2 answers

Implementation of A Star (A*) Algorithm in Java

Disclaimer: I have little background in Java, since I am predominantly a C# developer. Would like to have the java implementation of A* algorithm. Yes, I saw many versions of the same online and I am unable to choose between them. I am looking for…
naveen
  • 53,448
  • 46
  • 161
  • 251
12
votes
1 answer

Path finding Algorithms : A* Vs Jump Point Search

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…
Thilan.L
  • 123
  • 1
  • 7
12
votes
2 answers

Optimal ant colony location algorithm

Suppose there is a grid containing both walls (blocked cells) as well as food items placed in any location on the grid. Now suppose we are trying to decide the optimal location to place an ant colony on this grid, such that the ants have to travel…
Jose
  • 123
  • 4
12
votes
1 answer

Why is my A* implementation slower than floodfill?

I have a blank grid of 100, 100 tiles. Start point is (0,0), goal is (99,99). Tiles are 4-way connections. My floodfill algorithm finds the shortest path in 30ms, but my A* implementation is around 10x slower. Note: A* is consistently slower (3 -…
cyrus
  • 1,338
  • 3
  • 17
  • 26
11
votes
3 answers

Optimizing pathfinding in Constraint Logic Programming with Prolog

I am working on a small prolog application to solve the Skyscrapers and Fences puzzle. An unsolved puzzle: A solved puzzle: When I pass the program already solved puzzles it is quick, almost instantaneous, to validate it for me. When I pass the…
F. P.
  • 5,018
  • 10
  • 55
  • 80
11
votes
2 answers

How to restrict certain paths in NetworkX graphs?

I am trying to calculate shortest path between 2 points using Dijkstra and A Star algorithms (in a directed NetworkX graph). At the moment it works fine and I can see the calculated path but I would like to find a way of restricting certain…
nka
  • 679
  • 1
  • 7
  • 12