#include #include #include #include #include #include #include typedef int FlowValue; int main (int argc, char **argv) { using namespace boost; typedef adjacency_list_traits Traits; typedef adjacency_list > >, property > > > Graph; typedef Graph::vertex_descriptor Vertex; if (argc != 2) { std::cout << "Usage: test-flow infile.dimacs\n"; exit(-1); } std::ifstream infile(argv[1]); Graph g; Vertex s, t; read_dimacs_max_flow(g, boost::get(edge_capacity, g), boost::get(edge_reverse, g), s, t, infile); FlowValue flow = boykov_kolmogorov_max_flow(g, s, t); std::cout << "BK flow: " << flow << "\n"; flow = push_relabel_max_flow(g, s, t); std::cout << "PR flow: " << flow << "\n"; }