permutationToEdgelist: Convert permutation to edge list.

Description Usage Arguments Value See Also Examples

View source: R/transformations.R

Description

Convert permutation to edge list.

Usage

1

Arguments

perm

[integer]
Permutation of nodes, e.g., solution of a TSP.

Value

[matrix(2, length(perm))] Edge list.

See Also

Other transformation functions: charVecToEdgelist, edgeListToCharVec, nodelistToEdgelist, permutationToCharVec, prueferToCharVec, prueferToEdgeList

Examples

1
2
3
4
5
6
# 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)

jakobbossek/rmoco documentation built on May 10, 2018, 9:53 p.m.