EVOLUTION-MANAGER
Edit File: bipartite_projection.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: Project 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 bipartite_projection {igraph}"><tr><td>bipartite_projection {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Project a bipartite graph</h2> <h3>Description</h3> <p>A bipartite graph is projected into two one-mode networks </p> <h3>Usage</h3> <pre> bipartite_projection( graph, types = NULL, multiplicity = TRUE, probe1 = NULL, which = c("both", "true", "false"), remove.type = TRUE ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The input graph. It can be directed, but edge directions are ignored during the computation.</p> </td></tr> <tr valign="top"><td><code>types</code></td> <td> <p>An optional vertex type vector to use instead of the ‘<code>type</code>’ vertex attribute. You must supply this argument if the graph has no ‘<code>type</code>’ vertex attribute.</p> </td></tr> <tr valign="top"><td><code>multiplicity</code></td> <td> <p>If <code>TRUE</code>, then igraph keeps the multiplicity of the edges as an edge attribute called ‘weight’. E.g. if there is an A-C-B and also an A-D-B triple in the bipartite graph (but no more X, such that A-X-B is also in the graph), then the multiplicity of the A-B edge in the projection will be 2.</p> </td></tr> <tr valign="top"><td><code>probe1</code></td> <td> <p>This argument can be used to specify the order of the projections in the resulting list. If given, then it is considered as a vertex id (or a symbolic vertex name); the projection containing this vertex will be the first one in the result list. This argument is ignored if only one projection is requested in argument <code>which</code>.</p> </td></tr> <tr valign="top"><td><code>which</code></td> <td> <p>A character scalar to specify which projection(s) to calculate. The default is to calculate both.</p> </td></tr> <tr valign="top"><td><code>remove.type</code></td> <td> <p>Logical scalar, whether to remove the <code>type</code> vertex attribute from the projections. This makes sense because these graphs are not bipartite any more. However if you want to combine them with each other (or other bipartite graphs), then it is worth keeping this attribute. By default it will be removed.</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>bipartite_projection_size</code> calculates the number of vertices and edges in the two projections of the bipartite graphs, without calculating the projections themselves. This is useful to check how much memory the projections would need if you have a large bipartite graph. </p> <p><code>bipartite_projection</code> calculates the actual projections. You can use the <code>probe1</code> argument to specify the order of the projections in the result. By default vertex type <code>FALSE</code> is the first and <code>TRUE</code> is the second. </p> <p><code>bipartite_projection</code> keeps vertex attributes. </p> <h3>Value</h3> <p>A list of two undirected graphs. See details above. </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> ## Projection of a full bipartite graph is a full graph g <- make_full_bipartite_graph(10,5) proj <- bipartite_projection(g) graph.isomorphic(proj[[1]], make_full_graph(10)) graph.isomorphic(proj[[2]], make_full_graph(5)) ## The projection keeps the vertex attributes M <- matrix(0, nrow=5, ncol=3) rownames(M) <- c("Alice", "Bob", "Cecil", "Dan", "Ethel") colnames(M) <- c("Party", "Skiing", "Badminton") M[] <- sample(0:1, length(M), replace=TRUE) M g2 <- graph_from_incidence_matrix(M) g2$name <- "Event network" proj2 <- bipartite_projection(g2) print(proj2[[1]], g=TRUE, e=TRUE) print(proj2[[2]], g=TRUE, e=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>