networkDynamic object reachable from an initial vertex by following paths constrained by edge timing.tPath(nd, v, direction=c('fwd','bkwd'),
type=c('earliest.arrive', 'latest.depart'),
start, end, active.default = TRUE, graph.step.time = 0)is.tPath(x)
'fwd' means search forwards in time and forward along edge directions, 'bkwd' means search backwards in time and backwards along edge directions.'earliest.arrive'will find the paths that arrive first at the target vertices,'latest.depart'will find the paths that leave get.change.times.'tPath'tPath which is essentially list with several elements providing information on the path found.start parameter. Unreachable vertices are marked with Inf0'fwd' or 'bkwd' of the pathWhen set to use direction='fwd' , type='earliest.arrive' tPath performs a time-minimizing Dijkstra's style Depth First Search to find the set of vertices reachable on a forward temporal path from the initial seed vertex v while respecting the constraints of edge timing.The path found is a earliest arriving (in contrast to the earliest leaving or quickest or latest arriving path). When there are multiple equivalent paths only a single one will be arbitrarily returned. NOTE THAT THE PATH-FINDING ALGORITHM WILL NOT GIVE CORRECT RESULTS IF ANY SPELLS CONTAIN VALUES LESS THAN 0.
When set to direction='bkwd' and type='latest.depart' the path will be found by searching backwards in time from the end point. In other words, it returns the set of vertices that can reach v, along with latest possible departure times from those vertices. Note that in this case the elapsed time values returned for tdist will be negative, indicating time measured backwards from the end bound.
When set to type='fewest.steps' the path returned will be a 'shortest' (fewest steps/graph hops) time-respecting path. This would not be necessiairly the quickest or earliest route, but would pass across the fewest possible number of edges (requires the fewest number of transmission steps).
The graph.step.time parmeter allows specifying an explicit duration for edge traversals. In this case the algorithm considers both the onset and terminus times of activity spells to ensure that suffecient time remains for an edge traversal to be made. If graph.step.time > the remaining duration of an edge's activity spell, the edge is considered non-traverseable. The primary use case for this parameter is to align the paths discovered with those that might be found by a discrete time transmission simulation in which a path can only spread a single graph hop per model timestep.
Vertex activity is currently ignored, and it is assumed that once a path reaches a vertex, all future edges from the vertex are accessible. The path search can be constrained in time using the start and end parameters to bound the time span to be explored by the path search.
'bwkd' 'latest.depart' is essentially the inverse of fwd earliest arrive. It finds the latest time paths backwards from the initial seed vertex. This is the latest-leaving time. Note that the distance returned are positive, but represent the latest distance back in time from the end parameter time at which a vertex can reach v.
The is.tPath function checks if an object has the class tPath.
Useful background information (for a slightly different algorithm) can be found in: B. Bui Xuan, Afonso Ferreira, Aubin Jarry. "Computing shortest, fastest, and foremost journeys in dynamic networks." RR-4589, 2002. https://hal.inria.fr/inria-00071996/document
B. Bui Xuan, Afonso Ferreira, Aubin Jarry. Evolving graphs and least cost journeys in dynamic networks. WiOpt'03: Modeling and Optimization in Mobile, Ad Hoc and Wireless Networks, Mar 2003, Sophia Antipolis, France. 10 p., 2003 https://hal.inria.fr/inria-00466676/document
require(networkDynamicData)
data(hospital_contact)
hosPath<-tPath(hospital,v=1)Run the code above in your browser using DataLab