1 //=======================================================================
2 // Copyright 2000 University of Notre Dame.
3 // Authors: Jeremy G. Siek, Andrew Lumsdaine, Lie-Quan Lee
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 
11 /*
12    IMPORTANT!!!
13    ~~~~~~~~~~~~
14    This example uses interfaces that have been deprecated and removed from Boost.Grpah.
15    Someone needs to update it, as it does NOT compile.
16 */
17 
18 #include <boost/config.hpp>
19 #include <set>
20 #include <iostream>
21 #include <iterator>
22 #include <algorithm>
23 #include <boost/graph/adjacency_list.hpp>
24 #include <boost/graph/edge_connectivity.hpp>
25 
26 using namespace boost;
27 
28 int
main()29 main()
30 {
31   const int N = 8;
32   typedef adjacency_list<vecS, vecS, undirectedS> UndirectedGraph;
33   UndirectedGraph g(N);
34 
35   add_edge(0, 1, g);
36   add_edge(0, 2, g);
37   add_edge(0, 3, g);
38   add_edge(1, 2, g);
39   add_edge(1, 3, g);
40   add_edge(2, 3, g);
41   add_edge(3, 4, g);
42   add_edge(3, 7, g);
43   add_edge(4, 5, g);
44   add_edge(4, 6, g);
45   add_edge(4, 7, g);
46   add_edge(5, 6, g);
47   add_edge(5, 7, g);
48   add_edge(6, 7, g);
49 
50   typedef graph_traits<UndirectedGraph>::edge_descriptor edge_descriptor;
51   typedef graph_traits<UndirectedGraph>::degree_size_type degree_size_type;
52   std::vector<edge_descriptor> disconnecting_set;
53 
54   degree_size_type c = edge_connectivity(g, std::back_inserter(disconnecting_set));
55 
56   std::cout << "The edge connectivity is " << c << "." << std::endl;
57   std::cout << "The disconnecting set is {";
58 
59   std::copy(disconnecting_set.begin(), disconnecting_set.end(),
60             std::ostream_iterator<edge_descriptor>(std::cout, " "));
61   std::cout << "}." << std::endl;
62 
63   return 0;
64 }
65