path.lengths.sink {streamDAG}R Documentation

Path Lengths

Description

Obtains all shortest in paths to a sink

Usage

path.lengths.sink(G, sink = NULL, inf.paths = TRUE)

Arguments

G

Graph object of class "igraph", see: See graph_from_literal.

sink

sink node from G.

inf.paths

Logical, consider infinite paths?

Value

Length of path to a sink

Author(s)

Ken Aho, Gabor Csardi wrote distances

Examples

murphy_spring <- graph_from_literal(IN_N --+ M1984 --+ M1909, IN_S --+ M1993, 
M1993 --+ M1951 --+ M1909 --+ M1799 --+ M1719 --+ M1653 --+ M1572 --+ M1452,
M1452--+ M1377 --+ M1254 --+ M1166 --+ M1121 --+ M1036 --+ M918 --+ M823, 
M823 --+ M759 --+ M716 --+ M624 --+ M523 --+ M454 --+ M380 --+ M233 --+ M153,
M153 --+ M91 --+ OUT)

path.lengths.sink(murphy_spring, sink = "OUT")

# with stream lengths as weights
data(mur_lengths)

E(murphy_spring)$weights <- mur_lengths[,2]
path.lengths.sink(murphy_spring, "OUT")

[Package streamDAG version 1.5 Index]