19 #include "absl/flags/flag.h"
30 const ArcIndex num_arcs = arc_cost_.size();
31 num_nodes_ =
std::max(num_nodes_, left_node + 1);
32 num_nodes_ =
std::max(num_nodes_, right_node + 1);
33 arc_tail_.push_back(left_node);
34 arc_head_.push_back(right_node);
35 arc_cost_.push_back(
cost);
44 return arc_tail_[
arc];
48 return arc_head_[
arc];
52 return arc_cost_[
arc];
57 assignment_arcs_.clear();
64 for (
const CostValue unscaled_arc_cost : arc_cost_) {
68 const ArcIndex num_arcs = arc_cost_.size();
72 graph.
AddArc(arc_tail_[
arc], num_nodes_ + arc_head_[
arc]);
79 optimal_cost_ = assignment.
GetCost();
80 for (
NodeIndex node = 0; node < num_nodes_; ++node) {
ArcIndexType AddArc(NodeIndexType tail, NodeIndexType head)
ArcIndex GetAssignmentArc(NodeIndex left_node) const
CostValue GetCost() const
void SetArcCost(ArcIndex arc, CostValue cost)
NodeIndex NumNodes() const
CostValue Cost(ArcIndex arc) const
ArcIndex AddArcWithCost(NodeIndex left_node, NodeIndex right_node, CostValue cost)
NodeIndex LeftNode(ArcIndex arc) const
SimpleLinearSumAssignment()
NodeIndex RightNode(ArcIndex arc) const
Collection of objects used to extend the Constraint Solver library.