Part of my algorithm requires computing the maximum flow in a network with entire capacities. I want to use the boost :: edmonds_karp_max_flow algorithm to find the maximum flow.
I tried reading the documentation, but it was very difficult for me, since I had never used BGL before. I created the graph as follows, where the Edge weight attribute should be used as the capacity of the edges in the graph.
struct Vertex{ int id; bool flag; }; struct Edge{ int weight; }; typedef boost::adjacency_list< boost::listS, boost::vecS, boost::undirectedS, Vertex, Edge >MyGraph;
My goal is to write the following function
int max_flow( const MyGraph& gr, int u, int v) {
can someone show me an example of how to implement this function?
Grady source share