path-finding

How to do pathfinding when a unit has inertia?

谁都会走 提交于 2019-12-10 06:53:47
问题 I'm currently working for pathfinding for a game where units are moving, but they have inertia. Most typical pathfinding algorithms (A*, Djikastra, etc.) are simply designed to minimize the length of the path. However, these techniques do not apply, as far as I know, to instances where the unit has inertia. If the unit has inertia, then there is a significant difference in the cost to leave a tile in a particular direction based on the direction you want to go. For example, the cost of

Visit all nodes in a graph with least repeat visits

独自空忆成欢 提交于 2019-12-08 01:40:46
问题 I have a tile based map where several tiles are walls and others are walkable. the walkable tiles make up a graph I would like to use in path planning. My question is are their any good algorithms for finding a path which visits every node in the graph, minimising repeat visits? For example: map example http://img220.imageshack.us/img220/3488/mapq.png If the bottom yellow tile is the starting point, the best path to visit all tiles with least repeats is: path example http://img222.imageshack

Algorithm like Bellman-Ford, only for multiple start, single destination?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-07 10:01:11
问题 Algorithms like the Bellman-Ford algorithm and Dijkstra's algorithm exist to find the shortest path from a single starting vertex on a graph to every other vertex. However, in the program I'm writing, the starting vertex changes a lot more often than the destination vertex does. What algorithm is there that does the reverse--that is, given a single destination vertex, to find the shortest path from every starting vertex? 回答1: Just reverse all the edges, and treated destination as start node.

Number of simple mutations to change one string to another?

匆匆过客 提交于 2019-12-07 08:52:25
问题 I'm sure you've all heard of the "Word game", where you try to change one word to another by changing one letter at a time, and only going through valid English words. I'm trying to implement an A* Algorithm to solve it (just to flesh out my understanding of A*) and one of the things that is needed is a minimum-distance heuristic. That is, the minimum number of one of these three mutations that can turn an arbitrary string a into another string b: 1) Change one letter for another 2) Add one

R - Finding least cost path through raster image (maze)?

随声附和 提交于 2019-12-07 04:44:25
问题 How can I find a non-linear path through raster image data? e.g., least cost algorithm? Starting and ending points are known and given as: Start point = (0,0) End point = (12,-5) For example, extract the approximate path of a winding river through a (greyscale) raster image. # fake up some noisy, but reproducible, "winding river" data set.seed(123) df <- data.frame(x=seq(0,12,by=.01), y=sapply(seq(0,12,by=.01), FUN = function(i) 10*sin(i)+rnorm(1))) # convert to "pixels" of raster data #

How to use the BFS algorithm to keep only the outer points?

こ雲淡風輕ζ 提交于 2019-12-06 16:07:42
问题 Let's say I have a 500x500 2D grid (from -250 to 250). Each cell of the grid has a certain value, from 0 to 100. What I've been trying to do is keep a list of all the cell with a value lower than 50 starting at the point (0, 0), but I would like not to keep all the points, but only the outer points (perimeter, bounds, a cell with a value lower than 50 that does not have 4 adjacent cells with a value lower than 50). The way I implemented the algorithm, I keep a list of all the points. How

Visit all nodes in a graph with least repeat visits

孤街浪徒 提交于 2019-12-06 10:13:40
I have a tile based map where several tiles are walls and others are walkable. the walkable tiles make up a graph I would like to use in path planning. My question is are their any good algorithms for finding a path which visits every node in the graph, minimising repeat visits? For example: map example http://img220.imageshack.us/img220/3488/mapq.png If the bottom yellow tile is the starting point, the best path to visit all tiles with least repeats is: path example http://img222.imageshack.us/img222/7773/mapd.png There are two repeat visits in this path. A worse path would be to take a left

java path from top to the bottom of the grid

两盒软妹~` 提交于 2019-12-06 09:59:02
问题 I have seen this question quite often, but it usually deals with finding only the number of the possible paths a robot can take. So, the question is: there is NxN grid, and a robot is standing at the top of the grid. In one move, it can move only to the right or to the bottom. Now, I would like to print out all the possible paths a robot can take. Given an NxN matrix, starting at [0][0], it has to finish at [N-1][N-1]. What I have tried is a simple recursive solution: public static void

A* (A-star) implementation in AS3

若如初见. 提交于 2019-12-06 09:33:56
I am putting together a project for a class that requires me to put AI in a top down Tactical Strategy game in Flash AS3. I decided that I would use a node based path finding approach because the game is based on a circular movement scheme. When a player moves a unit he essentially draws a series of line segments that connect that a player unit will follow along. I am trying to put together a similar operation for the AI units in our game by creating a list of nodes to traverse to a target node. Hence my use of Astar (the resulting path can be used to create this line). Here is my Algorithm

A.I. that can navigate a randomly generated 2D city

荒凉一梦 提交于 2019-12-06 02:12:35
问题 I'm writing an iOS game (Using UIView), which has a randomly generated 2D city. I need attacking A.I., that will take an intelligent path to find the player (without colliding with buildings). Can someone point me in the right direction as to what kind of algorithms I would use to achieve this? Edit: I've decided to use A*. I will create a grid on the map, test every grid intersection point, if that point is inside a building, I'll invalidate the point. The attacking A.I. player will then