Description Usage Arguments Value Author(s) References Examples
Given a network and source and destination nodes, greedy route packets in hyperbolic space and record the path followed until the target is reached.
If the packet visits any of the nodes in the vector faulty
, the second closest neighbour to the target is used instead, unless the faulty node is
a target or the source itself.
If the packet cannot reach its destination, a -1
is added to the path.
1 | get_greedy_routing_paths(net, polar, source, target, faulty = c())
|
net |
igraph; A complex network with N nodes. |
polar |
data frame; Polar coordinates (r, theta) of all nodes in the network. |
source |
vector; A vector with one or more node indices representing sources. |
target |
vector; A vector, the same size as |
faulty |
vector; A vector with one or more node indices representing faulty system components (default = c()). |
A list, the same size of source
or target
, with the paths followed to deliver the packet from each source to each target.
Gregorio Alanis-Lobato galanisl@uni-mainz.de
Boguna, M. and Krioukov, D. (2009) Navigating Ultrasmall Worlds in Ultrashort Time. Physical Review Letters 102(5).
Krioukov, D. et al. (2010) Hyperbolic geometry of complex networks. Physical Review E 82(3).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Generate an artificial network with the PS model
N <- 500
net <- ps_model(N, 6, 2.5, 0)
# Form vectors of random non-redundant source-target pairs
st <- 1000
# We subtract 1, because the formulae to go from linear upper
# diagonal indexing to (i,j) are zero-based
k <- sample(N*(N-1)/2, st) - 1
sources <- (N - 2 - floor(sqrt(-8*k + 4*N*(N-1)-7)/2.0 - 0.5))
targets <- (k + sources + 1 - N*(N-1)/2 + (N-sources)*((N-sources)-1)/2)
# Back to 1-based indexing
sources <- sources + 1
targets <- targets + 1
# Analyse the network's navigability
paths <- get_greedy_routing_paths(net$network, net$polar, sources, targets)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.