EVOLUTION-MANAGER
Edit File: sample_fitness.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: Random graphs from vertex fitness scores</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_fitness {igraph}"><tr><td>sample_fitness {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Random graphs from vertex fitness scores</h2> <h3>Description</h3> <p>This function generates a non-growing random graph with edge probabilities proportional to node fitness scores. </p> <h3>Usage</h3> <pre> sample_fitness( no.of.edges, fitness.out, fitness.in = NULL, loops = FALSE, multiple = FALSE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>no.of.edges</code></td> <td> <p>The number of edges in the generated graph.</p> </td></tr> <tr valign="top"><td><code>fitness.out</code></td> <td> <p>A numeric vector containing the fitness of each vertex. For directed graphs, this specifies the out-fitness of each vertex.</p> </td></tr> <tr valign="top"><td><code>fitness.in</code></td> <td> <p>If <code>NULL</code> (the default), the generated graph will be undirected. If not <code>NULL</code>, then it should be a numeric vector and it specifies the in-fitness of each vertex. </p> <p>If this argument is not <code>NULL</code>, then a directed graph is generated, otherwise an undirected one.</p> </td></tr> <tr valign="top"><td><code>loops</code></td> <td> <p>Logical scalar, whether to allow loop edges in the graph.</p> </td></tr> <tr valign="top"><td><code>multiple</code></td> <td> <p>Logical scalar, whether to allow multiple edges in the graph.</p> </td></tr> </table> <h3>Details</h3> <p>This game generates a directed or undirected random graph where the probability of an edge between vertices <i>i</i> and <i>j</i> depends on the fitness scores of the two vertices involved. For undirected graphs, each vertex has a single fitness score. For directed graphs, each vertex has an out- and an in-fitness, and the probability of an edge from <i>i</i> to <i>j</i> depends on the out-fitness of vertex <i>i</i> and the in-fitness of vertex <i>j</i>. </p> <p>The generation process goes as follows. We start from <i>N</i> disconnected nodes (where <i>N</i> is given by the length of the fitness vector). Then we randomly select two vertices <i>i</i> and <i>j</i>, with probabilities proportional to their fitnesses. (When the generated graph is directed, <i>i</i> is selected according to the out-fitnesses and <i>j</i> is selected according to the in-fitnesses). If the vertices are not connected yet (or if multiple edges are allowed), we connect them; otherwise we select a new pair. This is repeated until the desired number of links are created. </p> <p>It can be shown that the <em>expected</em> degree of each vertex will be proportional to its fitness, although the actual, observed degree will not be. If you need to generate a graph with an exact degree sequence, consider <code><a href="sample_degseq.html">sample_degseq</a></code> instead. </p> <p>This model is commonly used to generate static scale-free networks. To achieve this, you have to draw the fitness scores from the desired power-law distribution. Alternatively, you may use <code><a href="sample_fitness_pl.html">sample_fitness_pl</a></code> which generates the fitnesses for you with a given exponent. </p> <h3>Value</h3> <p>An igraph graph, directed or undirected. </p> <h3>Author(s)</h3> <p>Tamas Nepusz <a href="mailto:ntamas@gmail.com">ntamas@gmail.com</a> </p> <h3>References</h3> <p>Goh K-I, Kahng B, Kim D: Universal behaviour of load distribution in scale-free networks. <em>Phys Rev Lett</em> 87(27):278701, 2001. </p> <h3>Examples</h3> <pre> N <- 10000 g <- sample_fitness(5*N, sample((1:50)^-2, N, replace=TRUE)) degree_distribution(g) ## Not run: plot(degree_distribution(g, cumulative=TRUE), log="xy") </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>