An experimental LPSolverWrapper class which uses glpk. For a short
demo, max flow problems are solved with it. This demo does not
demonstrates, but the main aims of this class are row and column
generation capabilities, i.e. to be a core for easily
implementable branch-and-cut a column generetion algorithms.
4 #include <LEDA/graph.h>
5 #include <LEDA/graph_alg.h>
6 #include <LEDA/dimacs.h>
8 #include <time_measure.h>
10 // Use a DIMACS max flow file as stdin.
11 // read_dimacs_demo_leda < dimacs_max_flow_file
16 leda_edge_array<int> cap;
17 Read_Dimacs_Maxflow(cin,G,cap,s,t);
19 leda_edge_array<int> flow(G);
21 std::cout << "preflow demo (LEDA)..." << std::endl;
22 double pre_time=currTime();
23 int flow_value = MAX_FLOW(G,s,t,cap,flow);
24 double post_time=currTime();
25 //std::cout << "maximum flow: "<< std::endl;
26 //std::cout<<std::endl;
27 std::cout << "elapsed time: " << post_time-pre_time << " sec"<< std::endl;
28 std::cout << "flow value: "<< flow_value << std::endl;