Learn R Programming

timeordered (version 1.0.1)

shortesthoppath: Determines a path (shortest by the least number of unique vertices) between two vertices at two times.

Description

-

Usage

shortesthoppath(g, startvertexname, startvertextime, stopvertexname, stopvertextime)

Value

A vertex list containing all the events on the shortest-hop path between the start and stop vertices/times.

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.

stopvertextime

The time of the stop vertex. Must be a time at which an interaction has occurred involving this vertex.

Author

Benjamin Blonder bblonder@email.arizona.edu.

See Also

shortesttimepath

Examples

Run this code
data(ants)
allindivs <- c(union(as.character(ants$VertexFrom), as.character(ants$VertexTo)), "NULL1", "NULL2")
g <- generatetonetwork(ants, allindivs)
shp <- shortesthoppath(g, "WBGG", 927, "GYGG", 1423)
plottonet(g, shp)
title(paste(length(unique(shp$Name))," hops"))


Run the code above in your browser using DataLab