title: igraph - How to calculate closeness method in iGraph to disconnected graphs
body: <p>I use igraph in R for calculate graph measure, my graph make in a PIN that not Connected Graph and is Disconnected Graph.
  closeness method for connected graph is good and right calculate, and for Disconnected graph in not Good!</p>
  
  <pre><code>library(igraph)
  # Create of Graph Matrix for Test Closeness Centrality
  g &lt;- read.table(text="A B 
    1 2
    2 4
    3 4
    3 5", header=TRUE)
  gadj &lt;- get.adjacency(graph.edgelist(as.matrix(g), directed=FALSE))
  igObject &lt;- graph.adjacency(gadj) # convert adjacency matrix to igraph object
  gCloseness &lt;- closeness(igObject,weights = NULL) # Assign Closeness to Variable for print
  </code></pre>
  
  <p>output :</p>
  
  <blockquote>
    <p>[1] 0.1000000 0.1428571 0.1428571 0.1666667 0.1000000</p>
  </blockquote>
  
  <p>my Disconnected Graph:</p>
  
  <pre><code>library(igraph)
  # Create of Graph Matrix for Test Closeness Centrality
  g &lt;- read.table(text="A B 
  1 2
  3 4
  3 5", header=TRUE)
  gadj &lt;- get.adjacency(graph.edgelist(as.matrix(g), directed=FALSE))
  igObject &lt;- graph.adjacency(gadj) # convert adjacency matrix to igraph object
  gCloseness &lt;- closeness(igObject,weights = NULL) # Assign Closeness to Variable for print
  </code></pre>
  
  <p>output :</p>
  
  <blockquote>
    <p>[1] 0.06250000 0.06250000 0.08333333 0.07692308 0.07692308</p>
  </blockquote>
  
  <p>This output is Right ? and if right How to Calculate ?</p>