shortesthoppath: Determines a path (shortest by the least number of unique...

View source: R/shortesthoppath.R

shortesthoppathR Documentation

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.

Note

Multiple shortest-hop paths may exist; returns only one of them.

Author(s)

Benjamin Blonder bblonder@email.arizona.edu.

See Also

shortesttimepath

Examples

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"))



timeordered documentation built on Aug. 21, 2023, 1:06 a.m.