[Top][All Lists]

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

Re: Re: [igraph] Running time

From: Soós Albert
Subject: Re: Re: [igraph] Running time
Date: Fri, 30 Jul 2010 19:09:46 +0200


Thanks for the fast reply. I have another question, how can i draw the result of a clustering? I found an example int he tutorial:

g <- graph.full(5) %du% graph.full(5) %du% graph.full(5)

g <- add.edges(g, c(0,5, 0,10, 5,10))

com <- spinglass.community(g, spins=5)

V(g)$color <- com$membership+1

g <- set.graph.attribute(g, "layout", layout.kamada.kawai(g))

plot(g, vertex.label.dist=1.5)

I read my input graphs, and i use the fastgreedy or the edge betweenness algorithm so i modified the code:

graph<- read.graph(file=C:/g, format=”edgelist”, directed=FALSE)

com <- fastgreedy.community(graph, merges=TRUE, modularity=TRUE, weights=NULL)

V(graph)$color <- com$membership+1

graph <- set.graph.attribute(graph, "layout", layout.kamada.kawai(graph))

plot(graph, vertex.label.dist=1.5)

It draws the graph with the given layout, but it doesn’t color the communities.


-- Eredeti üzenet --
Elküldve: 2010. július 30. 14:21
Tárgy : Re: [igraph] Running time

Hi Albert,

> Hello! If i run a clustering algorithm in R, how can i get the
> running time?
Use system.time, e.g.:

> system.time(fastgreedy.community(graph))

> I tried to run the CNM algorithm, and i got this error message: At
> fast_community.c:525 : fast greedy community detection works for
> undirected graphs only, Unimplemented function
As the message says above, this algorithm works for undirected graphs
only, and your graph is directed. Please convert it to an undirected one
first using to.undirected(). If you load your graph from an external
file, the loader function might also have a directed=... parameter where
you can explicitly specify that you want the graph to be undirected.
(This works only for formats such as edgelist, NCOL and LGL where the
file itself does not contain whether the graph is directed or


igraph-help mailing list


Török tengerpart. Böngésszen a C-Travel ajánlatai között!

reply via email to

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