igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] claculate closeness method in iGraph to disconnected graphs


From: Gábor Csárdi
Subject: Re: [igraph] claculate closeness method in iGraph to disconnected graphs
Date: Mon, 13 Jul 2015 18:17:47 -0400

Thanks! I will need to see what igraph does currently. AFAIR for
unreachable vertices it uses a distance of number of nodes + 1.

https://github.com/igraph/igraph/issues/838

Gabor

On Tue, Jun 16, 2015 at 5:21 AM, Saeed Rahmani
<address@hidden> wrote:
> 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!
>
> library(igraph)
> # Create of Graph Matrix for Test Closeness Centrality
> g <- read.table(text="A B
>   1 2
>   3 4
>   3 5", header=TRUE)
> gadj <- get.adjacency(graph.edgelist(as.matrix(g), directed=FALSE))
> igObject <- graph.adjacency(gadj) # convert adjacency matrix to igraph
> object
> gCloseness <- closeness(igObject,weights = NULL) # Assign Closeness to
> Variable for print
>
> [1] 0.06250000 0.06250000 0.08333333 0.07692308 0.07692308
>
>  This output is Right ? and if right How to Calculate ?
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]