View source: R/transformations.R
| prueferToEdgeList | R Documentation |
Convert Pruefer code to edge list.
prueferToEdgeList(pcode)
pcode |
[ |
[matrix(2, length(pcode) + 1)] Edge list.
Other transformation functions:
charVecToEdgelist(),
edgeListToCharVec(),
nodelistToEdgelist(),
permutationToCharVec(),
permutationToEdgelist(),
prueferToCharVec()
# here we generate a random Pruefer-code representing
# a random spanning tree of a graph with n = 10 nodes
pcode = sample(1:10, 8, replace = TRUE)
print(pcode)
edgelist = prueferToEdgeList(pcode)
print(edgelist)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.