EVOLUTION-MANAGER
Edit File: is_tree.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: Decide whether a graph is a tree.</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 is_tree {igraph}"><tr><td>is_tree {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Decide whether a graph is a tree.</h2> <h3>Description</h3> <p><code>is_tree</code> decides whether a graph is a tree, and optionally returns a possible root vertex if the graph is a tree. </p> <h3>Usage</h3> <pre> is_tree(graph, mode = c("out", "in", "all", "total"), details = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>An igraph graph object</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Whether to consider edge directions in a directed graph. ‘all’ ignores edge directions; ‘out’ requires edges to be oriented outwards from the root, ‘in’ requires edges to be oriented towards the root.</p> </td></tr> <tr valign="top"><td><code>details</code></td> <td> <p>Whether to return only whether the graph is a tree (<code>FALSE</code>) or also a possible root (<code>TRUE</code>)</p> </td></tr> </table> <h3>Details</h3> <p>An undirected graph is a tree if it is connected and has no cycles. In the directed case, a possible additional requirement is that all edges are oriented away from a root (out-tree or arborescence) or all edges are oriented towards a root (in-tree or anti-arborescence). This test can be controlled using the mode parameter. </p> <p>By convention, the null graph (i.e. the graph with no vertices) is considered not to be a tree. </p> <h3>Value</h3> <p>When <code>details</code> is <code>FALSE</code>, a logical value that indicates whether the graph is a tree. When <code>details</code> is <code>TRUE</code>, a named list with two entries: </p> <table summary="R valueblock"> <tr valign="top"><td><code>res</code></td> <td> <p>Logical value that indicates whether the graph is a tree.</p> </td></tr> <tr valign="top"><td><code>root</code></td> <td> <p>The root vertex of the tree; undefined if the graph is not a tree.</p> </td></tr> </table> <h3>Examples</h3> <pre> g <- make_tree(7, 2) is_tree(g) is_tree(g, details=TRUE) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>