Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Looking for pathing algorithms for maps without edges

Tags:

c++

c#

algorithm

I have 2D world maps that are basically Mercator-Like projections, (If you walk west long enough you end up east of where you started)

Question I have: Can you use A* for computing paths on these types of maps as well?

I can't think of any reason why you couldn't (I'm thinking that you would simply represent the edge map nodes such that the North, South, East, Wed, "border" nodes simply connected to the opposite side).

Thanks in advance, if anyone has seen something like this before or can give me a few hints I would appreciate it.

like image 747
Ivan Bohannon Avatar asked Sep 21 '11 16:09

Ivan Bohannon


People also ask

Which algorithm is used for finding the shortest paths?

Dijkstra's Algorithm finds the shortest path between a given node (which is called the "source node") and all other nodes in a graph.

Which path finding algorithm is used in Google Maps?

Google Maps is based on a very simple but incredibly effective algorithm: the Dijkstra algorithm. It takes its name from its inventor, Edsger Dijkstra, one of the pioneering founders of modern computing.

What are the different path finding algorithms?

Algorithms such as Greedy, Dijkstra's algorithm, and A* eliminate paths either using educated guesses(heuristics) or distance from source to node V to find the optimal path. By eliminating impossible paths, these algorithms can achieve time complexities as low as O(E log(V)).

Which algorithm is best for path finding?

A* is the most popular choice for pathfinding, because it's fairly flexible and can be used in a wide range of contexts. A* is like Dijkstra's Algorithm in that it can be used to find a shortest path. A* is like Greedy Best-First-Search in that it can use a heuristic to guide itself.


1 Answers

Pathfinding algorithms don't really care about global topology of the map. The only tricky part is to get a good estimator for A* but using the 3D distance should be ok if your map is indeed a surface in a 3d space and step cost is step length.

Your map can have all sort of strange "connections" (including for example knotted bridges) and this will not be a problem if you implement A* correctly.

like image 192
6502 Avatar answered Oct 11 '22 14:10

6502