#include <iostream>
#include <string>
#include <boost/graph/undirected_graph.hpp>
struct VertexProperty {
std::string name;
};
typedef boost::adjacency_list< boost::listS, // out-edges stored in a std::list
boost::listS, // vertex set stored here
boost::undirectedS, // bidirectional graph.
VertexProperty, // vertex properties
boost::no_property, // edge properties
boost::no_property, // graph properties
boost::listS // edge storage
> Graph;
int main(int,char*[])
{
// Create a graph object
Graph g(3);
// Assign "Vertex0" as the name of the 0th vertex
typedef boost::graph_traits<Graph>::vertex_iterator VItr;
VItr vitr, vend;
boost::tie( vitr, vend) = boost::vertices(g);
g[*vitr].name = "Vertex0";
for ( ; vitr != vend ; ++vitr )
std::cout << g[*vitr].name << "\n";
return 0;
}