Databases Reference
In-Depth Information
Figure 5-16. Timestamp properties on relationships
In terms of traversing the graph, a calculation can be split into three legs. Legs one and
two, shown in Figure 5-17 , work their way upward from the start and end locations,
respectively, with each terminating at a delivery center. Because there is at most one
route between any two elements in the lower portion of the graph for any given delivery
period, traversing from one element to the next is simply a matter of finding an incoming
DELIVERY ROUTE relationship whose interval timestamps encompass the current delivery
period. By following these relationships, the traversals for legs one and two navigate a
pair of tree structures rooted at two different delivery centers. These two delivery centers
then form the start and end locations for the third leg, which crosses the upper portion
of the graph.
As with legs one and two, the traversal for leg three, as shown in Figure 5-18 , looks for
relationships—this time, CONNECTED_TO relationships—whose timestamps encompass
the current delivery period. Even with this time filtering in place, however, there are,
for any given period, potentially several routes between any two delivery centers in the
upper portion of the graph; thus the third leg traversal must sum the cost of each route,
and select the cheapest, making this a shortest weighted path calculation.
 
Search WWH ::




Custom Search