path-finding

A* Pathfinding java not working properly [closed]

不羁岁月 提交于 2019-12-14 03:14:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am creating a Maze game in java and wants to add a smarty ghost (like Pacman) that move towards user location to catch him. For smarty ghost I chose A* PathFinding Algorithm and found below links for implementing this algorithm : https://code.google.com/p/a-star/source/browse/trunk/java/PathFinder.java?r=8

Is neo4j suitable for searching for paths of specific length

时间秒杀一切 提交于 2019-12-13 17:14:45
问题 I am a total newcommer in the world of graph databases. But let's put that on a side. I have a task to find a cicular path of certain length (or of any other measure) from start point and back. So for example, I need to find a path from one node and back which is 10 "nodes" long and at the same time has around 15 weights of some kind. This is just an example. Is this somehow possible with neo4j, or is it even the right thing to use? Hope I clarified it enough, and thank you for your answers.

What kind of heuristics for BFS use to solve this 'game' (find path)?

谁说胖子不能爱 提交于 2019-12-13 02:33:33
问题 I want to solve a 'game'. I have 5 circles, we can rotate circles into left or into right (90 degrees). Example: Goal: 1,2,3,....,14,15,16 Ex. of starting situations: 16,15,14,...,3,2,1 I'm using BFS to find path but I can't invent heuristic function (my every solutions are not good). I was trying manhattan distance and others... (Maybe idea is good but something wrong with my solution). Please help! 回答1: One trick you might try is to do a breadth-first search backward from the goal state.

Shortest path algorithm (eg. Dijkstra's) for 500+ waypoints/nodes?

江枫思渺然 提交于 2019-12-12 21:18:41
问题 I've asked about a shortest path algorithm here: 2D waypoint pathfinding: combinations of WPs to go from curLocation to targetLocation (To understand my situation, please read that question as well as this one.) It appears that the Dijkstra shortest path algorithm would be able to do what I need. However, I have about 500 to 1000 nodes in my routes map. The implementations I have seen so far limited the amount of nodes to something under 50. My question is: should I still use the Dijkstra

Python: solve “n-to-n” maze

人盡茶涼 提交于 2019-12-12 15:33:38
问题 I'm trying to write a script in python to solve a kind of maze with multiple starting points and multiple ending points. The correct path is obtained following straight lines from the starting point. For example a maze with 4 paths: At first I thought using the left-/right-hand rule but it does not make much sense due to the characteristics of the maze. I have tried making an algorithm to follow straight lines following 4 directions (up, down, left, right). What I have at the moment: from PIL

A* Pathfinding in a hexagonal grid

試著忘記壹切 提交于 2019-12-12 08:21:36
问题 Can anyone point me to a simple example that implements A* path-finding algorithm on a hexagonal grid (in JS). I have made it working on a square grid, however all my attempts to make it work on a hexagonal grid have failed. This is how my grid looks like: I'm using the same technique to both draw the grid and generate coordinates as seen in this topic. Here's the grid coords data along with the start, end coords: [0, 0] , [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [1, 3], [2, 0], [2, 1], [2, 2]

PHP: Determining Grid Count Between 2 Grids

你离开我真会死。 提交于 2019-12-12 02:47:33
问题 edit: Diagonal movement is allowed I have a 5x5 Grid (just temp. to make it easier on myself though will grow to 30x30 and larger) and I'm trying to determine a grid count between 2 grids, however, it's doing my head in and I was hoping maybe someone can point me in the right direction. What I'm trying to achieve is basically a user chooses 2 grids i.e. 3004 and 3017 it should then find the shortest route and count the grids. For instance, the grid count between 3004 and 3017 should be 4 ,

GKObstacleGraph How to Find Closest Valid point?

本秂侑毒 提交于 2019-12-12 01:38:34
问题 In a scenario where user wants to navigate via mouse or touch to some are of the map that is not passable. When sending the point to GKObstacleGRpah FindPath it just returns an empty array. I want the unit to go to closest (or close enough) passable point. What would be an appropriate way to find a closest valid point in GKObstacleGraph . I understand that I can get the GKObstacle so I can enumerate it's vertices, and I know my unit's position... But well... what is the next step ? NOTE: I am

Movement of turtles between nodes following the shortest path

橙三吉。 提交于 2019-12-11 17:13:19
问题 I am trying to move my citizens from one node (slocation) to another node (new-location) calculating the shortest path. I could only calculate the distance from slocation to new-location using set total-expected-path [distance [slocation] of myself] of new-location. However, I am pretty sure that the following line after to set total-expected-path are not correct. I got the following error: this code can't be run by a turtle, only a link error while node 35 running LINK-LENGTH How can I

WPF - C# - Creating and setting image coordinates in code - behind

谁都会走 提交于 2019-12-11 12:07:52
问题 I currently work on WPF application according to my AI interest. I wrote a Uniform Cost Search algorithm (pathfinding) and want to present it in graphical way. Path should be found and show on a graph which could be adjusted by user. I'm quite new in WPF technology, I worked more with WinForms and now have a problem with creating and managing graphical elements. In other words - I want to give opportunity to click on data grid and create your own node (sth like place on a map) which is