path-finding

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

Finding all paths in directed graph with specific cost

感情迁移 提交于 2019-12-21 20:22:37
问题 Suppose we have the directed, weighted graph. Our task is to find all paths beetween two vertices (source and destination) which cost is less or equal =< N. We visit every vertex only once. In later version I'd like to add a condition that the source can be the destination (we just make a loop). I think it can be done with modified Dijkstra's algorithm, but I have no idea how implement such thing. Thanks for any help. 回答1: You could use recursive backtracking to solve this problem. Terminate

How to avoid two NavMeshAgent push away each other in Unity?

对着背影说爱祢 提交于 2019-12-21 15:18:12
问题 In my game, all player and monster characters have a NavMeshAgent component, when one character moves to another, it will push away the second one. I read the unity docs of NavMeshAgent, found the problem is affected by Obstacle Avoidance Type and Avoidance Priority , I have tried this, but still cannot have a perfect solution, I need the characters DO NOT push each other away and still take others as obstacles. Please give me some advice how to use NavMeshAgent well and resolve this problem.

how to get the last node in path in neo4j?

送分小仙女□ 提交于 2019-12-21 09:02:29
问题 In this cypher query,the longest path/paths between nodes which have relationship with STATUS="on" property with each other,will be returned,but I want to get also the last node of the path/paths. query: START n=node(*) MATCH p=n-[rels:INCLUDE*]->m WHERE ALL (rel IN rels WHERE rel.status='on') WITH COLLECT(p) AS paths, MAX(length(p)) AS maxLength RETURN FILTER(path IN paths WHERE length(path)= maxLength) AS longestPaths how should I add it to the query? thanks. 回答1: This would give two arrays

3D search using A* JPS

只愿长相守 提交于 2019-12-21 04:57:40
问题 How can I generalize Jump Point Search to a 3D search volume? So far, I have defined pruning rules for a 3D cube involving each of the three movements- straight (0,0,1), first-order diagonal (0,1,1) and second-order (1,1,1). What I'm mostly concerned about is the optimal turning points defined in the paper. I've been unable to ascertain exactly how they were derived, and therefore how to derive my own for three dimensions. Any suggestions as to how this can be done? 回答1: Rather than

Path finding in a Java 2d Game?

ぐ巨炮叔叔 提交于 2019-12-20 14:26:42
问题 Essentially its a pacman clone game I'm working on. I have an Enemy class, and 4 instances of this class created which all represent 4 ghosts of the game. All ghosts start up in random areas of the screen and then they have to work their way towards the pacman character. As the player controls the pacman, moving it around, they should follow it and take the nearest possible way towards him. There is no maze/obstacles (yet) so the entire map (400x400 pixels) is open ground to them. For the

Path finding in a Java 2d Game?

喜你入骨 提交于 2019-12-20 14:26:33
问题 Essentially its a pacman clone game I'm working on. I have an Enemy class, and 4 instances of this class created which all represent 4 ghosts of the game. All ghosts start up in random areas of the screen and then they have to work their way towards the pacman character. As the player controls the pacman, moving it around, they should follow it and take the nearest possible way towards him. There is no maze/obstacles (yet) so the entire map (400x400 pixels) is open ground to them. For the

Calculating distance between non directly-connected nodes in matrix

坚强是说给别人听的谎言 提交于 2019-12-20 05:36:07
问题 I made a adjacency matrix for cities and connecting between them. And for example A-B, B-C, C-D. Now I am wonder if I can calculate distance between cities that aren't connected. Is it possible to calculate distance in matrix between non connected nodes and find path? Cities class import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class GraphCities { private List<String> cities; private int[][] matrix; Scanner s = new Scanner(System.in); public GraphCities()

How to find path of exact length in graph

ⅰ亾dé卋堺 提交于 2019-12-20 03:41:08
问题 I would like to find path of fixed length (given while running the program) in undirected graph. I'm using adjacency matrix of my graph. I tried to use some algorithms like DFS or A*, but they only return the shortest path. Nodes can't be visited again. So let's say that my graph have 9 nodes and the shortest path is built from 4 nodes. I want to have additional variable that will "tell" the algorithm that I want to find path which have 7 nodes (for example) and it will return nodes which are

How to find path of exact length in graph

╄→尐↘猪︶ㄣ 提交于 2019-12-20 03:41:07
问题 I would like to find path of fixed length (given while running the program) in undirected graph. I'm using adjacency matrix of my graph. I tried to use some algorithms like DFS or A*, but they only return the shortest path. Nodes can't be visited again. So let's say that my graph have 9 nodes and the shortest path is built from 4 nodes. I want to have additional variable that will "tell" the algorithm that I want to find path which have 7 nodes (for example) and it will return nodes which are