mstree.kruskal             package:RBGL             R Documentation

_K_r_u_s_k_a_l'_s _m_i_n_i_m_u_m _s_p_a_n_n_i_n_g _t_r_e_e _i_n _b_o_o_s_t

_D_e_s_c_r_i_p_t_i_o_n:

     compute the minimum spanning tree (MST) for a graph and return a
     representation in matrices

_U_s_a_g_e:

     mstree.kruskal(x) 

_A_r_g_u_m_e_n_t_s:

       x: instance of class graph 

_D_e_t_a_i_l_s:

     calls to kruskal minimum spanning tree algorithm of Boost graph
     library

_V_a_l_u_e:

     a list 

edgeList: a matrix m of dimension 2 by number of edges in the MST, with
          m[i,j] the jth node in edge i

 weights: a vector of edge weights corresponding to the columns of
          'edgeList'

   nodes: the vector of nodes of the input graph 'x'

_A_u_t_h_o_r(_s):

     VJ Carey <stvjc@channing.harvard.edu>

_S_e_e _A_l_s_o:

     'prim.minST'

_E_x_a_m_p_l_e_s:

     km <- fromGXL(file(system.file("XML/kmstEx.gxl",package="RBGL"), open="r"))
     mstree.kruskal(km)
     edgeData(km, "B", "D", "weight") <- 1.1
     edgeData(km, "B", "E", "weight") <- .95
     mstree.kruskal(km)
     km2 <- fromGXL(file(system.file("XML/telenet.gxl",package="RBGL"), open="r"))
     m <- mstree.kruskal(km2)
     print(sum(m[[2]]))

