EVOLUTION-MANAGER
Edit File: which_multiple.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: Find the multiple or loop edges 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 which_multiple {igraph}"><tr><td>which_multiple {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find the multiple or loop edges in a graph</h2> <h3>Description</h3> <p>A loop edge is an edge from a vertex to itself. An edge is a multiple edge if it has exactly the same head and tail vertices as another edge. A graph without multiple and loop edges is called a simple graph. </p> <h3>Usage</h3> <pre> which_multiple(graph, eids = E(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>eids</code></td> <td> <p>The edges to which the query is restricted. By default this is all edges in the graph.</p> </td></tr> </table> <h3>Details</h3> <p><code>any_loop</code> decides whether the graph has any loop edges. </p> <p><code>which_loop</code> decides whether the edges of the graph are loop edges. </p> <p><code>any_multiple</code> decides whether the graph has any multiple edges. </p> <p><code>which_multiple</code> decides whether the edges of the graph are multiple edges. </p> <p><code>count_multiple</code> counts the multiplicity of each edge of a graph. </p> <p>Note that the semantics for <code>which_multiple</code> and <code>count_multiple</code> is different. <code>which_multiple</code> gives <code>TRUE</code> for all occurrences of a multiple edge except for one. Ie. if there are three <code>i-j</code> edges in the graph then <code>which_multiple</code> returns <code>TRUE</code> for only two of them while <code>count_multiple</code> returns ‘3’ for all three. </p> <p>See the examples for getting rid of multiple edges while keeping their original multiplicity as an edge attribute. </p> <h3>Value</h3> <p><code>any_loop</code> and <code>any_multiple</code> return a logical scalar. <code>which_loop</code> and <code>which_multiple</code> return a logical vector. <code>count_multiple</code> returns a numeric vector. </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="simplify.html">simplify</a></code> to eliminate loop and multiple edges. </p> <h3>Examples</h3> <pre> # Loops g <- graph( c(1,1,2,2,3,3,4,5) ) any_loop(g) which_loop(g) # Multiple edges g <- barabasi.game(10, m=3, algorithm="bag") any_multiple(g) which_multiple(g) count_multiple(g) which_multiple(simplify(g)) all(count_multiple(simplify(g)) == 1) # Direction of the edge is important which_multiple(graph( c(1,2, 2,1) )) which_multiple(graph( c(1,2, 2,1), dir=FALSE )) # Remove multiple edges but keep multiplicity g <- barabasi.game(10, m=3, algorithm="bag") E(g)$weight <- count_multiple(g) g <- simplify(g, edge.attr.comb=list(weight = "min")) any(which_multiple(g)) E(g)$weight </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>