\HeaderA{simplify}{Simple graphs}{simplify}
\aliasA{is.simple}{simplify}{is.simple}
\keyword{graphs}{simplify}
\begin{Description}\relax
Simple graphs are graphs which do not contain loop and
multiple edges.
\end{Description}
\begin{Usage}
\begin{verbatim}
simplify(graph, remove.multiple = TRUE, remove.loops = TRUE)
is.simple(graph)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The graph to work on.
\item[\code{remove.loops}] Logical, whether the loop edges are to be
removed.
\item[\code{remove.multiple}] Logical, whether the multiple edges are to be
removed.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A loop edge is an edge for which the two endpoints are the same
vertex. Two edges are multiple edges if they have exactly the same two
endpoints (for directed graphs order does matter). A graph is simple
is it does not contain loop edges and multiple edges.

\code{is.simple} checks whether a graph is simple.

\code{simplify} removes the loop and/or multiple edges from a graph.
If both \code{remove.loops} and \code{remove.multiple} are \code{TRUE}
the function returns a simple graph.
\end{Details}
\begin{Value}
A new graph object with the edges deleted.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{is.loop}{is.loop}}, \code{\LinkA{is.multiple}{is.multiple}} and
\code{\LinkA{count.multiple}{count.multiple}}, \code{\LinkA{delete.edges}{delete.edges}},
\code{\LinkA{delete.vertices}{delete.vertices}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
g <- graph( c(1,2,1,2,3,3) )
is.simple(g)
is.simple(simplify(g, remove.loops=FALSE))
is.simple(simplify(g, remove.multiple=FALSE))
is.simple(simplify(g))
\end{ExampleCode}
\end{Examples}

