getCommonSubtrees | R Documentation |
Given two spanning trees, the function returns the subtrees of the intersection of these.
getCommonSubtrees(x, y, n = NULL)
x |
[ |
y |
[ |
n |
[ |
[list
] List of matrizes. Each matrix contains the edges of one
connected subtree.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.