\HeaderA{separates}{A function to test whether a subset of nodes separates
two other subsets of nodes.}{separates}
\keyword{manip}{separates}
\begin{Description}\relax
The function tests to see whether a set of nodes, \code{S1}, separates 
all nodes in \code{a} from all nodes in \code{a}.
\end{Description}
\begin{Usage}
\begin{verbatim}
separates(a, b, S1, g)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{a}] The names of the nodes in the from set. 
\item[\code{b}] The names of the nodes in the to set. 
\item[\code{S1}] The names of the nodes in the separation set. 
\item[\code{g}] An instance of the \code{graph} class. All nodes
named in the other arguments must be nodes of this graph. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The algorithm is quite simple. A subgraph is created by removing the
nodes named in \code{S1} from \code{g}. Then all paths between
elements of \code{a} to elements of \code{b} are tested for. If any
path exists the function returns \code{FALSE}, otherwise it returns 
\code{TRUE}.
\end{Details}
\begin{Value}
Either \code{TRUE} or \code{FALSE} depending on whether \code{S1} separates
\code{a} from \code{b} in \code{g1}.
\end{Value}
\begin{Author}\relax
R. Gentleman
\end{Author}
\begin{References}\relax
S. Lauritzen, Graphical Models, OUP.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{johnson.all.pairs.sp}{johnson.all.pairs.sp}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  km <- fromGXL(file(system.file("XML/kmstEx.gxl",package="RBGL")))
  separates("B", "A", "E", km)
  separates("B", "A", "C", km)
\end{ExampleCode}
\end{Examples}

