Learn R Programming

timeordered (version 0.9.6)

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)

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.

Value

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

See Also

shortesttimepath

Examples

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