Open ctchervenkov opened 2 years ago
That is a nice bug. I don't think adding a shortest path search would make the whole routing that much slower - it is already quite slow, anyway. Perhaps another idea would be to avoid traveling back to nodes already visited. So the algorithm would be altered that (1) the next node is selected which is closest to the destination (2) the next node has not been visited yet (unless all alternative nodes have been visited already, in which case only rule (1) applies).
Maybe @tschlenther has an opinion on the topic?
CONTEXT The Benenson parking search model, as implemented in the parking search contrib, is divided into 4 stages :
PROBLEM In the SEARCH_WHILE_APPROACH, the routine selects the next link using the following logic:
This selection algorithm is simple and works very well for grid networks with bidirectional links of similar length. However, let's consider the following example below.
Imagine a trip with destination at F and for which the SEARCH_WHILE_APPROACH phase is triggered at node B. At node B, there are 2 out link: link 2 from B to A and link 4 from B to C. Node C is closer to node F than node A, so link 4 is chosen. At node C, there are 2 out link: link 5 from C to D and link 3 from C to B. Node B is closer to node F than node D, so link 3 is chosen. We just entered an infinite loop.
SOLUTION The solution would be to consider the shortest path from each possible next link to the destination node:
However, this might substantially increase computation time. In addition, the algorithm would differ from the original one proposed by Benenson et al.