Questions tagged [pathfinder]

68 questions
29
votes
11 answers

How do I implement an A* pathfinding algorithm, with movement costs for every programming language?

Can we get people to post code of simple, optimized implementations of the A* pathfinding algorithm, in every single language? This is mostly for fun and to play with what stackoverflow itself is capable of... although I actually am interested in…
IQpierce
  • 399
  • 2
  • 7
  • 17
9
votes
7 answers

AI: Fastest algorithm to find if path exists?

I am looking for a pathfinding algorithm to use for an AI controlling an entity in a 2D grid that needs to find a path from A to B. It does not have to be the shortest path but it needs to be calculated very fast. The grid is static (never changes)…
6
votes
3 answers

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…
Cheesebaron
  • 21,926
  • 13
  • 60
  • 110
6
votes
0 answers

Find shortest path on SVG Object

I have an SVG object with a floor map which is made from a creator user and I want to find dynamically the shortest path between 2 points on this object. Dijkstra algorithm is the better solution for finding shortest path into a graph but this…
user3016999
6
votes
2 answers

How to optimize A* (AStar) Search for Concave Shapes? (includes screenshots)

I am writing a fairly simple top down, 2D game. It uses an evenly spaced 2D grid of tiles for all collision data. Each tile in the grid is either solid or empty. For path finding I am using A* (A Star), and have tried both Manhattan and Diagonal…
Goose
  • 1,268
  • 1
  • 14
  • 27
5
votes
1 answer

How to implement the shortest path algorithm in this scenario?

In my assignment I have a MxN grid e.g. M = 5, N = 8 KKKK.... .###...X .XX#...X ...#.... ........ K - start point, X - finish point, # - obstacle I need to find the smallest number of moves to carry packages from start points to finish points. We…
MarJan
  • 51
  • 4
5
votes
1 answer

How to include javascript third party library in ionic app?

I am sorry to ask this silly question. I am trying to use pathfinding.js (https://github.com/qiao/PathFinding.js/) in ionic for my navigation.html page (a partial file located in the www/templates/ directory) but it's not working with partials files…
3
votes
1 answer

JPF(Java Path finder) for web application

Can JPF(Java Path Finder) be used for web applications. I have a web application (struts application). Now how do i test\verify it using JPF. Does a main method is mandatory to run jpf and find the results? because in a Servlet we dont have a main…
3
votes
2 answers

Java - gov.nasa.jpf.jvm.Verify Pathfinder Package Doesn't Exist

I am attempting use Java Pathfinder and I have pathfinder working. import gov.nasa.jpf.jvm.Verify; user.java:2: package gov.nasa.jpf.jvm does not exist import gov.nasa.jpf.jvm.Verify; I need to use the Verify.random function. Can anyone tell me…
Joshua Enfield
  • 15,822
  • 9
  • 45
  • 91
3
votes
2 answers

Non - perfect maze Generation

I have coded the A* Algorithm for a project. One of the requirements of this project is to randomly generate 50 mazes. I am a bit stuck because this is not similar to normal maze generations. In maze generations you have blocked and unblocked…
noobcoder24
  • 117
  • 8
3
votes
3 answers

pathfinding in 2d array

I am currently working on a project, in which I have to perform tasks with a 2 dimensional array, containing random numbers. The array forms a grid, which represents peaks (heights) of a mountain. I resolved every task except the last one: The last…
P. Zoltan
  • 31
  • 8
2
votes
1 answer

Shortest path between two location in 2D matrix

Here is a code that does path finder from index[0,0] looking for destination , example the value '9'. Should BFS or DFS do any better than the below algorithm? Any advice for better algorithms to accomplish the same? using System; public class…
2
votes
2 answers

How to make a plugin for [Path] Finder to browse zip-archives as folders?

What really surprises me is lack of some essential functionality in Finder, when one migrates from Windows to OS X. One of the things is a possibility to open an archive as a folder, i.e. staying in the directory tree and being able to drag and drop…
Andrei
  • 9,162
  • 7
  • 68
  • 103
1
vote
2 answers

How create a if else loop in C++ instead of multiple nesting?

I create a C++ program to use Dijkstra algorithm. To be more precise in calculations, i create a function that verify if a path exists between 2 values of my dijkstra matrix. My function : void existence_chemin(unsigned int tab[50][50], unsigned int…
Thomas
  • 73
  • 9
1
vote
0 answers

Path Finder, but getting all available paths

The question is this, when I use a simple Path A * I have the path between point A to point B, but what I need is for that path to go through all the available houses, for example: Using Path A * it returns me like this: What I need is this: The…
Jose Eduardo
  • 477
  • 9
  • 27
1
2 3 4 5