% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/make.R
\name{make_turan}
\alias{make_turan}
\alias{turan}
\title{Create a Turán graph}
\usage{
make_turan(n, r)

turan(n, r)
}
\arguments{
\item{n}{Integer, the number of vertices in the graph.}

\item{r}{Integer, the number of partitions in the graph, must be positive.}
}
\value{
An igraph graph with a vertex attribute \code{type} storing the
partition index of each vertex. Partition indices start from 1.
}
\description{
Turán graphs are complete multipartite graphs with the property that the
sizes of the partitions are as close to equal as possible.
}
\details{
The Turán graph with \code{n} vertices and \code{r} partitions is the densest
graph on \code{n} vertices that does not contain a clique of size \code{r+1}.

This function generates undirected graphs. The null graph is
returned when the number of vertices is zero. A complete graph is
returned if the number of partitions is greater than the number of vertices.
}
\section{Related documentation in the C library}{
\href{https://igraph.org/c/html/0.10.17/igraph-Generators.html#igraph_turan}{\code{turan()}}, \href{https://igraph.org/c/html/0.10.17/igraph-Basic.html#igraph_vcount}{\code{vcount()}}
}

\examples{
# Create a Turán graph with 10 vertices and 3 partitions
g <- make_turan(10, 3)
plot(g)

# The sizes of the partitions are as balanced as possible
table(V(g)$type)
}
\seealso{
Other deterministic constructors: 
\code{\link{graph_from_atlas}()},
\code{\link{graph_from_edgelist}()},
\code{\link{graph_from_literal}()},
\code{\link{make_}()},
\code{\link{make_chordal_ring}()},
\code{\link{make_circulant}()},
\code{\link{make_empty_graph}()},
\code{\link{make_full_citation_graph}()},
\code{\link{make_full_graph}()},
\code{\link{make_full_multipartite}()},
\code{\link{make_graph}()},
\code{\link{make_lattice}()},
\code{\link{make_ring}()},
\code{\link{make_star}()},
\code{\link{make_tree}()},
\code{\link{make_wheel}()}
}
\concept{deterministic constructors}
