[Top][All Lists]

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

Re: [igraph] cohesive.blocks: exporting blocks as a data frame

From: Gábor Csárdi
Subject: Re: [igraph] cohesive.blocks: exporting blocks as a data frame
Date: Fri, 13 May 2011 14:03:23 -0400

Dear Joe,

On Fri, May 13, 2011 at 6:28 AM, joe j <address@hidden> wrote:
> Dear all,
> Using igraph version .6 in R 2.12.2, I am trying to calculate cohesive
> blocks for each year over a period of time. For later analysis I need
> a matrix (that's a data frame which can be exported, for example as a
> csv or dta file) with the following minimum information: vertex name,
> block code (to identify the block), and hierarchy level. This way, I
> hope, among other things, to keep track of the pattern of block
> membership of each vertex over time. Knowledge of hierarchy level
> would enable me to combine several blocks in order to have smaller
> number of blocks. Would this be possible? I tried exporting the data
> to pajek, but couldn't figure out a way to extract the information I
> needed. Any suggestion would be appropriated.

Assuming the graph is in 'camp' and the blocks are in 'campBlocks',
this produces what you want:

bl <- blocks(campBlocks)
level <- as.vector(shortest.paths(hierarchy(campBlocks), 1)+1)
           block=rep(seq_along(bl), sapply(bl, length)),
           hierlevel=rep(level, sapply(bl, length)))

> A related point. I started off by looking into Lambda Sets a la
> Borgatti et al ( LS sets, lambda sets and other cohesive subsets. By
> S. P. Borgatti, M. G. Everett, P. R. Shirey, Social Networks 12 (1990)
> p. 337-357 ), but learned the superiority of cohesive blocking from
> its Wiki page. However, I also found a remark in there that: "there is
> a difference between the Peter McMahan's strict structural cohesion
> algorithm and the Moody-White cohesive embedding algorithm". Has this
> been fixed in igraph .6?

I remember that in some wiki I've seen an example for which Peter's
code was not working properly, and my implementation does. I think
this example is included in the R manual page.

But there is still some controversy with the definition of the method,
the Moody-White paper is ambiguous. I would need to look more
carefully to see what exactly the problem is.

> Finally, I assume that cohesive blocking doesn't yet accommodate
> weights, but please let me know if this is not the case.

Weights are not supported, I am not even sure how they could be incorporated.


> Best regards,
> Joe
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help

Gabor Csardi <address@hidden>     MTA KFKI RMKI

reply via email to

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