We first create an empty graph and initialize it using the function readgraph.
Graph G; map<vertex_descriptor, int> vertex_index; map<edge_descriptor, double> edge_property; int base = atoi(argv[1]); readgraph(base, argv[2], G, vertex_index, edge_property);
ILP_Problem IP(Optsense_Max);
ILP_Problem
IP(Optsense_Min)
; here. The row_map VM is used to store the variables that are added to the model. These variables are binary and correspond to the edges of the graph G. edge_descriptor e; row_map<edge_descriptor> VM; BGL_FORALL_EDGES(e, G, Graph) VM[e]=IP.add_binary_variable(edge_property[e]);
CUT<Graph>* scc = new CUT<Graph>(G, VM);
IP.add_sym_constraint(scc);
optimize
. IP.optimize();
double optimum = IP.get_optimum();
getConfiguration
. list<vertex_descriptor> configuration = scc->getConfiguration(sol); vertex_descriptor v; BOOST_FOREACH(v, configuration) cout << vertex_index[v] + abs(base) << " "; cout << endl;