Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Optimal Matching between Point Clouds

This opening chapter isolates the simplest form of optimal transport: pairing two finite, equally weighted point clouds of the same cardinality. The stakes are algorithmic and geometric at once: one sees the combinatorial nature of transport, the special simplicity of the line, and the limitations of permutations once cardinalities or weights differ. Classical assignment algorithms such as the Hungarian and auction methods Kuhn, 1955Bertsekas, 1992 provide the computational backdrop, while the restriction to equal cardinalities and weights motivates the Kantorovich relaxation.

Monge Problem for Discrete Points

This section formulates matching as Monge’s deterministic transport problem on two equally weighted clouds. The one-dimensional case is a transparent reference case where the optimal map can be read off by sorting.

Assignment Problem

Let CRn×n\C\in\RR^{n\times n} be a cost matrix, where Ci,j\C_{i,j} is the cost of pairing source ii with target jj, and let Perm(n)\Perm(n) denote the bijections of {1,,n}\{1,\ldots,n\}. The optimal assignment problem is

minσPerm(n)1ni=1nCi,σ(i).\min_{\sigma \in \Perm(n)} \frac{1}{n}\sum_{i=1}^n \C_{i,\sigma(i)}.

When Ci,j=c(xi,yj)\C_{i,j}=c(x_i,y_j), this is the Monge problem between the two uniform empirical measures. The factor 1/n1/n records the mass of each atom but does not change the optimizer. Exhaustive search evaluates all n!n! permutations and is therefore impractical. Without additional assumptions on C\C, the optimizer need not be unique.

Convex Costs on the Line

In one dimension, convex costs select monotone matchings.

Proof

An assignment that does not preserve order contains an inversion: after relabeling, x<xx<x' are matched to y>yy'>y. Set d=yy>0d=y'-y>0 and

D(s)=h(s)h(sd)d.D(s)=\frac{h(s)-h(s-d)}{d}.

Strict convexity makes DD strictly increasing. Therefore

