2
0
mirror of https://github.com/boostorg/graph.git synced 2026-01-27 19:02:12 +00:00
Files
graph/doc/Graph.html
Jeremiah Willcock 801a11bf4a Merged in changes from trunk for Boost.Graph and Boost.PropertyMap. Includes
r56013, r56014, r56015, r56016, r56017, r56089, r56097, r56116, r56117, r56126,
r56127, r56128, r56140, r56147, r56300, r56301, r56339, r56360, r56454, r56473,
r56563, r56651, r56654, r56658, r56682, r56732, r56796, r56855, r56856, r56868,
r55667, r56860, r55473, r55507, r55528, r55749, r56147, r55723, r56109, r56859,
and r55780.


[SVN r56881]
2009-10-15 20:40:46 +00:00

149 lines
4.5 KiB
HTML

<HTML>
<!--
Copyright (c) Jeremy Siek 2000
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
-->
<Head>
<Title>Graph</Title>
<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b"
ALINK="#ff0000">
<IMG SRC="../../../boost.png"
ALT="C++ Boost" width="277" height="86">
<BR Clear>
<H2><A NAME="concept:Graph"></A>
Graph
</H2>
<P>
The Graph concept contains a few requirements that are common to all
the graph concepts. These include some associated types for
<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc. One should
note that a model of Graph is <B>not</B> required to be a model of <a
href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
so algorithms should pass graph objects by reference.
<P>
<h3>Notation</h3>
<Table>
<TR>
<TD><tt>G</tt></TD>
<TD>A type that is a model of Graph.</TD>
</TR>
<TR>
<TD><tt>g</tt></TD>
<TD>An object of type <tt>G</tt>.</TD>
</TR>
</table>
<H3>Associated Types</H3>
<table border>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::vertex_descriptor</pre>
A vertex descriptor corresponds to a unique vertex in an abstract
graph instance. A vertex descriptor must be
<a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</a>,
<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>, and
<a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edge_descriptor</pre>
An edge descriptor corresponds to a unique edge <i>(u,v)</i> in a
graph. An edge descriptor must be <a
href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</I>,
<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>, and
<a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::directed_category</pre>
This type shall be convertible to <TT>directed_tag</TT> or <TT>undirected_tag</TT>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::edge_parallel_category</pre>
This describes whether the graph class allows the insertion of
parallel edges (edges with the same source and target). The two tags
are <TT>allow_parallel_edge_tag</TT> and <TT>disallow_parallel_edge_tag</TT>.
</td>
</tr>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::traversal_category</pre>
This describes the ways in which the vertices and edges of the
graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
<TT>adjacency_matrix_tag</TT>.
</td>
</tr>
</table>
<H3>Valid Expressions</H3>
<table border>
<tr>
<td><pre>boost::graph_traits&lt;G&gt;::null_vertex()</pre></td></TD>
<td>
Returns a special <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt> object which does not refer to
any vertex of graph object which type is <tt>G</tt>.
<td>
</tr>
</table>
<H3>Concept Checking Class</H3>
<PRE>
template &lt;class G&gt;
struct GraphConcept
{
typedef typename boost::graph_traits&lt;G&gt;::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
typedef typename boost::graph_traits&lt;G&gt;::directed_category directed_category;
typedef typename boost::graph_traits&lt;G&gt;::edge_parallel_category edge_parallel_category;
typedef typename boost::graph_traits&lt;G&gt;::traversal_category traversal_category;
void constraints() {
function_requires&lt; DefaultConstructibleConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; EqualityComparableConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; AssignableConcept&lt;vertex_descriptor&gt; &gt;();
function_requires&lt; DefaultConstructibleConcept&lt;edge_descriptor&gt; &gt;();
function_requires&lt; EqualityComparableConcept&lt;edge_descriptor&gt; &gt;();
function_requires&lt; AssignableConcept&lt;edge_descriptor&gt; &gt;();
}
G g;
};
</PRE>
<H3>See Also</H3>
<a href="./graph_concepts.html">Graph concepts</a>
<br>
<HR>
<TABLE>
<TR valign=top>
<TD nowrap>Copyright &copy; 2000-2001</TD><TD>
<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
</TD></TR></TABLE>
</BODY>
</HTML>