Description Usage Arguments Value Examples
# Vertices probababilites to be chosen can depend on 3 criterias: k - Their centrality index: degree, betweenness, etc (preferential attachment) t - Their topological distance from reference node(s) s - Their spatial distance from reference node(s) if all weigths are set to 0, its equals to random mode
1 2 3 4 5 6 7 8 9 10 11 12 | getVertices(
g,
n = 1,
vs = V(g),
mode = c("random", "targeted", "proba"),
ct.ind.FUN = betweenness,
ct.ind.w = 1,
v.dist.ref = V(g),
sp.dist.attr = "dist",
sp.dist.w = 0,
topo.dist.w = 0
)
|
g |
igraph object. |
n |
numeric; number of vertices to return (default: 1). |
vs |
igraph.vs; sequence in which to choose the |
mode |
character; method used to choose the |
ct.ind.FUN |
function used to compute centrality index of the vertices sequence.
Used only if ci.w > 0. Default is |
ct.ind.w |
exponent weighting vertices centrality index in probabilities mix. If negative, less central vertices are more likely to be chosen. Default is 1. |
v.dist.ref |
igraph.vs of reference from which to compute |
sp.dist.attr |
Name of edge attribute containing spatial distance. |
sp.dist.w |
Exponent weighting spatial distance in probabilities mix. |
topo.dist.w |
Exponent weighting topological distance in probabilities mix. |
An igraph.vs vertex or vertices sequence.
1 2 3 4 5 6 7 8 9 10 11 | library(igraph)
set.seed(123)
g = erdos.renyi.game(100, 120, 'gnm')
## Get a random vertex
getVertices(g)
## Get vertex with highest betweenness
v = getVertices(g, mode="targ")
v==V(g)[which.max(betweenness(g))]
## Get vertex with highest degree
v = getVertices(g, mode="targeted", ct.ind.FUN=degree)
v==V(g)[which.max(degree(g))]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.