%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% $Id: reachableVertices.tex,v 1.1.1.1 2004/10/04 17:25:13 nthiery Exp $
% File:		lib/GRAPH/DOC/reachableVertices.tex
% Purpose:	Test file for the function 'Graph::reachableVertices'
% Authors:	Nicolas M. Thiéry <nthiery@users.sourceforge.net>
% Created:	11/09/2004
% License:	LGPL
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\begin{Mhelppage}{reachableVertices}{N.~M.~Thiéry}
  [ImplState=stable,TestState=stable,DocState=stable]
%\Mproofread{user}{date}{comment}

\begin{MInfo}
  \eng{Connected component(s) of one or several vertices in a graph}
  \de{}
\end{MInfo}

\MDeclareOption{\Forward}{Forward}
\MDeclareOption{\Backward}{Backward}

%---------------------------------------------------------------------------------------------
\begin{MIntro}
  \eng{\Mthis{} computes the connected component(s) of one or more
    vertices in a graph}
  \de{}
\end{MIntro}
%---------------------------------------------------------------------------------------------
\begin{MCalls}
  \Mcall{G, startVertices, \Mopt{direction}}
\end{MCalls}
%---------------------------------------------------------------------------------------------
\begin{MParameters}
  \param{G}
    \eng{a graph}
    \de{}
  \param{startVertices}
    \eng{a list or set of vertices of G}
  \param{direction}
    \eng{either \Forward{} or \Backward{}}
\end{MParameters}
%---------------------------------------------------------------------------------------------
\begin{MReturnValue}
  \eng{The set of all the vertices \Mex{v} such that there exists a
    path in G from at least one vertex in \Mpar{startVertices} to
    \Mex{v}.}  \de{}
\end{MReturnValue}
\begin{MDetails}
  \eng{If the graph is directed, and the option \Backward{} is
    specified, then the path should start from \Mex{v} and go to one
    vertex in \Mex{startVertices}.}
\end{MDetails}

\begin{MExample}{ex-basic}
  \eng{Consider the following graph:}
  \begin{Mexin}
G := Graph([a, b, c, d, e, f, g, h],
           [[a, b], [a, c], [b, a], [b, d],
            [d, c], [e, a], [e, f], [g, h]],
           Directed):
  \end{Mexin}
  \begin{Mexout}
  \end{Mexout}
  \eng{Here are the vertices which are reachable from \Mex{a}:}
  \begin{Mexin}
Graph::reachableVertices(G, [a])
  \end{Mexin}
  \begin{Mexout}
                         {a, b, c, d}
  \end{Mexout}
  \eng{and those from which one can reach \Mex{a}:}
  \begin{Mexin}
Graph::reachableVertices(G, [a], Backward)
  \end{Mexin}
  \begin{Mexout}
                           {a, b, e}
  \end{Mexout}
  \eng{All the vertices are reachable from either \Mex{e} or \Mex{g}:}
  \begin{Mexin}
Graph::reachableVertices(G, [e, g])
  \end{Mexin}
  \begin{Mexout}
                   {a, b, c, d, e, f, g, h}
  \end{Mexout}
  \eng{while no vertex except \Mex{c} is reachable from \Mex{c}:}
  \begin{Mexin}
Graph::reachableVertices(G, [c])
  \end{Mexin}
  \begin{Mexout}
                              {c}
  \end{Mexout}

\end{MExample}

\begin{MChanges}
  \version{3.1}
  \new
\end{MChanges}
\end{Mhelppage}
