1<HTML> 2<!-- 3 Copyright (c) David Doria 2012 4 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) 8 --> 9<Head> 10<Title>Boost Graph Library: Undirected Graph</Title> 11<BODY BGCOLOR="#ffffff" LINK="#0000ee" TEXT="#000000" VLINK="#551a8b" 12 ALINK="#ff0000"> 13<IMG SRC="../../../boost.png" 14 ALT="C++ Boost" width="277" height="86"> 15 16<BR Clear> 17 18<H1><A NAME="sec:undirected-graph-class"></A> 19<pre> 20undirected_graph<VertexProp, EdgeProp, GraphProp> 21</pre> 22</H1> 23 24 25<P> 26The <tt>undirected_graph</tt> class template is is a simplified version 27of the BGL adjacency list. This class is provided for ease of use, but 28may not perform as well as custom-defined adjacency list classes. Instances 29of this template model the BidirectionalGraph, VertexIndexGraph, and 30EdgeIndexGraph concepts. 31 32<H3>Example</H3> 33 34A 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> 35<P> 36 37 38<PRE> 39 typedef boost::undirected_graph<> Graph; 40 Graph g; 41 boost::graph_traits<Graph>::vertex_descriptor v0 = g.add_vertex(); 42 boost::graph_traits<Graph>::vertex_descriptor v1 = g.add_vertex(); 43 44 g.add_edge(v0, v1); 45</PRE> 46 47<H3>Template Parameters</H3> 48 49<P> 50<TABLE border> 51<TR> 52<th>Parameter</th><th>Description</th><th>Default</th> 53</tr> 54 55<TR><TD><TT>VertexProp</TT></TD> 56<TD>A property map for the graph vertices.</TD> 57<TD> </TD> 58</TR> 59 60<TR> 61<TD><TT>EdgeProp</TT></TD> 62<TD>A property map for the graph edges.</TD> 63<TD> </TD> 64</TR> 65 66<TR> 67<TD><TT>GraphProp</TT></TD> 68<TD>A property map for the graph itself.</TD> 69</TR> 70 71</TABLE> 72<P> 73 74<H3>Where Defined</H3> 75 76<P> 77<a href="../../../boost/graph/undirected_graph.hpp"><TT>boost/graph/undirected_graph.hpp</TT></a> 78 79<P> 80 81<br> 82<HR> 83<TABLE> 84<TR valign=top> 85<TD nowrap>Copyright © 2000-2001</TD><TD> 86<A HREF="http://www.boost.org/people/jeremy_siek.htm">Jeremy Siek</A>, 87Indiana University (<A 88HREF="mailto:jsiek@osl.iu.edu">jsiek@osl.iu.edu</A>)<br> 89<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> 90<A HREF="https://homes.cs.washington.edu/~al75">Andrew Lumsdaine</A>, 91Indiana University (<A 92HREF="mailto:lums@osl.iu.edu">lums@osl.iu.edu</A>) 93</TD></TR></TABLE> 94 95</BODY> 96</HTML> 97