Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

What is the best way to represent a map

$
0
0
I am trying to represent a map and I am wondering what is the best data structure to do so?

I though about using a graph, so that I can use Dijkstra's algorithm to find the shortest path from one room to another. But I am now wondering if that is a good approaph, maybe I should use a HashMap instead?

If you're curious here is the map I am trying to represent. (I am going to program a robot to navigate from one room to another. The rooms are the squares with numbers and the red lines are the doors to the rooms and the robot has to travel along the blue line only.)

Posted Image

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>