EVOLUTION-MANAGER
Edit File: topo_sort.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: Topological sorting of vertices in 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 topo_sort {igraph}"><tr><td>topo_sort {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Topological sorting of vertices in a graph</h2> <h3>Description</h3> <p>A topological sorting of a directed acyclic graph is a linear ordering of its nodes where each node comes before all nodes to which it has edges. </p> <h3>Usage</h3> <pre> topo_sort(graph, mode = c("out", "all", "in")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The input graph, should be directed</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Specifies how to use the direction of the edges. For “<code>out</code>”, the sorting order ensures that each node comes before all nodes to which it has edges, so nodes with no incoming edges go first. For “<code>in</code>”, it is quite the opposite: each node comes before all nodes from which it receives edges. Nodes with no outgoing edges go first.</p> </td></tr> </table> <h3>Details</h3> <p>Every DAG has at least one topological sort, and may have many. This function returns a possible topological sort among them. If the graph is not acyclic (it has at least one cycle), a partial topological sort is returned and a warning is issued. </p> <h3>Value</h3> <p>A vertex sequence (by default, but see the <code>return.vs.es</code> option of <code><a href="igraph_options.html">igraph_options</a></code>) containing vertices in topologically sorted order. </p> <h3>Author(s)</h3> <p>Tamas Nepusz <a href="mailto:ntamas@gmail.com">ntamas@gmail.com</a> and Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> for the R interface </p> <h3>Examples</h3> <pre> g <- barabasi.game(100) topo_sort(g) </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>