]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/graph/example/make_connected.cpp
1 //=======================================================================
2 // Copyright 2007 Aaron Windsor
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 //=======================================================================
9 #include <boost/graph/adjacency_list.hpp>
10 #include <boost/graph/properties.hpp>
11 #include <boost/graph/graph_traits.hpp>
12 #include <boost/property_map/property_map.hpp>
15 #include <boost/graph/connected_components.hpp>
16 #include <boost/graph/make_connected.hpp>
20 using namespace boost
;
22 int main(int argc
, char** argv
)
25 typedef adjacency_list
29 property
<vertex_index_t
, int>
43 std::vector
< graph_traits
<graph
>::vertices_size_type
>
44 component(num_vertices(g
));
46 std::cout
<< "Before calling make_connected, the graph has "
47 << connected_components(g
, &component
[0])
48 << " connected components" << std::endl
;
52 std::cout
<< "After calling make_connected, the graph has "
53 << connected_components(g
, &component
[0])
54 << " connected components" << std::endl
;