• Keine Ergebnisse gefunden

Lower bounds can be used to improve the search speed and limit the number of nodes and stations visited. Two approaches, namely goal-direction (Section8.3) and domination by labels at the terminal (Section8.4) have already been mentioned from a more theoretical point of view.

In this section we will first show how to calculate lower bounds for the criteria travel time, ticket cost, number of interchanges, and reliability of interchanges and afterwards how exactly they are used to speed up the search process via the aforementioned methods and a pruning technique.

Note that for storing the lower bound to one station from all other stations we need memory space quadratic in the number of stations. Saving the pruning status of each station for each possible pair of source and terminal station would even require cubic space.

8.5.1 The Station Graph for Lower Bounds

Let us first consider lower bounds for the criterion travel time: Regarding space efficiency, it is not reasonable to store a precomputed lower bound for every pair of stations. Thus, these values must be computable “on the fly” during the search. One easy approach for calculating a lower bound on the remaining travel-time is to calculate the straight-line distance from the stationS(n) of nodento the target station Ω and divide this value by the fastest travel speed of all trains in the data, as used for example by Schulz, Wagner and Weihe [SWW00]. Empirical testing revealed that this method leads only to a small speed-up since the bounds are too weak.

Our idea, giving tighter lower bounds, uses the station graph. This graph consists of one node per station and we insert an edge from station A to B if there is a direct connection between those stations The minimum travel time over all such connections (not considering traffic days) defines the travel time of the edge. We simply reverse all edges in thestation graph and use one Dijkstra-search on the station graph starting at the target station Ω at the beginning of each search. Thus we get a lower bound on the travel time to Ω forevery station or the information that no connection to Ω exists.

Ticket Cost

The same type of graph can be used to obtain lower bounds for fares. Instead of taking the fastest direct connection between two stations we use the cheapest connection (or

8.5 Lower bounds 107

Time

Interval-Name exp. Intervals width Nodes Edges

simple - - - 8,820 22,537

sixhours √

4 6h 35,280 113,896

rushhours √

4 var 35,280 117,762

fourhours √

6 4h 52,920 163,835

Table 8.2: Sizes of the station graphs for lower bounds on travel time or ticket cost, standard version (standard), with fixed interval sizes (sixhours / fourhours) or variable interval sizes for the two rush hours and the times in between (rushhours).

rather an estimate derived from the length and train class cf. Section6.2.2) and store its cost on the edges. Now one Dijkstra-search gives us lower bounds on the ticket cost to Ω for every station which we can reach Ω from.

Expanded Station Graph

If we use time expansion on the station graph (to some degree) we might be able to calculate tighter lower bounds. A station is now represented by a number ofknodesniS, each representing an intervalIi = [τi, τi+1) in time withτk+11. The intervals cover the whole day, i.e. Sk

i=1Ii = [0,1440). Now, we have an edge between stationsS and R connectingniS andnjR if a train departs in intervalIiat stationS and arrives in interval Ij at stationR. Its length is the fastest travel time over all trains sharing that property.

Additionally, an edge connects nodesniS andni+1S (1≤i≤k) representing waiting from the latest arrival in interval Ii to the first departure in interval Ii+1. Its length is the time difference between those two events.

These lower bounds are tighter but more costly: The computation of the bounds is more involved as we have a bigger graph with multiple start labels since the arrival time at the terminal is not known in advance. During the search we are no longer querying the lower bound for a station but for an interval at a station.

We used the following four graphs in our computational study standard Standard station graph without time expansion

sixhours Four nodes per station with an interval width of 6 hours each fourhours Six nodes per station with an interval width of 4 hours each

rushhours Four nodes per station, two for the morning and afternoon rush hours and two for the times in between

The sizes of these graphs can be found in Table8.2.

8.5.2 Interchange Graph

To obtain lower bounds for the number of interchanges, a graph representing train changes is required. The easiest way to obtain such a graph from the search graph is to contract all the change nodes (including all waiting edges) at a station to a singlestation nodeand each pair of arrival and departure nodes of train tat station S to anevent node fort at S (removing the stay-in-train edge). We assign edge weights of zero to all edges except

Q R

S

T

Q R

S

T

Figure 8.3: Example section of an interchange station graph with four stations (white nodes Q,R,S,T) and five routes (colored edges), route nodes are solid black (left). Same example with contraction of bidirectional routes (all except the blue one) to single event nodes (right).

entering edges. A backward Dijkstra-search from the terminal Ω may label all stations S with the minimum number of trains required to get fromS to Ω. This number minus one is, of course, the minimum number of train changes required.

Unfortunately, this graph is nearly as big as the original graph and the computation of the bounds is very slow. Instead of trains we can useroutes. Every train is represented in exactly one route with the same sequence of stations. As there are many more trains than routes, the graph size significantly reduces (cf. Table8.3).

