Overview comments on #1247 on certain things not in the java docs:
- we introduce a way to store the original first and last edge so that we do not need to store the turn cost multiple times (e.g. for every new shortcut)
- The EdgeBasedNodeContractor plays the key part of this algorithm:
- Assume source and target nodes
s
andt
connected like*->s-->x-->t->*
and you want to contractx
(center node). In order to determine if a shortcuts->t
is required the contractor implements the AggressiveStrategy class that searches from all incoming edges ofs
to all outgoing edges oft
- The unidirectional, edge-based Dijkstra search is done in the separate WitnessPathSearcher class, handling lots of special cases (see EdgeBasedNodeContractorTest for more details)
- General CH concept: if there is a witness path with weight w1 and a bridge path with w2, and it is
w1<w2
; only then you do not need to add a shortcut when contractingx
- Assume source and target nodes
- The current default for query time is the A* algorithm unlike the node-based CH where this is slightly slower. AStarBidirectionEdgeCHNoSOD has special methods like bwdSearchCanBeStopped
- Why is
s->a->x->t
a witness path and not a bridge path? Simply because we'll handle adding shortcut when s=a. This could be used for node-based preparation too, to further reduce adding shortcuts. Currently we explicitly skipx
there, which might lead to a new shortcut in the case ofs->a->x->t
.