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 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/degseq.R
\name{is_graphical}
\alias{is_graphical}
\title{Is a degree sequence graphical?}
\usage{
is_graphical(
out.deg,
in.deg = NULL,
allowed.edge.types = c("simple", "loops", "multi", "all")
)
}
\arguments{
\item{out.deg}{Integer vector, the degree sequence for undirected graphs, or
the out-degree sequence for directed graphs.}
\item{in.deg}{\code{NULL} or an integer vector. For undirected graphs, it
should be \code{NULL}. For directed graphs it specifies the in-degrees.}
\item{allowed.edge.types}{The allowed edge types in the graph. \sQuote{simple}
means that neither loop nor multiple edges are allowed (i.e. the graph must be
simple). \sQuote{loops} means that loop edges are allowed but mutiple edges
are not. \sQuote{multi} means that multiple edges are allowed but loop edges
are not. \sQuote{all} means that both loop edges and multiple edges are
allowed.}
}
\value{
A logical scalar.
}
\description{
Determine whether the given vertex degrees (in- and out-degrees for
directed graphs) can be realized by a graph.
}
\details{
The classical concept of graphicality assumes simple graphs. This function
can perform the check also when self-loops, multi-edges, or both are allowed
in the graph.
}
\examples{
g <- sample_gnp(100, 2 / 100)
is_degseq(degree(g))
is_graphical(degree(g))
}
\references{
Hakimi SL: On the realizability of a set of integers as degrees
of the vertices of a simple graph. \emph{J SIAM Appl Math} 10:496-506, 1962.
PL Erdős, I Miklós and Z Toroczkai: A simple Havel-Hakimi type algorithm to
realize graphical degree sequences of directed graphs. \emph{The Electronic
Journal of Combinatorics} 17(1):R66, 2010.
}
\seealso{
Other graphical degree sequences:
\code{\link{is_degseq}()}
}
\author{
Tamás Nepusz \email{ntamas@gmail.com}
}
\concept{graphical degree sequences}
\keyword{graphs}
\section{Related documentation in the C library}{\href{https://igraph.org/c/html/latest/igraph-Structural.html#igraph_is_graphical}{\code{igraph_is_graphical()}}.}
|