Prune a Minimun Spanning Tree
prunemst.Rd
This function deletes a first edge and makes two subsets of edges. Each subset is a Minimun Spanning Treee.
Value
A list of length two. If only.nodes=TRUE
each element is a
vector of nodes. If only.nodes=FALSE
each element is a list with
nodes and edges.
See also
See Also as mstree
Examples
e <- matrix(c(2,3, 1,2, 3,4, 4,5), ncol=2, byrow=TRUE)
e
#> [,1] [,2]
#> [1,] 2 3
#> [2,] 1 2
#> [3,] 3 4
#> [4,] 4 5
prunemst(e)
#> $node1
#> [1] 2 1
#>
#> $node2
#> [1] 3 4 5
#>
prunemst(e, only.nodes=FALSE)
#> [[1]]
#> [[1]]$node
#> [1] 2 1
#>
#> [[1]]$edge
#> [,1] [,2]
#> [1,] 1 2
#>
#>
#> [[2]]
#> [[2]]$node
#> [1] 3 4 5
#>
#> [[2]]$edge
#> [,1] [,2]
#> [1,] 3 4
#> [2,] 4 5
#>
#>