
#include <iostream>

#include <boost/graph/undirected_graph.hpp>
#include <boost/range/iterator_range.hpp>

using std::cout;

int main() {
  boost::undirected_graph<boost::no_property> g;
  
  auto a = g.add_vertex();
  auto b = g.add_vertex();
  auto c = g.add_vertex();
  
  add_edge(a, b, g);
  add_edge(b, c, g);
  
  for(auto v : make_iterator_range(vertices(g))) {
    cout << v << " has " << degree(v, g) << " neighbor(s): ";
    for(auto w : make_iterator_range(adjacent_vertices(v, g))) cout << w << ' ';
    cout << '\n';
  }
  return 0;
}
