• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // (C) Copyright Andrew Sutton 2007
2 //
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0 (See accompanying file
5 // LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
6 
7 //[code_bron_kerbosch_clique_number
8 #include <iostream>
9 #ifdef _MSC_VER
10 #define _CRT_SECURE_NO_WARNINGS
11 #endif
12 #include <boost/graph/undirected_graph.hpp>
13 #include <boost/graph/bron_kerbosch_all_cliques.hpp>
14 
15 #include "helper.hpp"
16 
17 using namespace std;
18 using namespace boost;
19 
20 // Declare the graph type and its vertex and edge types.
21 typedef undirected_graph<> Graph;
22 typedef graph_traits< Graph >::vertex_descriptor Vertex;
23 typedef graph_traits< Graph >::edge_descriptor Edge;
24 
main(int argc,char * argv[])25 int main(int argc, char* argv[])
26 {
27     // Create the graph and read it from standard input.
28     Graph g;
29     read_graph(g, cin);
30 
31     // Use the Bron-Kerbosch algorithm to find all cliques, and
32     size_t c = bron_kerbosch_clique_number(g);
33     cout << "clique number: " << c << endl;
34 
35     return 0;
36 }
37 //]
38