eff_dist: Computation of effective path distance

View source: R/distance.r

eff_distR 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

  • Dijkstra, E. W. (1959): A note on two problems in connexion with graphs. Numerische Mathematik, 1, 269-271. <DOI: 10.1007/BF01386390>

  • Brockmann, D. and Helbing, D. (2013): The hidden geometry of complex, network-driven contagion phenomena. Science, 342, 1337-1342. <DOI: 10.1126/science.1245200>

  • Manitz, J. (2014): Statistical Inference for Propagation Processes on Complex Networks. Ph.D. thesis, Georg-August-University Goettingen. Verlag Dr. Hut, ISBN 978-3-8439-1668-4. Available online: https://ediss.uni-goettingen.de/handle/11858/00-1735-0000-0022-5F38-B.

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)


NetOrigin documentation built on Sept. 8, 2023, 5:58 p.m.