File: make_from_prufer.Rd

package info (click to toggle)
r-cran-igraph 2.1.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,044 kB
  • sloc: ansic: 204,981; cpp: 21,711; fortran: 4,090; yacc: 1,229; lex: 519; sh: 52; makefile: 8
file content (48 lines) | stat: -rw-r--r-- 1,357 bytes parent folder | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make.R
\name{make_from_prufer}
\alias{make_from_prufer}
\alias{from_prufer}
\title{Create an undirected tree graph from its Prüfer sequence}
\usage{
make_from_prufer(prufer)

from_prufer(...)
}
\arguments{
\item{prufer}{The Prüfer sequence to convert into a graph}

\item{...}{Passed to \code{make_from_prufer()}}
}
\value{
A graph object.
}
\description{
\code{make_from_prufer()} creates an undirected tree graph from its Prüfer
sequence.
}
\details{
The Prüfer sequence of a tree graph with n labeled vertices is a sequence of
n-2 numbers, constructed as follows. If the graph has more than two vertices,
find a vertex with degree one, remove it from the tree and add the label of
the vertex that it was connected to to the sequence. Repeat until there are
only two vertices in the remaining graph.
}
\examples{

g <- make_tree(13, 3)
to_prufer(g)
}
\seealso{
\code{\link[=to_prufer]{to_prufer()}} to convert a graph into its Prüfer sequence

Other trees: 
\code{\link{is_forest}()},
\code{\link{is_tree}()},
\code{\link{sample_spanning_tree}()},
\code{\link{to_prufer}()}
}
\concept{trees}
\keyword{graphs}
\section{Related documentation in the C library}{\href{https://igraph.org/c/html/latest/igraph-Generators.html#igraph_from_prufer}{\code{igraph_from_prufer()}}.}