Choosing the cheapest currently available robot–task pair need not minimize the cost of assigning every task. One inexpensive edge can consume an option that another row needs much more strongly. The objective concerns the cost of the completed matching, rather than the attractiveness of each commitment in isolation.

An invented three-by-three matrix makes the distinction exact. Its entries are abstract cost units, not measured travel times or recommendations for dispatching a fleet. The example contains no routing, simultaneous-motion model, or execution of an optimization package.

Define the complete assignment before choosing an edge

Label three hypothetical resources A, B, and C, and three tasks 1, 2, and 3. Each resource receives exactly one task, and every task receives exactly one resource. Costs are fixed and additive across the three selected pairs.

For each pair define a binary variable x_ij. A value of one selects that pair. The row sums and column sums must all equal one. Minimize the sum of c_ij x_ij over every row and column. Those equalities prevent both assigning one resource twice and leaving a required task uncovered.

SciPy's official linear-sum-assignment reference states this square-matrix objective and its rectangular generalization. Google's original assignment tutorial separately presents the task coverage, resource capacity, and additive-cost constraints. The matrix and certification below are independent examples, with no reuse of their cost arrays or solver results.

Use a matrix with a tempting first choice

Write each resource's costs in task order. Row A is [1,2,9], row B is [2,100,9], and row C is [9,9,3]. Every entry is finite and every resource–task pair is permitted in this first model.

The globally cheapest pair is A–1, costing one. Consider a greedy rule that selects that pair, removes its row and column, and repeats. The remaining cheapest pair is C–3 at cost three. The last remaining pair is then B–2 at cost 100.

The completed greedy assignment costs 104. None of its choices conflicts with an earlier selected pair, so it is feasible. Feasibility does not establish optimality.

A different feasible allocation gives task 2 to A at cost two, task 1 to B at cost two, and task 3 to C at cost three. Its total is seven. Paying one extra unit for A's individual task preserves an option that avoids a 98-unit increase for B.

Examine every complete alternative in the small example

A square assignment can be represented by the ordered list of task numbers given to A, B, and C. The six possible lists are [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].

Their totals are respectively 104, 19, 7, 20, 20, and 118. Thus seven is the unique minimum among all six assignments. The conclusion follows from complete enumeration for this small model, rather than from assuming that a heuristic happened to work.

Choosing the cheapest entry in each row independently gives costs one, two, and three, totaling six. But both A and B then select task 1. That sum is an infeasible lower-looking number, not an alternative assignment cost.

Certify the minimum without listing permutations

Assign row numbers u_A=1, u_B=2, and u_C=3, and column numbers v_1=0, v_2=1, and v_3=0. Each sum u_i+v_j is no larger than the corresponding cost c_ij.

For example, A–2 has 1+1=2, B–1 has 2+0=2, and C–3 has 3+0=3. All three equal their selected costs. Other inequalities include B–2 with 2+1=3 below 100 and C–1 with 3+0=3 below nine.

For any complete one-to-one assignment, add these pairwise lower bounds. Each row number and each column number appears exactly once, giving total cost at least 1+2+3+0+1+0=7.

The proposed matching attains seven, so the bound and feasible solution meet. This is a mathematical certificate of optimality for the displayed matrix. It does not require a claim that any particular software implementation was run.

The certificate also shows why selecting a zero-gap pair is insufficient by itself. A–1 equals u_A+v_1 too, yet committing to it prevents completing the displayed seven-cost matching. Local equality is not a substitute for satisfying the complete set of row and column conditions.

Check changes that preserve the optimizer

Add ten to every cost in row A. Every complete assignment uses that row once, so every total rises by ten. The minimizing matching remains [2,1,3], now costing 17.

Likewise, adding one shared constant to every entry of a column shifts all square-assignment totals equally, since every task must be used exactly once. Such transformations can simplify arithmetic while preserving the minimizing permutations. Changing just one entry, omitting a task, or allowing repeated resource use is a different operation.

The greedy failure can be arbitrarily large in this family. Replace the 100 in B–2 with a larger value M. The stated cheapest-edge rule still chooses A–1 and C–3, then pays M+4. The alternative [2,1,3] still costs seven. Increasing M therefore enlarges the failure without changing the alternative's cost.

Specify what happens when the two sides have different sizes

With more resources than required tasks and capacity of at most one per resource, some resources can remain idle. With more tasks than resources, requiring all tasks while keeping that capacity can make the model infeasible. A rectangular matching routine's output convention must not be confused with a promise that every item on both sides was assigned.

An unassigned-task option can be modeled explicitly, for example through designated dummy choices and declared penalties. It does not follow automatically from the original square problem. Likewise, a forbidden pair is a feasibility restriction, not merely an inexpensive entry left out of a printout.

For allocation records, retain the objective, task coverage, resource capacity, permitted pairs, and full selected total. The example's main result is the cost of opportunity consumed by an early choice. A complete assignment can be verified against those constraints even when its cheapest individual pair looks compelling.

Sources checked October 24, 2026:

SciPy v1.18.0: linear_sum_assignment: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html

Google OR-Tools: Solving an Assignment Problem: https://developers.google.com/optimization/assignment/assignment_example

Concept illustration: A small desktop robot beside a laptop showing a generic workflow provides robotics context for this analytical model. The image does not depict the article's numerical example, a verified experiment, a product specification, or deployment evidence.