3 Copyright (c) Jeremy Siek 2000
5 Distributed under the Boost Software License, Version 1.0.
6 (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
11 <BODY BGCOLOR=
"#ffffff" LINK=
"#0000ee" TEXT=
"#000000" VLINK=
"#551a8b"
13 <IMG SRC=
"../../../boost.png"
14 ALT=
"C++ Boost" width=
"277" height=
"86">
18 <H2><A NAME=
"concept:Graph"></A>
23 The Graph concept contains a few requirements that are common to all
24 the graph concepts. These include some associated types for
25 <tt>vertex_descriptor
</tt>,
<tt>edge_descriptor
</tt>, etc. One should
26 note that a model of Graph is
<B>not
</B> required to be a model of
<a
27 href=
"http://www.sgi.com/tech/stl/Assignable.html">Assignable
</a>,
28 so algorithms should pass graph objects by reference.
37 <TD>A type that is a model of Graph.
</TD>
42 <TD>An object of type
<tt>G
</tt>.
</TD>
46 <H3>Associated Types
</H3>
50 <td><pre>boost::graph_traits
<G
>::vertex_descriptor
</pre>
51 A vertex descriptor corresponds to a unique vertex in an abstract
52 graph instance. A vertex descriptor must be
54 href=
"http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible
</a>,
55 <a href=
"http://www.sgi.com/tech/stl/Assignable.html">Assignable
</a>, and
56 <a href=
"http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable
</a>.
61 <td><pre>boost::graph_traits
<G
>::edge_descriptor
</pre>
62 An edge descriptor corresponds to a unique edge
<i>(u,v)
</i> in a
63 graph. An edge descriptor must be
<a
64 href=
"http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible
</I>,
65 <a href=
"http://www.sgi.com/tech/stl/Assignable.html">Assignable
</a>, and
66 <a href=
"http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable
</a>.
71 <td><pre>boost::graph_traits
<G
>::directed_category
</pre>
72 This type shall be convertible to
<TT>directed_tag
</TT> or
<TT>undirected_tag
</TT>.
77 <td><pre>boost::graph_traits
<G
>::edge_parallel_category
</pre>
78 This describes whether the graph class allows the insertion of
79 parallel edges (edges with the same source and target). The two tags
80 are
<TT>allow_parallel_edge_tag
</TT> and
<TT>disallow_parallel_edge_tag
</TT>.
85 <td><pre>boost::graph_traits
<G
>::traversal_category
</pre>
86 This describes the ways in which the vertices and edges of the
87 graph can be visited. The choices are
<TT>incidence_graph_tag
</TT>,
88 <TT>adjacency_graph_tag
</TT>,
<TT>bidirectional_graph_tag
</TT>,
89 <TT>vertex_list_graph_tag
</TT>,
<TT>edge_list_graph_tag
</TT>, and
90 <TT>adjacency_matrix_tag
</TT>.
96 <H3>Valid Expressions
</H3>
101 <td><pre>boost::graph_traits
<G
>::null_vertex()
</pre></td></TD>
103 Returns a special
<tt>boost::graph_traits
<G
>::vertex_descriptor
</tt> object which does not refer to
104 any vertex of graph object which type is
<tt>G
</tt>.
111 <H3>Concept Checking Class
</H3>
114 template
<class G
>
117 typedef typename boost::graph_traits
<G
>::vertex_descriptor vertex_descriptor;
118 typedef typename boost::graph_traits
<G
>::edge_descriptor edge_descriptor;
119 typedef typename boost::graph_traits
<G
>::directed_category directed_category;
120 typedef typename boost::graph_traits
<G
>::edge_parallel_category edge_parallel_category;
121 typedef typename boost::graph_traits
<G
>::traversal_category traversal_category;
124 BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept
<vertex_descriptor
> ));
125 BOOST_CONCEPT_ASSERT(( EqualityComparableConcept
<vertex_descriptor
> ));
126 BOOST_CONCEPT_ASSERT(( AssignableConcept
<vertex_descriptor
> ));
127 BOOST_CONCEPT_ASSERT(( DefaultConstructibleConcept
<edge_descriptor
> ));
128 BOOST_CONCEPT_ASSERT(( EqualityComparableConcept
<edge_descriptor
> ));
129 BOOST_CONCEPT_ASSERT(( AssignableConcept
<edge_descriptor
> ));
137 <a href=
"./graph_concepts.html">Graph concepts
</a>
143 <TD nowrap
>Copyright
© 2000-
2001</TD><TD>
144 <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>)