38 const std::vector<pgr_costFlow_t> &edges,
39 const std::set<int64_t> &sourceVertices,
40 const std::set<int64_t> &sinkVertices) {
45 rev = get(boost::edge_reverse,
graph);
56 boost::tie(e, b) = boost::add_edge(vertex(v,
graph),
64 const std::vector<pgr_costFlow_t> &edges) {
65 for (
const auto edge : edges) {
70 if (
edge.capacity > 0) {
72 static_cast<double>(
edge.capacity));
76 int64_t>(e1,
edge.edge_id));
78 int64_t>(e1Rev,
edge.edge_id));
84 if (
edge.reverse_capacity > 0) {
86 static_cast<double>(
edge.reverse_capacity));
90 int64_t>(e2,
edge.edge_id));
92 int64_t>(e2Rev,
edge.edge_id));
101 const std::set<int64_t> &sourceVertices) {
103 for (int64_t source_id : sourceVertices) {
107 0, (std::numeric_limits<int32_t>::max)());
115 const std::set<int64_t> &sinkVertices) {
117 for (int64_t sink_id : sinkVertices) {
131 for (boost::tie(e, eEnd) = boost::edges(
graph); e != eEnd; ++e) {
140 std::vector<pgr_flow_t>
142 std::vector<pgr_flow_t> flowEdges;
144 for (boost::tie(e, eEnd) = boost::edges(
graph); e != eEnd; ++e) {
154 edge.residual_capacity =
157 if (flowEdges.size() == 0)
160 edge.agg_cost = (flowEdges.back()).agg_cost +
edge.
cost;
161 flowEdges.push_back(
edge);