public class EdgeBasedWitnessPathSearcher extends Object
(source edge) -- s -- x -- t -- (target edge) Let x be a node to be contracted (the 'center node') and s and t neighboring un-contracted nodes of x that are directly connected with x (via a normal edge or a shortcut). This class is used to examine the optimal path between s and t in the graph of not yet contracted nodes. More precisely it looks at the minimal-weight-path from an original edge incoming to s (the 'source edge') to an arbitrary original edge incoming to t where the turn-costs at t onto a given original edge outgoing from t (the 'target edge') are also considered. This class is mainly used to differentiate between the following two cases:
1) The optimal path described above has finite weight and only consists of one edge from s to x, an arbitrary number of loops at x, and one edge from x to t. This is called a 'bridge-path' here. 2) The optimal path has infinite weight or it includes an edge from s to another node than x or an edge from another node than x to t. This is called a 'witness-path'.
To find the optimal path an edge-based unidirectional Dijkstra algorithm is used that takes into account turn-costs. The search can be initialized for a given source edge and node to be contracted x. Subsequent searches for different target edges will keep on building the shortest path tree from previous searches. For the performance of edge-based CH graph preparation it is crucial to limit the local witness path searches. However the search always needs to at least find the best bridge-path if one exists. Therefore we may stop expanding edges when a certain amount of settled edges is exceeded, but even then we still need to expand edges that could possibly yield a bridge-path and we may only stop this when it is guaranteed that no bridge-path exists. Here we limit the maximum number of settled edges during the search and determine this maximum number based on the statistics we collected during previous searches.
Constructor and Description |
---|
EdgeBasedWitnessPathSearcher(PrepareCHGraph chGraph,
PMap pMap) |
Modifier and Type | Method and Description |
---|---|
long |
getNumPolledEdges() |
String |
getStatisticsString() |
long |
getTotalNumSearches() |
int |
initSearch(int centerNode,
int sourceNode,
int sourceEdge)
Deletes the shortest path tree that has been found so far and initializes a new witness path search for a given
node to be contracted and search edge.
|
void |
resetStats() |
CHEntry |
runSearch(int targetNode,
int targetEdge)
Runs a witness path search for a given target edge.
|
public EdgeBasedWitnessPathSearcher(PrepareCHGraph chGraph, PMap pMap)
public int initSearch(int centerNode, int sourceNode, int sourceEdge)
centerNode
- the node to be contracted (x)sourceNode
- the neighbor node from which the search starts (s)sourceEdge
- the original edge incoming to s from which the search startspublic CHEntry runSearch(int targetNode, int targetEdge)
initSearch(int, int, int)
before calling this method to initialize the search.targetNode
- the neighbor node that should be reached by the path (t)targetEdge
- the original edge outgoing from t where the search endspublic String getStatisticsString()
public long getNumPolledEdges()
public long getTotalNumSearches()
public void resetStats()
Copyright © 2012–2020. All rights reserved.