View source: R/transformations.R
permutationToEdgelist | R Documentation |
Convert permutation to edge list.
permutationToEdgelist(perm)
perm |
[ |
[matrix(2, length(perm))
] Edge list.
Other transformation functions:
charVecToEdgelist()
,
edgeListToCharVec()
,
nodelistToEdgelist()
,
permutationToCharVec()
,
prueferToCharVec()
,
prueferToEdgeList()
# first generate a random permutation, e.g., representing
# a roundtrip tour in a graph
perm = sample(1:10)
print(perm)
# now convert into an edge list
permutationToEdgelist(perm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.