eff_dist: Computation of effective path distance

Description Usage Arguments Value References Examples

View source: R/distance.r

Description

eff_dist computes the effective distance between all nodes in the network

Usage

1
2
3
4
5

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

NetOrigin documentation built on April 1, 2021, 5:07 p.m.