|
From: | Gábor Csárdi |
Subject: | Re: [igraph] I'm getting Different MST each time |
Date: | Mon, 22 Apr 2013 23:13:43 -0400 |
Gabor,
Here is a sample .csv file.
Thanks,
Jameson
Date: Mon, 22 Apr 2013 22:14:24 -0400
From: address@hidden
To: address@hidden
Subject: Re: [igraph] I'm getting Different MST each timeHi, unfortunately we cannot run your code because we don't have the .csv file. Please send some self-contained example that reproduces the problem, e.g. make up some toy data. See e.g.Thanks,GaborOn Mon, Apr 22, 2013 at 9:44 PM, jameson mcfarlane <address@hidden> wrote:
Hello,
I am creating a minimum spanning tree (MST) with i-graph. For some reason, I seem to get a different MST diagram (nodes in different order) each time I run it. For example, sometimes the primary tree node is say "Jon K.". Other times, it could be "Larry Z." Could any help with what I am doing wrong?
Here is the code:
library(igraph)
tab <- read.csv("NewJam12.csv")
tab <- tab[,-1]
g <- graph.adjacency(as.matrix(tab), weighted=TRUE)
V(g)$label <- V(g)$name
mst <- as.undirected(minimum.spanning.tree(g))
lay <- layout.reingold.tilford(mst, root=which.max(degree(mst))-1)
lay <- cbind(lay[,2], lay[,1]) # rotate
x11(width=20, height=10)
plot(mst, layout=lay, vertex.size= 5, vertex.size2=15,
vertex.shape="circle", asp=FALSE,
vertex.label.cex=0.5, vertex.color="green")
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
--
Gabor Csardi <address@hidden> MTA KFKI RMKI
_______________________________________________ igraph-help mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/igraph-help
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |