Monday 15 April 2013

how to find maximum edge in the path for mst graph in r -



how to find maximum edge in the path for mst graph in r -

b c d e 0.0 5.0 22.3606 586.9412 1041.3933 b 5.0 0.0 26.9258 591.8825 1045.143 c 22.3606 26.9258 0.0 565.6854 1019.8039 d 586.9412 591.8825 565.6854 0.0 632.455 e 1041.3933 1045.143 1019.8039 632.455 0.0

i'm new r , , having problems finding maximum border distance minimum spanning tree graph sample dataset. code below. don't know how proceed farther finding maximum border distance in path each vertex.

library(cluster) library(igraph) g <- read.table("c:/users/vivek/documents/r/gap/samp.txt") m <- as.matrix(g) ig <- graph.adjacency(m, mode="undirected", weighted=true) plot(ig, edge.label=round(e(ig)$weight, 3)) mst <- minimum.spanning.tree(ig) plot(mst,layout=layout.reingold.tilford,edge.label=e(mst)$weight)

r

No comments:

Post a Comment