]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | //======================================================================= |
2 | // Copyright 2001 Jeremy G. Siek, Andrew Lumsdaine, Lie-Quan Lee, | |
3 | // | |
4 | // Distributed under the Boost Software License, Version 1.0. (See | |
5 | // accompanying file LICENSE_1_0.txt or copy at | |
6 | // http://www.boost.org/LICENSE_1_0.txt) | |
7 | //======================================================================= | |
8 | ||
9 | #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION | |
10 | #error The vector_as_graph.hpp header requires partial specialization | |
11 | #endif | |
12 | ||
13 | #include <vector> | |
14 | #include <list> | |
15 | #include <iostream> // needed by graph_utility. -Jeremy | |
16 | #include <boost/graph/vector_as_graph.hpp> | |
17 | #include <boost/graph/graph_utility.hpp> | |
18 | ||
19 | int | |
20 | main() | |
21 | { | |
22 | enum | |
23 | { r, s, t, u, v, w, x, y, N }; | |
24 | char name[] = "rstuvwxy"; | |
25 | typedef std::vector < std::list < int > > Graph; | |
26 | Graph g(N); | |
27 | g[r].push_back(v); | |
28 | g[s].push_back(r); | |
29 | g[s].push_back(r); | |
30 | g[s].push_back(w); | |
31 | g[t].push_back(x); | |
32 | g[u].push_back(t); | |
33 | g[w].push_back(t); | |
34 | g[w].push_back(x); | |
35 | g[x].push_back(y); | |
36 | g[y].push_back(u); | |
37 | boost::print_graph(g, name); | |
38 | return 0; | |
39 | } |