Add more routing criteria to improve route quality
- Dominant language
- C++
- Stars
- 24
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Currently, our search algorithm will follow the first part it finds. At some points, it might be beneficial to prefer certain other options, as long as the arrival time at the station is the same.
For example in the following situation, instead of jumping on the train directly, we could take a detour around the block.

as long as we reach the same connection that services the following stops towards our destination:

In the second situation, we didn't have enough time to catch the detour connection (due to the longer walk segment) and only take the train leaving later from the station.
By considering criteria like hops / changing times / possible other influences, we could account for situations like this and prevent detours of this kind.
This issue is related to, but not the same as https://github.com/mapbox/directions-transit/issues/104 which resulted in a longer route than was necessary.
Contributor guide
Research direction
Begin by locating the search algorithm that selects the first available route and compare it with the route situations shown in the issue. The work is complete when routing can consider hops, changing times, or other stated criteria to avoid unnecessary detours while preserving the required arrival connection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100