eff_dist {NetOrigin}R Documentation

Computation of effective path distance

Description

eff_dist computes the effective distance between all nodes in the network

Usage

eff_dist(p)

eff_dijkstra(p, start)

spd_dijkstra(p, start)

Arguments

p

numeric matrix, representing the transition probability matrix for the network graph

start

start of path

Value

A numeric matrix, representing the effective distance between all nodes in the network graph.

References

Examples

# compute effective shortest path distance
data(ptnAth)
require(igraph)
net <- igraph::as_adjacency_matrix(ptnAth, sparse=FALSE)
p <- net/rowSums(net)
eff <- eff_dist(p)

# compute shortest path distance
data(ptnAth)
athnet <- as_adj(ptnAth, sparse=FALSE)
spd <- spd_dijkstra(athnet, start=1)

# compare calculations with the one from igraph
spd_igraph <- igraph::distances(ptnAth, v=1, algorithm='dijkstra')
all(spd[[1]] == spd_igraph)


[Package NetOrigin version 1.1-6 Index]