permutationToCharVec {mcMST} | R Documentation |
Convert permutation to characteristic vector.
Description
Convert permutation to characteristic vector.
Usage
permutationToCharVec(perm, n)
Arguments
perm |
[ |
n |
[ |
Value
[integer
] Characteristic vector cv with cv[i] = 1 if the i-th edge is in the tree.
See Also
Other transformation functions:
charVecToEdgelist()
,
edgeListToCharVec()
,
nodelistToEdgelist()
,
permutationToEdgelist()
,
prueferToCharVec()
,
prueferToEdgeList()
Examples
# 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
permutationToCharVec(perm, n = 10)
[Package mcMST version 1.1.1 Index]