EVOLUTION-MANAGER
Edit File: ego.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: Neighborhood of graph vertices</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 connect {igraph}"><tr><td>connect {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Neighborhood of graph vertices</h2> <h3>Description</h3> <p>These functions find the vertices not farther than a given limit from another fixed vertex, these are called the neighborhood of the vertex. </p> <h3>Usage</h3> <pre> connect(graph, order, mode = c("all", "out", "in", "total")) ego_size( graph, order = 1, nodes = V(graph), mode = c("all", "out", "in"), mindist = 0 ) ego( graph, order = 1, nodes = V(graph), mode = c("all", "out", "in"), mindist = 0 ) make_ego_graph( graph, order = 1, nodes = V(graph), mode = c("all", "out", "in"), mindist = 0 ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The input graph.</p> </td></tr> <tr valign="top"><td><code>order</code></td> <td> <p>Integer giving the order of the neighborhood.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Character constant, it specifies how to use the direction of the edges if a directed graph is analyzed. For ‘out’ only the outgoing edges are followed, so all vertices reachable from the source vertex in at most <code>order</code> steps are counted. For ‘"in"’ all vertices from which the source vertex is reachable in at most <code>order</code> steps are counted. ‘"all"’ ignores the direction of the edges. This argument is ignored for undirected graphs.</p> </td></tr> <tr valign="top"><td><code>nodes</code></td> <td> <p>The vertices for which the calculation is performed.</p> </td></tr> <tr valign="top"><td><code>mindist</code></td> <td> <p>The minimum distance to include the vertex in the result.</p> </td></tr> </table> <h3>Details</h3> <p>The neighborhood of a given order <code>o</code> of a vertex <code>v</code> includes all vertices which are closer to <code>v</code> than the order. Ie. order 0 is always <code>v</code> itself, order 1 is <code>v</code> plus its immediate neighbors, order 2 is order 1 plus the immediate neighbors of the vertices in order 1, etc. </p> <p><code>ego_size</code> calculates the size of the neighborhoods for the given vertices with the given order. </p> <p><code>ego</code> calculates the neighborhoods of the given vertices with the given order parameter. </p> <p><code>make_ego_graph</code> is creates (sub)graphs from all neighborhoods of the given vertices with the given order parameter. This function preserves the vertex, edge and graph attributes. </p> <p><code>connect</code> creates a new graph by connecting each vertex to all other vertices in its neighborhood. </p> <h3>Value</h3> <ul> <li><p><code>ego_size</code> returns with an integer vector. </p> </li> <li><p><code>ego</code> returns A list of <code>igraph.vs</code> or a list of numeric vectors depending on the value of <code>igraph_opt("return.vs.es")</code>, see details for performance characteristics. </p> </li> <li><p><code>make_ego_graph</code> returns with a list of graphs. </p> </li> <li><p><code>connect</code> returns with a new graph object. </p> </li></ul> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a>, the first version was done by Vincent Matossian </p> <h3>Examples</h3> <pre> g <- make_ring(10) ego_size(g, order = 0, 1:3) ego_size(g, order = 1, 1:3) ego_size(g, order = 2, 1:3) ego(g, order = 0, 1:3) ego(g, order = 1, 1:3) ego(g, order = 2, 1:3) # attributes are preserved V(g)$name <- c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j") make_ego_graph(g, order = 2, 1:3) # connecting to the neighborhood g <- make_ring(10) g <- connect(g, 2) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>