168 #ifndef OR_TOOLS_GRAPH_MIN_COST_FLOW_H_
169 #define OR_TOOLS_GRAPH_MIN_COST_FLOW_H_
187 template <
typename Graph,
typename ArcFlowType,
typename ArcScaledCostType>
244 return SolveWithPossibleAdjustment(SupplyAdjustment::DONT_ADJUST);
253 return SolveWithPossibleAdjustment(SupplyAdjustment::ADJUST);
283 typedef ::util::ReverseArcStaticGraph<NodeIndex, ArcIndex> Graph;
284 enum SupplyAdjustment { ADJUST, DONT_ADJUST };
290 Status SolveWithPossibleAdjustment(SupplyAdjustment adjustment);
293 std::vector<NodeIndex> arc_tail_;
294 std::vector<NodeIndex> arc_head_;
295 std::vector<FlowQuantity> arc_capacity_;
296 std::vector<FlowQuantity> node_supply_;
297 std::vector<CostValue> arc_cost_;
298 std::vector<ArcIndex> arc_permutation_;
299 std::vector<FlowQuantity> arc_flow_;
326 class GenericMinCostFlow :
public MinCostFlowBase {
331 typedef typename Graph::OutgoingOrOppositeIncomingArcIterator
346 Status
status()
const {
return status_; }
374 std::vector<NodeIndex>*
const infeasible_demand_node);
424 bool IsAdmissible(
ArcIndex arc)
const;
439 bool CheckInputConsistency()
const;
445 bool CheckResult()
const;
449 bool CheckCostRange()
const;
455 bool CheckRelabelPrecondition(
NodeIndex node)
const;
459 std::string DebugString(
const std::string&
context,
ArcIndex arc)
const;
463 void ResetFirstAdmissibleArcs();
475 void SaturateAdmissibleArcs();
485 void InitializeActiveNodeStack();
519 bool IsArcDirect(
ArcIndex arc)
const;
520 bool IsArcValid(
ArcIndex arc)
const;
552 ZVector<ArcFlowType> residual_arc_capacity_;
560 std::stack<NodeIndex> active_nodes_;
573 ZVector<ArcScaledCostType> scaled_arc_unit_cost_;
595 int num_relabels_since_last_price_update_;
598 bool feasibility_checked_;
601 bool use_price_update_;
604 bool check_feasibility_;
621 #endif // OR_TOOLS_GRAPH_MIN_COST_FLOW_H_