k.regular.game

0th

Percentile

Create a random regular graph

Generate a random graph where each vertex has the same degree.

Keywords
graphs
Usage
k.regular.game (no.of.nodes, k, directed = FALSE, multiple = FALSE)
Arguments
no.of.nodes
Integer scalar, the number of vertices in the generated graph.
k
Integer scalar, the degree of each vertex in the graph, or the out-degree and in-degree in a directed graph.
directed
Logical scalar, whether to create a directed graph.
multiple
Logical scalar, whether multiple edges are allowed.
Details

This game generates a directed or undirected random graph where the degrees of vertices are equal to a predefined constant k. For undirected graphs, at least one of k and the number of vertices must be even.

The game simply uses degree.sequence.game with appropriately constructed degree sequences.

Value

  • An igraph graph.

concept

  • Random graph model
  • Regular graph

See Also

degree.sequence.game for a generator with prescribed degree sequence.

Aliases
  • k.regular.game
Examples
## A simple ring
ring <- k.regular.game(10, 2)
plot(ring)

## k-regular graphs on 10 vertices, with k=1:9
k10 <- lapply(1:9, k.regular.game, no.of.nodes=10)

layout(matrix(1:9, nrow=3, byrow=TRUE))
sapply(k10, plot, vertex.label=NA)
Documentation reproduced from package igraph, version 0.6.5-2, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.