EVOLUTION-MANAGER
Edit File: make_bipartite_graph.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: Create a bipartite 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 is_bipartite {igraph}"><tr><td>is_bipartite {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Create a bipartite graph</h2> <h3>Description</h3> <p>A bipartite graph has two kinds of vertices and connections are only allowed between different kinds. </p> <h3>Usage</h3> <pre> is_bipartite(graph) make_bipartite_graph(types, edges, directed = FALSE) bipartite_graph(...) </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>types</code></td> <td> <p>A vector giving the vertex types. It will be coerced into boolean. The length of the vector gives the number of vertices in the graph. When the vector is a named vector, the names will be attached to the graph as the <code>name</code> vertex attribute.</p> </td></tr> <tr valign="top"><td><code>edges</code></td> <td> <p>A vector giving the edges of the graph, the same way as for the regular <code><a href="make_graph.html">graph</a></code> function. It is checked that the edges indeed connect vertices of different kind, according to the supplied <code>types</code> vector. The vector may be a string vector if <code>types</code> is a named vector.</p> </td></tr> <tr valign="top"><td><code>directed</code></td> <td> <p>Whether to create a directed graph, boolean constant. Note that by default undirected graphs are created, as this is more common for bipartite graphs.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>Passed to <code>make_bipartite_graph</code>.</p> </td></tr> </table> <h3>Details</h3> <p>Bipartite graphs have a <code>type</code> vertex attribute in igraph, this is boolean and <code>FALSE</code> for the vertices of the first kind and <code>TRUE</code> for vertices of the second kind. </p> <p><code>make_bipartite_graph</code> basically does three things. First it checks the <code>edges</code> vector against the vertex <code>types</code>. Then it creates a graph using the <code>edges</code> vector and finally it adds the <code>types</code> vector as a vertex attribute called <code>type</code>. <code>edges</code> may contain strings as vertex names; in this case, <code>types</code> must be a named vector that specifies the type for each vertex name that occurs in <code>edges</code>. </p> <p><code>is_bipartite</code> checks whether the graph is bipartite or not. It just checks whether the graph has a vertex attribute called <code>type</code>. </p> <h3>Value</h3> <p><code>make_bipartite_graph</code> returns a bipartite igraph graph. In other words, an igraph graph that has a vertex attribute named <code>type</code>. </p> <p><code>is_bipartite</code> returns a logical scalar. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>See Also</h3> <p><code><a href="make_graph.html">graph</a></code> to create one-mode networks </p> <h3>Examples</h3> <pre> g <- make_bipartite_graph(rep(0:1, length.out=10), c(1:10)) print(g, v=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>