A part of my algorithm requires to compute maximum flow in a network with integer capacities. I want to use boost::edmonds_karp_max_flow algorithm to find the maximum flow.
I tried reading the documentation but it was very difficult for me as I have never used BGL before. I have created the graph as follows where the weight attribute of the Edge
must be used as 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) {
// compute the maximum flow between vertices with ids u,v
}
can someone show me with an example how to implement this function ?