1 | //======================================================================= |
2 | // Copyright 2002 Indiana University. |
3 | // Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek |
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/concept_archetype.hpp> |
11 | #include <boost/graph/breadth_first_search.hpp> |
12 | #include <boost/graph/graph_archetypes.hpp> |
13 | |
14 | int main() |
15 | { |
16 | using namespace boost; |
17 | typedef default_constructible_archetype< |
18 | sgi_assignable_archetype< equality_comparable_archetype<> > > |
19 | vertex_t; |
20 | { |
21 | typedef incidence_graph_archetype< vertex_t, directed_tag, |
22 | allow_parallel_edge_tag > |
23 | IncidenceGraph; |
24 | typedef vertex_list_graph_archetype< vertex_t, directed_tag, |
25 | allow_parallel_edge_tag, IncidenceGraph > |
26 | graph_t; |
27 | graph_t& g = static_object< graph_t >::get(); |
28 | vertex_t s; |
29 | read_write_property_map_archetype< vertex_t, color_value_archetype > |
30 | color; |
31 | breadth_first_search(g, s, params: color_map(p: color)); |
32 | } |
33 | { |
34 | typedef incidence_graph_archetype< vertex_t, directed_tag, |
35 | allow_parallel_edge_tag > |
36 | IncidenceGraph; |
37 | typedef vertex_list_graph_archetype< vertex_t, directed_tag, |
38 | allow_parallel_edge_tag, IncidenceGraph > |
39 | graph_t; |
40 | graph_t& g = static_object< graph_t >::get(); |
41 | vertex_t s; |
42 | readable_property_map_archetype< vertex_t, std::size_t > v_index; |
43 | breadth_first_search(g, s, params: vertex_index_map(p: v_index)); |
44 | } |
45 | { |
46 | typedef incidence_graph_archetype< vertex_t, undirected_tag, |
47 | allow_parallel_edge_tag > |
48 | IncidenceGraph; |
49 | typedef vertex_list_graph_archetype< vertex_t, undirected_tag, |
50 | allow_parallel_edge_tag, IncidenceGraph > |
51 | Graph; |
52 | typedef property_graph_archetype< Graph, vertex_index_t, std::size_t > |
53 | graph_t; |
54 | graph_t& g = static_object< graph_t >::get(); |
55 | vertex_t s; |
56 | bfs_visitor<> v; |
57 | buffer_archetype< vertex_t > b; |
58 | breadth_first_search(g, s, params: visitor(p: v).buffer(p&: b)); |
59 | } |
60 | return 0; |
61 | } |
62 | |