EVOLUTION-MANAGER
Edit File: subgraph.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: Subgraph of a 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 subgraph {igraph}"><tr><td>subgraph {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Subgraph of a graph</h2> <h3>Description</h3> <p><code>subgraph</code> creates a subgraph of a graph, containing only the specified vertices and all the edges among them. </p> <h3>Usage</h3> <pre> subgraph(graph, vids) induced_subgraph( graph, vids, impl = c("auto", "copy_and_delete", "create_from_scratch") ) subgraph.edges(graph, eids, delete.vertices = TRUE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The original graph.</p> </td></tr> <tr valign="top"><td><code>vids</code></td> <td> <p>Numeric vector, the vertices of the original graph which will form the subgraph.</p> </td></tr> <tr valign="top"><td><code>impl</code></td> <td> <p>Character scalar, to choose between two implementation of the subgraph calculation. ‘<code>copy_and_delete</code>’ copies the graph first, and then deletes the vertices and edges that are not included in the result graph. ‘<code>create_from_scratch</code>’ searches for all vertices and edges that must be kept and then uses them to create the graph from scratch. ‘<code>auto</code>’ chooses between the two implementations automatically, using heuristics based on the size of the original and the result graph.</p> </td></tr> <tr valign="top"><td><code>eids</code></td> <td> <p>The edge ids of the edges that will be kept in the result graph.</p> </td></tr> <tr valign="top"><td><code>delete.vertices</code></td> <td> <p>Logical scalar, whether to remove vertices that do not have any adjacent edges in <code>eids</code>.</p> </td></tr> </table> <h3>Details</h3> <p><code>induced_subgraph</code> calculates the induced subgraph of a set of vertices in a graph. This means that exactly the specified vertices and all the edges between them will be kept in the result graph. </p> <p><code>subgraph.edges</code> calculates the subgraph of a graph. For this function one can specify the vertices and edges to keep. This function will be renamed to <code>subgraph</code> in the next major version of igraph. </p> <p>The <code>subgraph</code> function currently does the same as <code>induced_subgraph</code> (assuming ‘<code>auto</code>’ as the <code>impl</code> argument), but this behaviour is deprecated. In the next major version, <code>subgraph</code> will overtake the functionality of <code>subgraph.edges</code>. </p> <h3>Value</h3> <p>A new graph object. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>Examples</h3> <pre> g <- make_ring(10) g2 <- induced_subgraph(g, 1:7) g3 <- subgraph.edges(g, 1:5, 1:5) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>