igraph-help
[Top][All Lists]

Re: [igraph] How to know deleted edges by spinglass.community()

 From: MATSUDA, Noriyuki Subject: Re: [igraph] How to know deleted edges by spinglass.community() Date: Fri, 21 Dec 2007 10:01:55 +0900

```Hello:

Is there a quick and efficient way to know which edges were deleted by
spinglass.community()?
```
Besides the analysis of deleted edges, It will help create a graph of communities to
```be compared with the original one.
```
Use of delete.edges() seems faster than repeated use of graph.disjoint.union, particularly
```when I want to preserve vertex and edge attributes.

Thanks in advance and Merry X'mas.

```
```
```
```eA<- c(0,4,0,5,0,6,0,7,0,8,0,9,0,10)
eB<- c(1,11,1,12,1,13,1,14,1,15,1,16,1,17)
eC<- c(2,18,2,19,2,20,2,21,2,22,2,23,2,24)
eD<- c(3,25,3,26,3,27,3,28,3,29,3,30,3,31,3,32)
g<-graph(c(eA,eB,eC,eD),directed=F)
z <- 0:3;  V(g)[z]\$name = paste(V(g)[z],LETTERS[z+1],sep="")
z <- 4:10; V(g)[z]\$name = paste(V(g)[z],"a",sep="")
z <- 11:17; V(g)[z]\$name = paste(V(g)[z],"b",sep="")
z <- 18:24; V(g)[z]\$name = paste(V(g)[z],"c",sep="")
z <- 25:32; V(g)[z]\$name = paste(V(g)[z],"d",sep="")

V(g)\$color="#efefef"; V(g)\$size=16
V(g)[0:3]\$color="#aaaaFF"; V(g)[0:3]\$size=20
E(g)\$color="black"
V(g)[c(7,15,25)]\$color="#aabb99"

plot(g, layout= layout.fruchterman.reingold,vertex.label=V(g)\$name, cex=1.3)
title(main=list("fruchterman.reingold",col="red",font=4, cex=1.4))

#spinglass.community
spn <- spinglass.community(g, spins=4)
```
```
```
```
--
MATSUDA, Noriyuki　<in Kanji> 松 田 紀 之

```