97 lines
2.4 KiB
HTML
97 lines
2.4 KiB
HTML
<HTML>
|
|
<!--
|
|
Copyright (c) David Doria 2012
|
|
|
|
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>Boost Graph Library: Undirected 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>
|
|
|
|
<H1><A NAME="sec:undirected-graph-class"></A>
|
|
<pre>
|
|
undirected_graph<VertexProp, EdgeProp, GraphProp>
|
|
</pre>
|
|
</H1>
|
|
|
|
|
|
<P>
|
|
The <tt>undirected_graph</tt> class template is is a simplified version
|
|
of the BGL adjacency list. This class is provided for ease of use, but
|
|
may not perform as well as custom-defined adjacency list classes. Instances
|
|
of this template model the BidirectionalGraph, VertexIndexGraph, and
|
|
EdgeIndexGraph concepts.
|
|
|
|
<H3>Example</H3>
|
|
|
|
A simple example of creating an undirected_graph is available here <a href="../../../libs/graph/example/undirected_graph.cpp"><tt>libs/graph/example/undirected_graph.cpp</tt></a>
|
|
<P>
|
|
|
|
|
|
<PRE>
|
|
typedef boost::undirected_graph<> Graph;
|
|
Graph g;
|
|
boost::graph_traits<Graph>::vertex_descriptor v0 = g.add_vertex();
|
|
boost::graph_traits<Graph>::vertex_descriptor v1 = g.add_vertex();
|
|
|
|
g.add_edge(v0, v1);
|
|
</PRE>
|
|
|
|
<H3>Template Parameters</H3>
|
|
|
|
<P>
|
|
<TABLE border>
|
|
<TR>
|
|
<th>Parameter</th><th>Description</th><th>Default</th>
|
|
</tr>
|
|
|
|
<TR><TD><TT>VertexProp</TT></TD>
|
|
<TD>A property map for the graph vertices.</TD>
|
|
<TD> </TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD><TT>EdgeProp</TT></TD>
|
|
<TD>A property map for the graph edges.</TD>
|
|
<TD> </TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD><TT>GraphProp</TT></TD>
|
|
<TD>A property map for the graph itself.</TD>
|
|
</TR>
|
|
|
|
</TABLE>
|
|
<P>
|
|
|
|
<H3>Where Defined</H3>
|
|
|
|
<P>
|
|
<a href="../../../boost/graph/undirected_graph.hpp"><TT>boost/graph/undirected_graph.hpp</TT></a>
|
|
|
|
<P>
|
|
|
|
<br>
|
|
<HR>
|
|
<TABLE>
|
|
<TR valign=top>
|
|
<TD nowrap>Copyright © 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>)<br>
|
|
<A HREF="http://www.boost.org/people/liequan_lee.htm">Lie-Quan Lee</A>, Indiana University (<A HREF="mailto:llee@cs.indiana.edu">llee@cs.indiana.edu</A>)<br>
|
|
<A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>,
|
|
Indiana University (<A
|
|
HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>)
|
|
</TD></TR></TABLE>
|
|
|
|
</BODY>
|
|
</HTML>
|