\HeaderA{subgraph}{Subgraph of a graph}{subgraph}
\keyword{graphs}{subgraph}
\begin{Description}\relax
\code{subgraph} creates a subgraph of a graph, containing
only the specified vertices and all the edges among them.
\end{Description}
\begin{Usage}
\begin{verbatim}
subgraph(graph, v)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{graph}] The original graph.
\item[\code{v}] Numeric vector, the vertices of the original graph which
will form the subgraph.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The ids of the vertices will change in the subgraph of course since
these are always consecutive.
\end{Details}
\begin{Value}
A new graph object.
\end{Value}
\begin{Author}\relax
Gabor Csardi \email{csardi@rmki.kfki.hu}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
g <- graph.ring(10)
g2 <- subgraph(g, 1:7)
\end{ExampleCode}
\end{Examples}

