Hi, you don't need to actually add the edges to the graph. For example, I usually put them in an std::vector... as long as there is a way to link each edge with its reverse (i.e. a property_map). Example:
struct Vertex { int id; };
struct Edge { int id; };
using Graph = adjacency_list<listS, listS, directedS, Vertex, Edge>;
using Edge = Graph::edge_descriptor;
using EdgeIterator = Graph::edge_iterator;
Graph g;
EdgeIterator ei,ei_end;
// ... Fill g
std::vector<Edge> reverse_edge(num_edges(g));
for(std::tie(ei, ei_end) = edges(g); ei != ei_end; ++ei) {
auto id = graph[*ei].id;
reverse_edge[id] = (edge(target(*ei, g), source(*ei, g), g).first);
}
boykov_kolmogorov_max_flow(
g,
// ... Other params
make_iterator_property_map(reverse_edge.begin(), get(&Edge::id, g)),
// ... Other params
);