20 node graph with 38 random edges

From InterSciWiki
Jump to: navigation, search
  1. GNU cohesive.blocks() (c) Written by Peter McMahan 2007 posted in October.
require(igraph)
require(digest)
require(RSQLite)		
library(igraph)
source("http://www.charting1968.net/CohesiveBlocks.R")
g <- read.graph(file="http://intersci.ss.uci.edu/wiki/Vlado/20nodes38randomedges.net", format="pajek")
gBlocks  <- cohesive.blocks(g,verbose=TRUE,cutsetHeuristic=TRUE)  ##gBlocks <- cohesive.blocks(g)                           
V(gBlocks)$label <- V(gBlocks)$id
max.cohesion <- igraph:::maxcohesion
max.cohesion(gBlocks) 
lapply(gBlocks$blocks,function(i){V(gBlocks)[i]$id})
# plot.bgraph(gBlocks,layout=layout.spring,vertex.size=14) 
plot.bgraph(gBlocks,layout=layout.kamada.kawai,vertex.size=14) 
write.pajek.bgraph(gBlocks,file="gBlocks")
Personal tools