diff --git a/ortools/graph/min_cost_flow.cc b/ortools/graph/min_cost_flow.cc index 2cb528d041..7af5b77949 100644 --- a/ortools/graph/min_cost_flow.cc +++ b/ortools/graph/min_cost_flow.cc @@ -27,6 +27,7 @@ #include "absl/strings/string_view.h" #include "ortools/base/logging.h" #include "ortools/base/mathutil.h" +#include "ortools/graph/generic_max_flow.h" #include "ortools/graph/graph.h" #include "ortools/graph/graphs.h" #include "ortools/graph/max_flow.h" @@ -319,8 +320,9 @@ bool GenericMinCostFlownum_arcs() + num_extra_arcs; const NodeIndex source = num_nodes_in_max_flow - 2; const NodeIndex sink = num_nodes_in_max_flow - 1; - StarGraph checker_graph(num_nodes_in_max_flow, num_arcs_in_max_flow); - MaxFlow checker(&checker_graph, source, sink); + using CheckerGraph = ::util::ReverseArcListGraph<>; + CheckerGraph checker_graph(num_nodes_in_max_flow, num_arcs_in_max_flow); + GenericMaxFlow checker(&checker_graph, source, sink); // Copy graph_ to checker_graph. for (ArcIndex arc = 0; arc < graph_->num_arcs(); ++arc) { const ArcIndex new_arc = diff --git a/ortools/graph/samples/simple_max_flow_program.cc b/ortools/graph/samples/simple_max_flow_program.cc index 39eaf7bdfc..4696e8f747 100644 --- a/ortools/graph/samples/simple_max_flow_program.cc +++ b/ortools/graph/samples/simple_max_flow_program.cc @@ -51,7 +51,7 @@ void SimpleMaxFlowProgram() { // [END solve] // [START print_solution] - if (status == MaxFlow::OPTIMAL) { + if (status == SimpleMaxFlow::OPTIMAL) { LOG(INFO) << "Max flow: " << max_flow.OptimalFlow(); LOG(INFO) << ""; LOG(INFO) << " Arc Flow / Capacity";