nodelistToEdgelist: Convert sequence of nodes to edge list.

View source: R/transformations.R

nodelistToEdgelistR Documentation

Convert sequence of nodes to edge list.

Description

Convert sequence of nodes to edge list.

Usage

nodelistToEdgelist(nodelist)

Arguments

nodelist

[integer]
Sequence of nodes.

Value

[matrix] Edge list.

See Also

Other transformation functions: charVecToEdgelist(), edgeListToCharVec(), permutationToCharVec(), permutationToEdgelist(), prueferToCharVec(), prueferToEdgeList()

Examples

# first generate a random permutation, e.g., representing
# a roundtrip tour in a graph
nodelist = sample(1:8)
# now convert into an edge list
nodelistToEdgelist(nodelist)

mcMST documentation built on April 1, 2023, 12:19 a.m.