Adds an arc from a left node to a right node with a given cost.
* Node indices must be non-negative (>= 0). For a perfect
matching to exist on n nodes, the values taken by "left_node"
must cover [0, n), same for "right_node".
* The arc cost can be any integer, negative, positive or zero.
* After the method finishes, NumArcs() == the returned ArcIndex + 1.
Returns the current number of left nodes which is the same as the
number of right nodes. This is one greater than the largest node
index seen so far in AddArcWithCost().
Returns the right node assigned to the given left node in the
last solution computed by Solve(). This works only if Solve()
returned OPTIMAL.
Note: It is possible that there is more than one optimal
solution. The algorithm is deterministic so it will always return
the same solution for a given problem. There is no such guarantee
from one code version to the next, but the code does not change
often.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["`SimpleLinearSumAssignment` is a C++ class within the OR-Tools library designed for solving the linear sum assignment problem, finding the minimum cost assignment of agents to tasks."],["The class allows adding arcs (connections between agents and tasks) with associated costs using `AddArcWithCost`."],["`Solve()` initiates the optimization process and returns the solution status (e.g., optimal, infeasible)."],["Post-solving, methods like `OptimalCost`, `AssignmentCost`, and `RightMate` provide access to the solution's cost and assigned pairings."],["Node and arc indices are managed dynamically, with `NumNodes` and `NumArcs` offering information on the problem size."]]],["The `SimpleLinearSumAssignment` class manages assignments between left and right nodes. Key actions include `AddArcWithCost` to define connections between nodes with associated costs. `NumArcs` and `NumNodes` return the number of arcs and nodes respectively. `Solve` computes an optimal assignment. Results are accessed via `OptimalCost`, `RightMate` (the assigned right node for a left node), and `AssignmentCost` (the cost of the arc used for assignment). Other functions include `Cost`, `LeftNode`, and `RightNode`.\n"]]