Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) boost::adjacency_list

 

boost::adjacency_list is the 'Swiss army knife' graph class of the Boost.Graph library.

 

boost::adjacency_list is defined in the header file 'boost/graph/adjacency_list.hpp'.

 

 

 

 

 

boost::adjacency_list template parameters

 

  1. EdgeList
  2. VertexList
  3. Directed
  4. VertexProperties
  5. EdgeProperties
  6. GraphProperties

 

 

 

 

 

Example

 

 

 

 

 

#include <boost/graph/adjacency_list.hpp>

int main()
{
  typedef boost::adjacency_list
  <
    //Store all out edges as a std::vector
    boost::vecS,
    //Store all vertices in a std::vector
    boost::vecS,
    //Relations are directed
    boost::directedS,
    //All vertices are person names of type std::string
    boost::property<boost::vertex_name_t,std::string>,
    //All edges are relation of type std::string
    boost::property<boost::edge_name_t,std::string>
  > Graph;
  
  Graph g;
}

 

 

 

 

 

References

 

  1. Jeremy G. Siek, Lie-Quan Lee, Andrew Lumsdaine. The Boost Graph Library. 2002. ISBN: 0-201-72914-8.

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict