EVOLUTION-MANAGER
Edit File: closeness.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: Closeness centrality of vertices</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 closeness {igraph}"><tr><td>closeness {igraph}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Closeness centrality of vertices</h2> <h3>Description</h3> <p>Closeness centrality measures how many steps is required to access every other vertex from a given vertex. </p> <h3>Usage</h3> <pre> closeness( graph, vids = V(graph), mode = c("out", "in", "all", "total"), weights = NULL, normalized = FALSE, cutoff = -1 ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>graph</code></td> <td> <p>The graph to analyze.</p> </td></tr> <tr valign="top"><td><code>vids</code></td> <td> <p>The vertices for which closeness will be calculated.</p> </td></tr> <tr valign="top"><td><code>mode</code></td> <td> <p>Character string, defined the types of the paths used for measuring the distance in directed graphs. “in” measures the paths <em>to</em> a vertex, “out” measures paths <em>from</em> a vertex, <em>all</em> uses undirected paths. This argument is ignored for undirected graphs.</p> </td></tr> <tr valign="top"><td><code>weights</code></td> <td> <p>Optional positive weight vector for calculating weighted closeness. If the graph has a <code>weight</code> edge attribute, then this is used by default. Weights are used for calculating weighted shortest paths, so they are interpreted as distances.</p> </td></tr> <tr valign="top"><td><code>normalized</code></td> <td> <p>Logical scalar, whether to calculate the normalized closeness, i.e. the inverse average distance to all reachable vertices. The non-normalized closeness is the inverse of the sum of distances to all reachable vertices.</p> </td></tr> <tr valign="top"><td><code>cutoff</code></td> <td> <p>The maximum path length to consider when calculating the closeness. If zero or negative then there is no such limit.</p> </td></tr> </table> <h3>Details</h3> <p>The closeness centrality of a vertex is defined as the inverse of the sum of distances to all the other vertices in the graph: </p> <p style="text-align: center;"><i>1/sum( d(v,i), i != v)</i></p> <p>If there is no (directed) path between vertex <code>v</code> and <code>i</code>, then <code>i</code> is omitted from the calculation. If no other vertices are reachable from <code>v</code>, then its closeness is returned as NaN. </p> <p><code>cutoff</code> or smaller. This can be run for larger graphs, as the running time is not quadratic (if <code>cutoff</code> is small). If <code>cutoff</code> is zero or negative (which is the default), then the function calculates the exact closeness scores. Using zero as a cutoff is <em>deprecated</em> and future versions (from 1.4.0) will treat zero cutoff literally (i.e. no paths considered at all). If you want no cutoff, use a negative number. </p> <p><code>estimate_closeness</code> is an alias for <code>closeness</code> with a different argument order, for sake of compatibility with older versions of igraph. </p> <p>Closeness centrality is meaningful only for connected graphs. In disconnected graphs, consider using the harmonic centrality with <code><a href="harmonic_centrality.html">harmonic_centrality</a></code> </p> <h3>Value</h3> <p>Numeric vector with the closeness values of all the vertices in <code>v</code>. </p> <h3>Author(s)</h3> <p>Gabor Csardi <a href="mailto:csardi.gabor@gmail.com">csardi.gabor@gmail.com</a> </p> <h3>References</h3> <p>Freeman, L.C. (1979). Centrality in Social Networks I: Conceptual Clarification. <em>Social Networks</em>, 1, 215-239. </p> <h3>See Also</h3> <p><code><a href="betweenness.html">betweenness</a></code>, <code><a href="degree.html">degree</a></code>, <code><a href="harmonic_centrality.html">harmonic_centrality</a></code> </p> <h3>Examples</h3> <pre> g <- make_ring(10) g2 <- make_star(10) closeness(g) closeness(g2, mode="in") closeness(g2, mode="out") closeness(g2, mode="all") </pre> <hr /><div style="text-align: center;">[Package <em>igraph</em> version 1.3.5 <a href="00Index.html">Index</a>]</div> </body></html>