30
I’m working on a solution that involves determining the least effort route between two points in a building. (Imagine students on their first day of university, and they need to know where it is and how to get to a given classroom in a building, or how to get from the current classroom to the next class.)
Basically I have a Cartesian structure where each floor is mapped. I also have indicators of access points (doors, ramps for disabled, stairs) and the points where these points connect (Staircase of the Ground Floor connects with staircase of the 2nd floor in X48 Y4, for example), more or less like the image below:
Where cyan indicates a staircase, and odd-blue elevators, among other markers not displayed.
(For color-blind people, my sincere apologies and some additional information: the staircases are located at the top right of the maps; the elevators, near the center.)
I got my code based on a variant of the Dijkstra algorithm called A-Star (A*), which is basically the shortest path problem with some optimizations. (Curiosity: Several games implement variants of A* to determine the character route on a map.)
A* is perfect for determining routes on the same floor, but I have to take into account the various floors, each with a different layout.
Question
Is there any more appropriate way to solve this problem?
Or, more clearly (thanks bfavaretto),
Given the additional factor of N floors, is there any algorithm that is more indicated than A*?
Disclaimer:
Original isometric image of Dougillustrations.com.
I would even try to help you ... but for a color-blind man this color scheme is not helping
– Otto
I’d put +2 on that question if I could.
– Leonel Sanches da Silva
@Otto sorry! I added a paragraph especially for you. =)
– OnoSendai
@bfavaretto I think a clearer question format would be "Given the additional factor of N floors, is there any algorithm that is more indicated than A*?" Another point is performance (N users calculating their routes at the same time), but I don’t want to saturate the question with other 3984 associated...
– OnoSendai
Okay, now I get it. I think you need something like an A*, only in 3D. As it is not my specialty, I leave only one link that I found now in Google: http://roy-t.nl/index.php/2011/09/24/another-faster-version-of-a-2d3d-in-c/
– bfavaretto
@bfavaretto I downloaded and I’m taking a look. I searched before posting but it never occurred to me to look for A* and 3D. Mad Googlin' Skillz, bro.
– OnoSendai
Onosendai and @bfavaretto in this case is not 3D, but several 2D planes interconnected at specific points. 3D would be if you were jetpack around the building, and were moving vertically within the floor itself (from the point that is up to the hole in the slab where the staircase passes, for example).
– Bacco
In what software were these floor illustrations made?
– Tony
@Tony Good question - I just looked for an image that showed the floors in isometric format, thus facilitating the visualization (Keywords: Isometric Floors). It looks like the original is from an Australian designer - I’ll include the link to his work in the post.
– OnoSendai
@Otto [2], I am also (slightly green and red). And really when someone is going to do something that involves colors, there are so many normal colors, and the guy puts color that is not standard... Then complicates.
– HiHello