In Figure8.3(left) we see an example. It is possible to get from StationS to station T with one train, namely the blue train. On the other hand, to get from stationT to S two trains are required (the purple and green ones).

Contracting Bidirectional Routes If a train route is available in forward and back-ward direction for a list of stations (S1, . . . , Sk), it is possible to reach any of the Sifrom stationSj (i6=j) using only one train. We may contract all event nodes in forward and backward direction on such a bidirectional route to a single event node (see Figure 8.3 (right)). For a bidirectional route serving k stations we need only half the number of entering and leaving edges. We have 1 node plus 2kedges instead of 2knodes plus 6k−2 edges (k−1 train edges and k leaving as well as k entering edges in either direction).

This construction saves 28% of the nodes and 40% of the edges (cf. Table8.3).

Reliability of Interchanges

The lower bound on the number of interchanges can also be used to determine an upper bound (as we maximize this criterion) on the reliability score of a connection. In Sec-tion 6.3 we have set the highest reliability factor for an interchange µ := 96%. So an upper bound for reliability of the remainder of a connection isµicfor the lower bound on the number of interchangesic. In case the destination is reachable without an additional

8.5 Lower bounds 109 Routes Standard Bidirectional

total routes routes Nodes Edges

Trains 68,073 68,073 - 810,622 2,414,433

Routes 7,267 7,267 - 105,048 281,842

Unified routes 4,946 2,625 2,321 75,648 168,874 Table 8.3: Sizes of the interchange station graph using trains (Trains) or routes without (Routes) and with (Unified routes) contraction of bidirectional routes.

interchange this evaluates to the neutral factor 1 =µ0. However, this upper bound seems not really tight (in fact for 4 additional interchanges we have a factor ofµ4= 85% only).

8.5.3 Domination by Labels at the Terminal

The technique to dominate labels by labels at the terminal (cf. Section8.4) is implemented as follows. We use these lower bounds on the cost of a path from nodev to station Ω for the criteria:

time: bound from the station graph with time as edge cost interchanges: bound from the interchange graph

fare: bound from the station graph with ticket cost as edge cost

reliability of transfers: the highest reliability factor for an interchange µ := 96%

to the power of the bound for the number of interchanges (from the interchange graph)

We maintain a list of relaxed Pareto optimal labels at the terminal station Ω. Every new label is checked against each label in this list. If the values of the label plus the lower bounds are dominated by any label in the list, there is no need to further regard the new one. It is discarded and not inserted into the priority queue.

8.5.4 Usage in Goal-Directed Search

Travel time is our relevant criterion for goal-direction. We use already accumulated travel time and a lower bound on the remaining travel time to the target station. The lower bound is computed via the station graph (see Section 8.5.1). For details we refer to Section 8.8.1. Although the search cannot be terminated once the first label at the target station Ω is extracted from the priority queue using goal-direction, labels at Ω are generated fairly early in the search process, thus improving the efficiency of the strategy

“domination by labels at the terminal” from the previous subsection.

8.5.5 Limiting the Search Horizon

We can use the lower bounds determined using the station graphs and the interchange graph to further improve the processing time. By labeling stations as unnecessary for our search we can prohibit the creation of labels and inspection of edges at these stations. In Figure8.4 we can see the results of the pruning steps introduced in the following.

Figure 8.4: Pruning results using the station graph. Dark blue are too far from the termi-nal, violet too far from the source, blue are pruned by triangles and green by biconnected components rule (left: Fulda to Hannover / right: N¨urnberg to Kassel ).

The basic idea is to use the lower bound β on the distance from source to target and label all stations unnecessary that have a lower bound of more thanf(β) for some suitable functionf(·). For example, for travel time the function could beftt:x→2xor for the number of interchangesfic : x→x+ 4. This technique is similar to the concept reach (introduced in Section8.1.4).

Bidirectional Station Graph Dijkstra It is not mandatory to limit oneself to only the distance to the terminal. If we are willing to perform an additional search to determine the distanceβsfrom the source, we can discard even more stations. Namely the ones we deem too far away from the source as well.

With two distances at our disposal it is possible to prune additional stations by our trianglesheuristic: those with a sum of distances to source and to target over the thresh-olddists+distt> g(min{β, βs}) for someg(·) with e.g. g(x) = 1.4f(x) for allx.

Pruning Biconnected Components of the Graph A careful inspection of the re-sulting graphs with some regions removed by pruning led to the discovery of dead ends and even articulation points in these graphs. It is not at all sensible to head into dead ends or cross articulation points, unless the destination is in that component. Otherwise, the only way to continue is to turn back and, in case of articulation points, cross them again. During dominance testing this is discovered, but not before the station is visited for the second time. To prevent that we employ the following approach:

After using all (or some) of the above mentioned pruning techniques, we calculate the biconnected components of the resulting graph. Then we perform a BFS from the component containing the source to the component containing the target. All stations in components not touched by this search can safely be ignored, since it is unrewarding to