]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | //======================================================================= |
2 | // Copyright 2012 | |
3 | // Authors: David Doria | |
4 | // | |
5 | // Distributed under the Boost Software License, Version 1.0. (See | |
6 | // accompanying file LICENSE_1_0.txt or copy at | |
7 | // http://www.boost.org/LICENSE_1_0.txt) | |
8 | //======================================================================= | |
9 | ||
10 | #include <boost/graph/graph_traits.hpp> | |
11 | #include <boost/graph/undirected_graph.hpp> | |
12 | ||
f67539c2 | 13 | typedef boost::undirected_graph< boost::no_property > Graph; |
7c673cae | 14 | |
f67539c2 | 15 | int main(int, char*[]) |
7c673cae | 16 | { |
f67539c2 TL |
17 | // Create a graph object |
18 | Graph g; | |
7c673cae | 19 | |
f67539c2 TL |
20 | // Add vertices |
21 | boost::graph_traits< Graph >::vertex_descriptor v0 = g.add_vertex(); | |
22 | boost::graph_traits< Graph >::vertex_descriptor v1 = g.add_vertex(); | |
23 | boost::graph_traits< Graph >::vertex_descriptor v2 = g.add_vertex(); | |
7c673cae | 24 | |
f67539c2 TL |
25 | // Add edges |
26 | g.add_edge(v0, v1); | |
27 | g.add_edge(v1, v2); | |
7c673cae | 28 | |
f67539c2 | 29 | return 0; |
7c673cae | 30 | } |