EVOLUTION-MANAGER
Edit File: sample_k_regular.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Create a random regular graph</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for sample_k_regular {igraph}"><tr><td>sample_k_regular {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a random regular graph</h2> <h3>Description</h3> <p>Generate a random graph where each vertex has the same degree. </p> <h3>Usage</h3> <pre> sample_k_regular(no.of.nodes, k, directed = FALSE, multiple = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>no.of.nodes</code></td> <td> <p>Integer scalar, the number of vertices in the generated graph.</p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>Integer scalar, the degree of each vertex in the graph, or the out-degree and in-degree in a directed graph.</p> </td></tr> <tr valign="top"><td><code>directed</code></td> <td> <p>Logical scalar, whether to create a directed graph.</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>Logical scalar, whether multiple edges are allowed.</p> </td></tr> </table> <h3>Details</h3> <p>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. </p> <p>The game simply uses <code><a href="sample_degseq.html">sample_degseq</a></code> with appropriately constructed degree sequences. </p> <h3>Value</h3> <p>An igraph graph. </p> <h3>Author(s)</h3> <p>Tamas Nepusz <a href="mailto:ntamas@gmail.com">ntamas@gmail.com</a> </p> <h3>See Also</h3> <p><code><a href="sample_degseq.html">sample_degseq</a></code> for a generator with prescribed degree sequence. </p> <h3>Examples</h3> <pre> ## A simple ring ring <- sample_k_regular(10, 2) plot(ring) ## k-regular graphs on 10 vertices, with k=1:9 k10 <- lapply(1:9, sample_k_regular, no.of.nodes=10) layout(matrix(1:9, nrow=3, byrow=TRUE)) sapply(k10, plot, vertex.label=NA) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>