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
main()19 int main()
20 {
21 enum
22 {
23 r,
24 s,
25 t,
26 u,
27 v,
28 w,
29 x,
30 y,
31 N
32 };
33 char name[] = "rstuvwxy";
34 typedef std::vector< std::list< int > > Graph;
35 Graph g(N);
36 g[r].push_back(v);
37 g[s].push_back(r);
38 g[s].push_back(r);
39 g[s].push_back(w);
40 g[t].push_back(x);
41 g[u].push_back(t);
42 g[w].push_back(t);
43 g[w].push_back(x);
44 g[x].push_back(y);
45 g[y].push_back(u);
46 boost::print_graph(g, name);
47 return 0;
48 }
49