Learn R Programming

timeordered (version 0.9.6)

shortesttimepath: Determines a path (shortest by the least time) between a vertex at a start time and another vertex at any later time.

Description

-

Usage

shortesttimepath(g, startvertexname, startvertextime, stopvertexname)

Arguments

g
The time-ordered network on which to find paths.
startvertexname
The name of the start vertex.
startvertextime
The time of the start vertex. Must be a time at which an interaction has occurred involving this vertex.
stopvertexname
The name of the stop vertex.

Value

  • A vertex list containing all the events on the shortest-time path between the start vertex at the start time and the stop vertex at a later time.

See Also

shortesthoppath

Examples

Run this code
data(ants)
allindivs <- c(union(ants$VertexFrom, ants$VertexTo), "NULL1", "NULL2")
g <- generatetonetwork(ants, allindivs)
stp <- shortesttimepath(g, "WBGG", 927, "Q")
plottonet(g, stp)
title(paste(diff(range(stp$Time)), "time elapsed"))

Run the code above in your browser using DataLab