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.
10 template<typename Graph, typename CapacityMap>
11 void readDimacsMaxFlow(std::istream& is, Graph &G, typename Graph::NodeIt &s, typename Graph::NodeIt &t, CapacityMap& capacity) {
20 std::vector<typename Graph::NodeIt> nodes;
29 case 'p': //problem definition
30 is >> problem >> n >> m;
33 for (int k=1; k<=n; ++k) nodes[k]=G.addNode();
35 case 'n': //node definition
36 if (problem=="sp") { //shortest path problem
41 if (problem=="max") { //max flow problem
44 if (d=='s') s=nodes[i];
45 if (d=='t') t=nodes[i];
51 typename Graph::EdgeIt e=G.addEdge(nodes[i], nodes[j]);