getCommonSubtrees {mcMST} | R Documentation |
Get common subtrees of two trees.
Description
Given two spanning trees, the function returns the subtrees of the intersection of these.
Usage
getCommonSubtrees(x, y, n = NULL)
Arguments
x |
[ |
y |
[ |
n |
[ |
Value
[list
] List of matrizes. Each matrix contains the edges of one
connected subtree.
Examples
# assume we have a graph with n = 10 nodes
n.nodes = 10
# we define two trees (matrices with colwise edges)
stree1 = matrix(c(1, 2, 1, 3, 2, 4, 5, 6, 6, 7), byrow = FALSE, nrow = 2)
stree2 = matrix(c(1, 3, 1, 2, 2, 4, 5, 8, 6, 7), byrow = FALSE, nrow = 2)
# ... and compute all common subtrees
subtrees = getCommonSubtrees(stree1, stree2, n = 10)
[Package mcMST version 1.1.1 Index]