Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_33_1/libs/graph/doc/Graph.html @ 24

Last change on this file since 24 was 12, checked in by landauf, 18 years ago

added boost

File size: 4.8 KB
Line 
1<HTML>
2<!--
3  -- Copyright (c) Jeremy Siek 2000
4  --
5  -- Permission to use, copy, modify, distribute and sell this software
6  -- and its documentation for any purpose is hereby granted without fee,
7  -- provided that the above copyright notice appears in all copies and
8  -- that both that copyright notice and this permission notice appear
9  -- in supporting documentation.  Silicon Graphics makes no
10  -- representations about the suitability of this software for any
11  -- purpose.  It is provided "as is" without express or implied warranty.
12  -->
13<Head>
14<Title>Graph</Title>
15<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 
16        ALINK="#ff0000"> 
17<IMG SRC="../../../boost.png" 
18     ALT="C++ Boost" width="277" height="86"> 
19
20<BR Clear>
21
22<H2><A NAME="concept:Graph"></A>
23Graph
24</H2>
25
26<P>
27The Graph concept contains a few requirements that are common to all
28the graph concepts. These include some associated types for
29<tt>vertex_descriptor</tt>, <tt>edge_descriptor</tt>, etc. One should
30note that a model of Graph is <B>not</B> required to be a model of <a
31href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
32so algorithms should pass graph objects by reference.
33
34<P>
35
36<h3>Notation</h3>
37
38<Table>
39<TR>
40<TD><tt>G</tt></TD>
41<TD>A type that is a model of Graph.</TD>
42</TR>
43
44<TR>
45<TD><tt>g</tt></TD>
46<TD>An object of type <tt>G</tt>.</TD>
47</TR>
48</table>
49
50<H3>Associated Types</H3>
51
52<table border>
53<tr>
54<td><pre>boost::graph_traits&lt;G&gt;::vertex_descriptor</pre>
55A vertex descriptor corresponds to a unique vertex in an abstract
56graph instance. A vertex descriptor must be
57<a
58href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</a>,
59<a href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>, and
60<a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
61</td>
62</tr>
63
64<tr>
65<td><pre>boost::graph_traits&lt;G&gt;::edge_descriptor</pre>
66An edge descriptor corresponds to a unique edge <i>(u,v)</i> in a
67graph.  An edge descriptor must be <a
68href="http://www.sgi.com/tech/stl/DefaultConstructible.html">Default Constructible</I>,
69<a
70href="http://www.sgi.com/tech/stl/Assignable.html">Assignable</a>,
71and <a href="http://www.sgi.com/tech/stl/EqualityComparable.html">Equality Comparable</a>.
72</td>
73</tr>
74
75<tr>
76<td><pre>boost::graph_traits&lt;G&gt;::directed_category</pre>
77The choices are <TT>directed_tag</TT> and <TT>undirected_tag</TT>.
78</td>
79</tr>
80
81<tr>
82<td><pre>boost::graph_traits&lt;G&gt;::edge_parallel_category</pre>
83This describes whether the graph class allows the insertion of
84parallel edges (edges with the same source and target). The two tags
85are <TT>allow_parallel_edge_tag</TT> and <TT>disallow_parallel_edge_tag</TT>.
86</td>
87</tr>
88
89<tr>
90<td><pre>boost::graph_traits&lt;G&gt;::traversal_category</pre>
91This describes the ways in which the vertices and edges of the
92graph can be visited. The choices are <TT>incidence_graph_tag</TT>,
93<TT>adjacency_graph_tag</TT>, <TT>bidirectional_graph_tag</TT>,
94<TT>vertex_list_graph_tag</TT>, <TT>edge_list_graph_tag</TT>, and
95<TT>adjacency_matrix_tag</TT>.
96</td>
97</tr>
98
99</table>
100
101<H3>Valid Expressions</H3>
102
103<table border>
104
105<tr>
106<td><pre>boost::graph_traits&lt;G&gt;::null_vertex()</pre></td></TD>
107<td>
108Returns a special <tt>boost::graph_traits&lt;G&gt;::vertex_descriptor</tt> object which does not refer to
109any vertex of graph object which type is <tt>G</tt>.
110<td>
111</tr>
112</table>
113
114
115
116<H3>Concept Checking Class</H3>
117
118<PRE>
119  template &lt;class G&gt;
120  struct GraphConcept
121  {
122    typedef typename boost::graph_traits&lt;G&gt;::vertex_descriptor vertex_descriptor;
123    typedef typename boost::graph_traits&lt;G&gt;::edge_descriptor edge_descriptor;
124    typedef typename boost::graph_traits&lt;G&gt;::directed_category directed_category;
125    typedef typename boost::graph_traits&lt;G&gt;::edge_parallel_category edge_parallel_category;
126    typedef typename boost::graph_traits&lt;G&gt;::traversal_category traversal_category;
127
128    void constraints() {
129      function_requires&lt; DefaultConstructibleConcept&lt;vertex_descriptor&gt; &gt;();
130      function_requires&lt; EqualityComparableConcept&lt;vertex_descriptor&gt; &gt;();
131      function_requires&lt; AssignableConcept&lt;vertex_descriptor&gt; &gt;();
132      function_requires&lt; DefaultConstructibleConcept&lt;edge_descriptor&gt; &gt;();
133      function_requires&lt; EqualityComparableConcept&lt;edge_descriptor&gt; &gt;();
134      function_requires&lt; AssignableConcept&lt;edge_descriptor&gt; &gt;();
135    }
136    G g;
137  };
138</PRE>
139
140<H3>See Also</H3>
141
142<a href="./graph_concepts.html">Graph concepts</a>
143
144<br>
145<HR>
146<TABLE>
147<TR valign=top>
148<TD nowrap>Copyright &copy 2000-2001</TD><TD>
149<A HREF="../../../people/jeremy_siek.htm">Jeremy Siek</A>, Indiana University (<A HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)
150</TD></TR></TABLE>
151
152</BODY>
153</HTML> 
Note: See TracBrowser for help on using the repository browser.