path-finding

Pathfinding (routing, trip planning, …) algorithms on graphs with time restrictions

妖精的绣舞 提交于 2019-11-26 18:54:58
问题 I have a database of bus/train/... stops and the arrival/departure times on each date and so on. I'm looking for a way to do a search for the fastest(shortest/cheapest/least transitions) trip between two locations. I would like to have arbitrary locations in the future, using OpenStreetMap data to do walking between stops and from stops to start/end, however for the time being I just want to find path between two stops in the database. The problem is I can't seem to find much info about this

Pathfinding - A* with least turns

拥有回忆 提交于 2019-11-26 16:56:01
问题 Is it possible to modify A* to return the shortest path with the least number of turns ? One complication: Nodes can no longer be distinguished solely by their location, because their parent node is relevant in determining future turns, so they have to have a direction associated with them as well. But the main problem I'm having, is how to work number of turns into the partial path cost (g). If I multiply g by the number of turns taken (t), weird things are happening like: A longer path with