degree.sequence.game {igraph} | R Documentation |
It is often useful to create a graph with given vertex
degrees. This is exactly what degree.sequence.game
does.
degree.sequence.game(out.deg, in.deg = numeric(0), method = "simple", ...)
out.deg |
Numeric vector, the sequence of degrees (for undirected
graphs) or out-degrees (for directed graphs). For undirected graphs
its sum should be even. For directed graphs its sum should be the same
as the sum of in.deg . |
in.deg |
For directed graph, the in-degree sequence. |
method |
Character, the method for generating the graph. Right now only “simple” is implemented. |
... |
Additional arguments, these are used as graph attributes. |
The “simple” method connects the out-stubs of the edges (undirected graphs) or the out-stubs and in-stubs (directed graphs) together. This way loop edges and also multiple edges may be generated.
The new graph object.
Gabor Csardi csardi@rmki.kfki.hu
erdos.renyi.game
, barabasi.game
,
simplify
to get rid of the multiple and/or loops edges.
g <- degree.sequence.game(rep(2,100)) degree(g) g2 <- degree.sequence.game(1:10, 10:1) degree(g2, mode="out") degree(g2, mode="in")