Learn R Programming

timeordered (version 1.0.1)

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)

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.

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.

Author

Benjamin Blonder bblonder@email.arizona.edu.

See Also

shortesthoppath

Examples

Run this code
data(ants)
allindivs <- c(union(as.character(ants$VertexFrom), as.character(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