h(xy)+h(xy)h(xy)h(xy)=d(D(xy)D(xy)). h(x-y')+h(x'-y)-h(x-y)-h(x'-y') =d\bigl(D(x'-y)-D(x-y)\bigr).

This quantity is positive because xy<xyx-y<x'-y. Swapping the inverted targets strictly lowers the cost. Repeating the exchange eliminates every inversion; the only order-preserving bijection between the sorted clouds pairs equal ranks.

For convex but not strictly convex hh, the same exchange inequality is non-strict. Equal-rank matching remains optimal, but other optimizers may coexist. Choose sorting permutations σX,σY\sigma_X,\sigma_Y such that

xσX(1)xσX(2)andyσY(1)yσY(2),x_{\sigma_X(1)} \leq x_{\sigma_X(2)} \leq \cdots \qquad\text{and}\qquad y_{\sigma_Y(1)} \leq y_{\sigma_Y(2)} \leq \cdots,

and then map xσX(k)x_{\sigma_X(k)} to yσY(k)y_{\sigma_Y(k)}. Equivalently, an optimal transport is σ=σYσX1\sigma=\sigma_Y\circ\sigma_X^{-1}. Comparison sorting costs O(nlogn)O(n\log n) in the worst case with mergesort or heapsort; quicksort has this complexity only in expectation.

Concave Costs on the Line

Concavity reverses the exchange preference: one long and one short displacement can cost less than two displacements of intermediate length. Thus costs c(x,y)=g(xy)c(x,y)=g(|x-y|) with gg strictly concave and nondecreasing, such as g(r)=rpg(r)=r^p for 0<p<10<p<1, favor nested or crossing assignments rather than equal ranks. This is the regime studied by Gangbo and McCann Gangbo & McCann, 1996.

For a source point, its right neighbor is the nearest target to its right such that the intervening open interval contains equally many sources and targets; left neighbors and target-to-source neighbors are defined symmetrically. Iterating this balanced-neighbor relation partitions a unit-mass problem into independent alternating chains. On a chain

p1<q1<p2<q2<<pN<qN,p_1<q_1<p_2<q_2<\cdots<p_N<q_N,

with the opposite orientation handled by exchanging pp and qq, the local indicators are

Ikp(i)=c(pi,qi+k)+r=0k1c(pi+r+1,qi+r)r=0kc(pi+r,qi+r),I_k^p(i) =c(p_i,q_{i+k}) +\sum_{r=0}^{k-1}c(p_{i+r+1},q_{i+r}) -\sum_{r=0}^{k}c(p_{i+r},q_{i+r}),

and

Ikq(i)=c(pi+k+1,qi)+r=1kc(pi+r,qi+r)r=0kc(pi+r+1,qi+r).I_k^q(i) =c(p_{i+k+1},q_i) +\sum_{r=1}^{k}c(p_{i+r},q_{i+r}) -\sum_{r=0}^{k}c(p_{i+r+1},q_{i+r}).

After the relevant lower-order indicators have been found nonnegative, a negative Ikp(i)I_k^p(i) certifies pi+rqi+r1p_{i+r}\leftrightarrow q_{i+r-1}, while a negative Ikq(i)I_k^q(i) certifies pi+rqi+rp_{i+r}\leftrightarrow q_{i+r}, for r=1,,kr=1,\ldots,k. Recursively removing certified blocks gives an exact O(n2)O(n^2) algorithm for equal unit masses; the extension to arbitrary real masses has a larger O(n3)O(n^3) worst-case bound Delon et al., 2012. Repeatedly matching the closest red-blue pair is a simpler heuristic, with quantitative guarantees for g(r)=rpg(r)=r^p when 0<p<1/20<p<1/2 Ottolini & Steinerberger, 2025.

Figure Div contrasts this alternating-chain behavior with monotone rank matching for a convex cost, first on unimodal clouds and then on multimodal clouds.

<IPython.core.display.Image object>

One-dimensional assignments for ordered source and target clouds with costs cp(x,y)=xypc_p(x,y)=|x-y|^p. The top row uses single-Gaussian source and target clouds; the bottom row uses a denser two-component source and three-component target. For the convex quadratic cost, equal ranks are matched and the segments do not cross. For the concave cost, the optimum creates long crossing exchanges; the ordered line remains useful, but through the alternating-chain structure of concave transport rather than through monotone rearrangement.

Interactive panel. Use the sliders to change the two cost exponents and see how convex costs preserve sorted, non-crossing matches while concave costs favor longer crossing exchanges.

The next figure shows the monotone case more explicitly. The red and blue curves are smooth laws used to generate equal-weight empirical measures; the dots are inverse-CDF samples at common quantile levels. The monotone assignment connects equal ranks.

Figure Div isolates the rank-matching mechanism for both unimodal and multimodal laws: sampling the two quantile functions at the same levels produces the non-crossing optimal assignment.

<IPython.core.display.Image object>

One-dimensional optimal matching by quantile sorting. The red and blue curves are smooth laws used to generate equal-weight empirical measures; the dots are inverse-CDF samples at common quantile levels. The monotone assignment connects equal ranks, both for two Gaussian mixtures and for the transport from one central Gaussian toward a three-mode target law.

The interactive panel exposes the point count and the two laws while keeping the monotone equal-rank construction in the background.

<Figure size 700x300 with 1 Axes>

Interactive panel. Use the point-count slider and the source/target menus to redraw the one-dimensional monotone assignment. The dots move, but the rule remains equal-rank matching after sorting.

Histogram Equalization

If ϕ:RR\phi:\RR\to\RR is strictly increasing and h:R+Rh:\RR_+\to\RR is convex and nondecreasing, sorting also solves the problem with cost h(ϕ(x)ϕ(y))h(|\phi(x)-\phi(y)|). A typical application is grayscale histogram equalization. For equal-size samples with distinct ranks, monotone rearrangement gives the exact assignment to a prescribed target histogram. Repeated intensities require consistent tie-breaking or mass splitting, but the quantile construction remains canonical. It matches intensity distributions rather than spatial pixel locations.

Figure Div applies this construction to image intensities and shows simultaneously the interpolated images and the monotone evolution of their histograms.

<IPython.core.display.Image object>

Histogram equalization as one-dimensional Monge transport on pixel intensities. The map is the monotone rearrangement T=QβFαT=Q_\beta\circ F_\alpha; here β\beta is a truncated Gaussian concentrated near dark intensities. The images are interpolated pointwise by It=(1t)I+tT(I)I_t=(1-t)I+tT(I), and all histograms share the same vertical scale.

The interactive view below exposes the target mean, target standard deviation, and interpolation time.

<Figure size 820x320 with 2 Axes>

Interactive panel. Use the mean, standard-deviation, and time sliders to move the target intensity law and follow the resulting image equalization and histogram deformation.

Flat Directions for the Linear Cost

Strict convexity makes every optimizer increasing and, for distinct points, unique. For a merely convex cost such as xy|x-y|, non-increasing optimal assignments can coexist. The next example exhibits a genuine flat direction of the linear cost.

Optimal Transport on the Circle

The sorting rule on the line has a periodic analogue. Identify the circle with S1=R/Z\mathbb S^1=\RR/\mathbb Z, let

dS1(x,y):=minkZxy+k,cp(x,y):=dS1(x,y)p,p>1.d_{\mathbb S^1}(x,y):=\min_{k\in\mathbb Z}|x-y+k|, \qquad c_p(x,y):=d_{\mathbb S^1}(x,y)^p, \qquad p>1.

The only extra datum, compared with the line, is where one opens the circle. Once a cut has been chosen, the circle is unfolded into an interval and the one-dimensional monotone assignment can be used. In the discrete case, changing the cut is the same as applying a cyclic shift to one of the two circular orderings.

Proof

Fix an optimal assignment and let γi\gamma_i be an open shortest arc from xix_i to its matched target, choosing either orientation for an antipodal pair. The path-uncrossing lemma of Delon, Rabin, and Gousseau says that if two arcs of an optimal assignment intersect, then they have the same orientation and neither is strictly contained in the other Rabin et al., 2011. Indeed, opposite orientations or strict containment would allow a two-edge exchange that is strictly cheaper by monotonicity and strict convexity of rrpr\mapsto r^p.

Suppose that the arcs cover the circle. Because they are open, every source lies in another transport arc. Ordering the sources cyclically and applying the path-uncrossing lemma propagates a common orientation: either each forward neighbor lies in the preceding arc, or the analogous statement holds backward. Cyclically reassigning the targets in that orientation then shortens every arc, contradicting optimality. Hence a point θ\theta lies outside their union.

Cut at θ\theta and lift the circle to (θ,θ+1)(\theta,\theta+1). Each matched geodesic avoids the cut, so its circular length is the ordinary distance between its lifted endpoints. The monotone matching proposition on the line implies that the lifted assignment preserves order. An order-preserving bijection between two cyclically ordered finite sets is a cyclic shift. Minimizing over the nn shifts therefore recovers the optimum. The argument and its extensions to convex costs and nonuniform masses are developed in Rabin et al., 2011Delon et al., 2010.

Figure Div shows how the selected cut turns the circular assignment into an ordinary ordered matching on an interval.

<IPython.core.display.Image object>

Optimal transport on the circle by cutting and unfolding. Purple segments show the optimal matching and the green radius marks the chosen cut. The red and blue atoms live on two copies of the circle; the denser point clouds make the cyclic ordering visible. Once the circle is opened at this angle, the same matching appears as a monotone one-dimensional assignment on the interval, with the two green endpoints identified.

Interactive panel. Use the number of points, exponent, and shift controls to open the circle at different cuts and compare the induced cyclic assignments.

Figure Div returns to planar assignments and shows that, even for fixed point clouds, changing the exponent of the Euclidean cost can reorganize the optimal permutation globally.

<IPython.core.display.Image object>

Optimal assignments between the same two point clouds for four powers of the Euclidean distance. The source atoms are semi-regular samples in a central disk, while the target atoms are semi-regular samples on a thin annulus; this canonical geometry is reused in later coupling and regularization figures. The feasible set is unchanged, but changing pp changes the global organization of the permutation: the concave case p=1/2p=1/2 penalizes long edges only sublinearly and therefore permits longer exchanges, whereas larger powers increasingly suppress the longest edges.

The interactive panel reuses the same disk-to-annulus geometry and exposes the number of points, the data geometry, and the cost exponents pp in c(x,y)=xypc(x,y)=\norm{x-y}^p.

<Figure size 915x345 with 3 Axes>

Interactive panel. Use the exponent sliders to compare how different powers of the distance reshape the same two-dimensional assignment problem.

Two-Dimensional Assignments

Sorting no longer orders a planar cloud, but a simple local exchange still rules out proper crossings for the Euclidean-distance cost. This observation, already present in Monge’s geometric reasoning, is necessary but far from sufficient for computing an optimum.

Proof

Suppose that [xi,yσ(i)][x_i,y_{\sigma(i)}] and [xj,yσ(j)][x_j,y_{\sigma(j)}] cross properly at zz. The triangle inequality along the two reconnected paths gives

xiyσ(j)xiz+zyσ(j),\norm{x_i-y_{\sigma(j)}} \leq \norm{x_i-z}+\norm{z-y_{\sigma(j)}},

and the analogous inequality after exchanging ii and jj. The sum of the right-hand sides is the cost of the two original segments. At least one inequality is strict because the crossing is non-collinear. Swapping the two targets therefore strictly decreases the cost, a contradiction. Collinear overlaps are excluded because the exchange can then have equal cost.

This property alone is not enough to lead to an efficient algorithm. Non-crossing is only a necessary local test, not a compact certificate of optimality. For instance, if nn sources and nn targets are placed alternately on the boundary of a convex polygon, the number of non-crossing perfect matchings is the Catalan number

Cn=1n+1(2nn)4nπn3/2.C_n=\frac{1}{n+1}\binom{2n}{n} \sim \frac{4^n}{\sqrt{\pi}n^{3/2}}.

Thus even after forbidding proper crossings, exhaustive search remains exponential. The two-segment swap explains why a transverse crossing cannot be optimal, but it does not select among the exponentially many planar matchings that survive this local test.

After sorting, direct enumeration costs O(n2)O(n^2). Faster methods exploit the convex dependence of the circular transport cost on a continuous shift parameter for weighted histograms Delon et al., 2010.

Hungarian Algorithm

We now present a first algorithm for solving the optimal matching problem. The Hungarian method Kuhn, 1955Burkard et al., 2009 provides a gentle, self-contained preview of duality: it computes a permutation together with a certificate of its optimality. The auction algorithm Bertsekas, 1981Bertsekas, 1992 is postponed to Section Auction Algorithm, after discrete duality and the semi-dual formulation have been fully developed.

Hungarian Primal-Dual Method

The method constructs an assignment and its optimality certificate simultaneously. Its derivation below uses only the elementary lower bound derived next; Section Discrete Dual later embeds this certificate in general discrete Kantorovich duality.

The factor 1/n1/n in the assignment objective does not affect its optimizer, so consider the unnormalized dual problem

max(f,g)Rn×Rni=1nfi+j=1ngjsubject tofi+gjCi,ji,j.\max_{(\fD,\gD)\in\RR^n\times\RR^n} \sum_{i=1}^n\fD_i+\sum_{j=1}^n\gD_j \qquad\text{subject to}\qquad \fD_i+\gD_j\leq\C_{i,j}\quad\forall i,j.

The certificate used by both Hungarian and auction methods is worth isolating.

Proof

Dual feasibility gives Ci,τ(i)fi+gτ(i)\C_{i,\tau(i)}\geq\fD_i+\gD_{\tau(i)} for every ii. Summing and using that τ\tau permutes the target indices yields

iCi,τ(i)ifi+igτ(i)=ifi+jgj.\sum_i\C_{i,\tau(i)} \geq \sum_i\fD_i+\sum_i\gD_{\tau(i)} = \sum_i\fD_i+\sum_j\gD_j.

If all edges selected by σ\sigma are tight, its assignment cost equals the dual value of (f,g)(\fD,\gD). The lower bound shows that no permutation has smaller cost. Applied to σ\sigma and any other feasible dual pair, it also shows that no feasible dual value can exceed this cost. Conversely, the difference is the sum of the nonnegative slacks Ci,σ(i)figσ(i)\C_{i,\sigma(i)}-\fD_i-\gD_{\sigma(i)}, and it vanishes exactly when every one of these slacks vanishes.

This is exactly the uniform-mass specialization of the discrete Kantorovich dual (2), multiplied by nn.

The method maintains feasible potentials and a partial matching MM, meaning a set of source--target pairs in which no vertex occurs twice. Its slack, or reduced cost, is

si,j=Ci,jfigj0.s_{i,j}=\C_{i,j}-\fD_i-\gD_j\geq0.

The equality graph consists precisely of the zero-slack edges,

E(f,g)={(i,j):si,j=0}={(i,j):fi+gj=Ci,j}.E(\fD,\gD)=\{(i,j):s_{i,j}=0\} =\{(i,j):\fD_i+\gD_j=\C_{i,j}\}.

The invariant ME(f,g)M\subset E(\fD,\gD) means that every matched pair already saturates its dual constraint. If MM is perfect, Proposition Proposition: Dual Certificate for an Assignment certifies that its associated permutation is optimal. It remains to enlarge MM while preserving dual feasibility and ME(f,g)M\subset E(\fD,\gD).

To increase the matching, choose an unmatched source i0i_0. Starting from that root, grow a tree in the bipartite equality graph. From a reached source, follow a zero-slack edge to a new target; from a reached target that is already matched, follow its unique matched edge back to a source. The tree edges therefore alternate between unmatched and matched edges, which explains the term alternating tree. Write p(j)p(j) for the source preceding a reached target jj, and q(i)q(i) for the matched target preceding a reached non-root source ii. If the tree reaches an unmatched target, these pointers form an augmenting path. Exchanging matched and unmatched edges along this path increases M|M| by one.

Let SS and TT denote the reached source and target sets, and let NE(S)={j:iS, (i,j)E(f,g)}N_E(S)=\{j:\exists i\in S,\ (i,j)\in E(\fD,\gD)\}. If no equality edge leaves SS toward an unreached target, shift the potentials by the smallest such slack:

δ=miniS, jT(Ci,jfigj),fifi+δ (iS),gjgjδ (jT).\delta=\min_{i\in S,\ j\notin T} \bigl(\C_{i,j}-\fD_i-\gD_j\bigr), \qquad \fD_i\leftarrow\fD_i+\delta\ (i\in S), \qquad \gD_j\leftarrow\gD_j-\delta\ (j\in T).

Here δ>0\delta>0 because no edge from SS to TcT^c is currently tight. The update leaves slacks unchanged on S×TS\times T, decreases them by δ\delta on S×TcS\times T^c, and increases them on Sc×TS^c\times T. Feasibility and existing tree edges are preserved, while at least one new equality edge appears from SS to TcT^c. Since S=T+1|S|=|T|+1 before a free target is reached, the dual objective increases by δ(ST)=δ\delta(|S|-|T|)=\delta.

A cubic implementation stores, for every unreached target,

j=miniSsi,j\ell_j=\min_{i\in S}s_{i,j}

and a parent source p(j)p(j) attaining the minimum. When a source ii' enters SS, each unreached target is updated by comparing j\ell_j with the single new slack si,js_{i',j}. A dual shift uses δ=minjTj\delta=\min_{j\notin T}\ell_j and replaces j\ell_j by jδ\ell_j-\delta for jTj\notin T. A tree expansion therefore costs O(n)O(n) rather than requiring a rescan of S×TcS\times T^c.

Hungarian and auction methods use the same dual potentials and reduced costs in different ways. Hungarian grows an exact zero-slack augmenting tree, whereas the auction method in Section Auction Algorithm uses ϵ\epsilon-relaxed contacts, price bids, and ownership changes. Figure Div shows the Hungarian mechanism on the same planar clouds as Figure Div: thick violet edges form the current matching, while faint edges indicate unmatched pairs whose reduced costs are closest to zero.

<IPython.core.display.Image object>

Growth of the Hungarian matching on the planar point clouds of Figure Div. Thick violet segments show the partial matching, whose cardinality M|M| is reported in each panel. Thin translucent segments show the 2n2n lowest-slack unmatched edges, ranked by si,j=Ci,jfigjs_{i,j}=\C_{i,j}-\fD_i-\gD_j; exact zero-slack candidates are slightly stronger. This overlay summarizes the near-tight dual constraints, while the algorithm selects its next edge only across the current alternating-tree cut. The final thick matching is optimal and all its edges are dual-tight.

Interactive panel. Use the size, jitter, and seed controls to regenerate an assignment instance and inspect the augmentation process. The static book figure above fixes the canonical point clouds and additionally overlays low-slack edges.

Proof

Initialization is dual feasible and the empty matching lies in the equality graph. At the beginning of a phase, the slack initialization gives

j=miniSsi,j=sp(j),j(jT).\ell_j=\min_{i\in S}s_{i,j}=s_{p(j),j} \qquad(j\notin T).

This identity is preserved when a matched source ii' enters SS, because the algorithm compares every j\ell_j with the single new candidate si,js_{i',j}.

