mirror of
https://github.com/boostorg/graph.git
synced 2026-01-28 19:22:11 +00:00
108 lines
3.1 KiB
HTML
108 lines
3.1 KiB
HTML
<HTML>
|
|
<!--
|
|
-- Copyright (c) Jeremy Siek 2000
|
|
--
|
|
-- Permission to use, copy, modify, distribute and sell this software
|
|
-- and its documentation for any purpose is hereby granted without fee,
|
|
-- provided that the above copyright notice appears in all copies and
|
|
-- that both that copyright notice and this permission notice appear
|
|
-- in supporting documentation. Silicon Graphics makes no
|
|
-- representations about the suitability of this software for any
|
|
-- purpose. It is provided "as is" without express or implied warranty.
|
|
-->
|
|
<Head>
|
|
<Title>Boost Graph Library: Depth-First Visit</Title>
|
|
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
|
|
ALINK="#ff0000">
|
|
<IMG SRC="../../../c++boost.gif"
|
|
ALT="C++ Boost" width="277" height="86">
|
|
|
|
<BR Clear>
|
|
|
|
<H2><A NAME="sec:dfs"></A>
|
|
<TT>depth_first_visit</TT>
|
|
</H2>
|
|
|
|
<P>
|
|
<DIV ALIGN="LEFT">
|
|
<TABLE CELLPADDING=3 border>
|
|
|
|
<TR><TH ALIGN="LEFT"><B>Graphs:</B></TH>
|
|
<TD ALIGN="LEFT">directed and undirected</TD>
|
|
</TR>
|
|
|
|
<TR><TH ALIGN="LEFT"><B>Properties:</B></TH>
|
|
<TD ALIGN="LEFT">color</TD>
|
|
</TR>
|
|
|
|
<TR><TH ALIGN="LEFT"><B>Complexity:</B></TH>
|
|
<TD ALIGN="LEFT">time: <i>O(E)</i></TD>
|
|
</TR>
|
|
|
|
<TR><TH ALIGN="LEFT"><B>Where Defined:</B></TH>
|
|
<TD ALIGN="LEFT">
|
|
<a href="../../../boost/graph/depth_first_search.hpp"><TT>boost/graph/depth_first_search.hpp</TT></a>
|
|
</TD>
|
|
</TR>
|
|
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
<P>
|
|
<PRE>
|
|
template <class <a href="./IncidenceGraph.html">IncidenceGraph</a>, class <a href="./DFSVisitor.html">DFSVisitor</a>, class <a href="#ColorMap">ColorMap</a>>
|
|
void depth_first_visit(IncidenceGraph& g,
|
|
typename graph_traits<IncidenceGraph>::vertex_descriptor s,
|
|
DFSVisitor& vis, ColorMap color)
|
|
</PRE>
|
|
|
|
<P>
|
|
This function visits all of the vertices in the same connected
|
|
component as the source vertex <tt>s</tt>, using the <a
|
|
href="./graph_theory_review.html#sec:dfs-algorithm">depth-first
|
|
pattern</a>. The main purpose of the function is for the
|
|
implementation of <TT>depth_first_search()</TT> though sometimes it is
|
|
useful on its own.
|
|
|
|
<p>
|
|
The <tt>DFSVisitor</tt> supplied by the user determines what
|
|
actions are taken at each event-point within the algorithm.
|
|
|
|
<p>
|
|
The <tt>ColorMap</tt> is used by the algorithm to keep track
|
|
of which vertices have been visited.
|
|
|
|
<P>
|
|
|
|
<H3>Requirements on Types</H3>
|
|
|
|
<P>
|
|
|
|
<UL>
|
|
<LI>The type <TT>IncidenceGraph</TT> must be a model of
|
|
<a href="./IncidenceGraph.html">IncidenceGraph</a>.
|
|
</LI>
|
|
<LI>The type <TT>DFSVisitor</TT> must be a model of <a
|
|
href="./DFSVisitor.html">DFSVisitor</a>.
|
|
</LI>
|
|
<LI><a name="ColorMap">The type <TT>ColorMap</TT> must be a model of <a
|
|
href="../../property_map/ReadWritePropertyMap.html">ReadWritePropertyMap</a>. The key type of <tt>ColorMap</tt> must be the vertex descriptor type for the graph and the value type of <TT>ColorMap</TT> must be a model of
|
|
<a href="./ColorValue.html">ColorValue</a>.</a>
|
|
</LI>
|
|
|
|
</UL>
|
|
|
|
<P>
|
|
|
|
|
|
<br>
|
|
<HR>
|
|
<TABLE>
|
|
<TR valign=top>
|
|
<TD nowrap>Copyright © 2000</TD><TD>
|
|
<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Univ.of Notre Dame (<A HREF="mailto:jsiek@lsc.nd.edu">jsiek@lsc.nd.edu</A>)
|
|
</TD></TR></TABLE>
|
|
|
|
</BODY>
|
|
</HTML>
|