-
Notifications
You must be signed in to change notification settings - Fork 2
/
prueferToCharVec.Rd
33 lines (33 loc) · 953 Bytes
/
prueferToCharVec.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/transformations.R
\name{prueferToCharVec}
\alias{prueferToCharVec}
\title{Convert Pruefer code to characteristic vector.}
\usage{
prueferToCharVec(pcode)
}
\arguments{
\item{pcode}{[\code{integer}]
Pruefer code encoding a minimum spanning tree.}
}
\value{
[\code{integer}] Characteristic vector cv with cv[i] = 1 if the i-th edge is in the tree.
}
\description{
Convert Pruefer code to characteristic vector.
}
\examples{
# 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)
print(prueferToCharVec(pcode))
}
\seealso{
Other transformation functions: \code{\link{charVecToEdgelist}},
\code{\link{edgeListToCharVec}},
\code{\link{nodelistToEdgelist}},
\code{\link{permutationToCharVec}},
\code{\link{permutationToEdgelist}},
\code{\link{prueferToEdgeList}}
}