Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
C++ Boost

undirected_graph<VertexProp, EdgeProp, GraphProp>

The undirected_graph 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.


A simple example of creating an undirected_graph is available here libs/graph/example/undirected_graph.cpp

  typedef boost::undirected_graph<> Graph;
  Graph g;
  boost::graph_traits::vertex_descriptor v0 = g.add_vertex();
  boost::graph_traits::vertex_descriptor v1 = g.add_vertex();

  g.add_edge(v0, v1);

Template Parameters

VertexProp A property map for the graph vertices.  
EdgeProp A property map for the graph edges.  
GraphProp A property map for the graph itself.

Where Defined


Copyright © 2000-2001 Jeremy Siek, Indiana University (
Lie-Quan Lee, Indiana University (
Andrew Lumsdaine, Indiana University (