Description Usage Arguments Value Author(s) References Examples
Given a network and source and destination nodes, greedy route packets in hyperbolic space and record successful deliveries. If the packet
visits any of the nodes in faulty, it is dropped and the delivery flagged as unsuccessful (unless the faulty node is a target).
1 | greedy_route_packets(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 vector, the same size as source or target, with the hop stretch required to deliver the packet
from each source to each target, or 0 if the packet was dropped.
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 19 20 21 | # 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
hop.stretch <- greedy_route_packets(net$network, net$polar, sources, targets)
# Compute the fraction of succesfully delivered packets
sum(hop.stretch > 0)/st
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.