Before a free target is reached, every target in TT is matched to a source in SS, while every source in SS except the unmatched root was reached through its matched target. Thus S=T+1|S|=|T|+1, so TT cannot contain every target. Dual feasibility gives

δ=minjTj=miniS,jTsi,j0.\delta=\min_{j\notin T}\ell_j =\min_{i\in S,\,j\notin T}s_{i,j}\geq0.

After the potential update,

si,j+={si,j,(i,j)S×T,si,jδ,(i,j)S×Tc,si,j+δ,(i,j)Sc×T,si,j,(i,j)Sc×Tc.s_{i,j}^{+}= \begin{cases} s_{i,j},&(i,j)\in S\times T,\\ s_{i,j}-\delta,&(i,j)\in S\times T^c,\\ s_{i,j}+\delta,&(i,j)\in S^c\times T,\\ s_{i,j},&(i,j)\in S^c\times T^c. \end{cases}

All slacks remain nonnegative. For jTj\notin T, both the slacks from SS and j\ell_j decrease by δ\delta, so the maintained-minimum identity remains valid. At least one j\ell_j becomes zero, and p(j)p(j) supplies the corresponding equality edge. Every matched edge remains tight.

Each inner iteration adds a new target to TT. It either reaches a free target or adds that target’s matched source to SS and updates the slack array. Hence a phase reaches a free target after at most nn iterations. The pointers pp and qq trace an alternating path; flipping it preserves the matching property, increases M|M| by one, and uses only equality edges. Starting from the empty matching, exactly nn phases produce a perfect matching.

At termination every matched edge is tight, so Proposition Proposition: Dual Certificate for an Assignment directly proves that σ\sigma is optimal and the returned potentials are dual optimal. This is the finite assignment instance of the complementary-slackness mechanism proved in general in Proposition Proposition: Discrete Complementary Slackness. Initializing the slack array costs O(n)O(n). Each inner iteration scans at most nn targets to find δ\delta, update the slacks, and compare them with one newly reached source row. It therefore costs O(n)O(n), giving O(n2)O(n^2) per phase and O(n3)O(n^3) overall. The cost matrix requires O(n2)O(n^2) storage, while the matching, reached sets, parent arrays, and slacks require only O(n)O(n) additional storage.

The chapter has exposed two complementary routes to finite matching: geometry can reduce the problem to sorting, while primal-dual potentials give a global certificate for an arbitrary cost matrix. The next chapter passes from finite permutations to transport maps between general measures.

References
  1. Kuhn, H. W. (1955). The Hungarian Method for the Assignment Problem. Naval Research Logistics Quarterly, 2(1–2), 83–97. 10.1002/nav.3800020109
  2. Bertsekas, D. P. (1992). Auction algorithms for network flow problems: a tutorial introduction. Computational Optimization and Applications, 1(1), 7–66.
  3. Gangbo, W., & McCann, R. J. (1996). The geometry of optimal transportation. Acta Mathematica, 177(2), 113–161.
  4. Delon, J., Salomon, J., & Sobolevski, A. (2012). Local matching indicators for transport problems with concave costs. SIAM Journal on Discrete Mathematics, 26(2), 801–827. 10.1137/110823304
  5. Ottolini, A., & Steinerberger, S. (2025). Greedy Matching in Optimal Transport with Concave Cost. Annales Fennici Mathematici, 50(2), 549–562. 10.54330/afm.173113
  6. Rabin, J., Delon, J., & Gousseau, Y. (2011). Transportation Distances on the Circle. Journal of Mathematical Imaging and Vision, 41(1–2), 147–167. 10.1007/s10851-011-0284-0
  7. Delon, J., Salomon, J., & Sobolevski, A. (2010). Fast transport optimization for Monge costs on the circle. SIAM Journal on Applied Mathematics, 70(7), 2239–2258. 10.1137/090772708
  8. Burkard, R., Dell’Amico, M., & Martello, S. (2009). Assignment problems. Society for Industrial.
  9. Bertsekas, D. P. (1981). A new algorithm for the assignment problem. Mathematical Programming, 21(1), 152–171.