---
title: "(Min,+) Matrix Multiplication"
url: https://www.emergentmind.com/topics/min-matrix-multiplication
type: topic
---

# (Min,+) Matrix Multiplication

\((\min,+)\) matrix multiplication, also called **min-plus**, **distance**, or **tropical matrix multiplication**, replaces ordinary addition by minimization and ordinary multiplication by addition. For compatible matrices \(A\in(\mathbb{R}\cup\{\infty\})^{n\times m}\) and \(B\in(\mathbb{R}\cup\{\infty\})^{m\times d}\), their product \(C=A\star B\) is defined by
\[
C_{ij}=\min_{1\le k\le m}\{A_{ik}+B_{kj}\}.
\]
The operation is matrix multiplication over the tropical semiring \((\mathbb{R}\cup\{\infty\},\min,+)\), whose additive identity is \(\infty\) and multiplicative identity is \(0\). Unlike ordinary matrix multiplication, the intermediate index \(k\) represents a candidate route, and the product selects the least-cost route. This interpretation makes min-plus multiplication a central primitive for shortest paths, while its general algorithmic complexity remains closely tied to the all-pairs shortest-paths (APSP) problem [1708.06552; 1910.04911].

## 1. Algebraic definition and shortest-path interpretation

In the min-plus semiring,
\[
a\oplus b=\min(a,b),\qquad a\otimes b=a+b.
\]
Accordingly,
\[
(A\otimes B)_{ij}
=\bigoplus_k(A_{ik}\otimes B_{kj})
=\min_k(A_{ik}+B_{kj}).
\]
The symbol \(\infty\) denotes an unavailable connection, since \(a+\infty=\infty\), while \(0\) is the multiplicative identity because \(a+0=a\). For square matrices, the usual min-plus power \(A^{\star t}\) represents minimum-weight walks with exactly \(t\) edges.

If \(D\) is the weighted adjacency matrix of a directed graph, with \(D[u,v]=w(u,v)\) for an edge and \(+\infty\) otherwise, then
\[
(D\star D)[u,v]=\min_x\{D[u,x]+D[x,v]\}
\]
is the minimum weight of a two-edge walk from \(u\) to \(v\). Repeated products encode bounded-edge shortest paths, and repeated squaring or related distance-product constructions yield APSP. Conversely, APSP algorithms can be used to compute min-plus products through standard graph reductions. This establishes the fine-grained equivalence between general min-plus product and APSP emphasized in algorithmic work [2110.08782].

The operation is associative:
\[
(A\star B)\star C=A\star(B\star C),
\]
because both sides minimize the same sum over pairs of intermediate indices. A minimizing index \(k\) is called a **witness** for \(C_{ij}\):
\[
C_{ij}=A_{ik}+B_{kj}.
\]
Witnesses identify the intermediate state through which an optimal path passes and are essential in exact algorithms and applications such as sequence alignment and shortest paths.

Min-plus multiplication should be distinguished from the ordinary product
\[
(AB)_{ij}=\sum_k A_{ik}B_{kj}.
\]
Ordinary fast matrix multiplication is nevertheless frequently used as a subroutine. Polynomial encodings, Boolean products, modular arithmetic, and rectangular products can transform restricted min-plus instances into ordinary algebraic products while preserving the exact minimum.

## 2. General complexity and structured algorithmic regimes

The direct algorithm evaluates all triples \((i,k,j)\) and takes \(O(n^3)\) time for square matrices. A truly subcubic algorithm means a running time \(O(n^{3-\eta})\) for a constant \(\eta>0\). General min-plus multiplication is closely connected to APSP and, in the results summarized here, is not treated as having a general unrestricted truly subcubic algorithm.

Several structured input classes admit faster algorithms. These restrictions affect either the numerical variation of matrix entries or the order structure of rows and columns.

**Bounded-difference matrices.** A matrix is \(\delta\)-bounded-difference when adjacent horizontal and vertical entries differ by less than \(\delta\):
\[
|X[i,j]-X[i,j+1]|<\delta,\qquad
|X[i,j]-X[i+1,j]|<\delta.
\]
For constant \(\delta\), local blocks have controlled variation. Recursive block refinement, candidate sets, random normalization, segment decomposition, polynomial encoding, and rectangular ordinary matrix multiplication yield an exact randomized running time of \(O(n^{2.779})\), improving an earlier \(\widetilde O(n^{2.824})\) bound [2110.08782].

**Approximate local rank.** A more general theorem assumes that blocks of one input matrix are close in \(\ell_\infty\) distance to constant-rank integer matrices. If \(B\) is partitioned into blocks of side \(n^\delta\), every block has \(W\)-approximate rank at most \(d=O(1)\), and the entries have polylogarithmic bit complexity, then
\[
A\star B
\]
can be computed in
\[
\widetilde O\!\left(
n^{3-\delta/\lfloor(d+1)/2\rfloor}
+
W^{1/4}n^{(9+\omega)/4}
\right)
\]
time, where \(\omega\) is the ordinary matrix-multiplication exponent. The algorithm combines geometric halfspace queries, additive approximation, sampled normalization, small-weight min-plus products, and final halfspace reporting. Its structure is local: different blocks may have unrelated low-rank representations, and \(A\) may be arbitrary [1910.04911].

**Monotone instances.** If \(B\) is row-monotone, meaning
\[
B_{k,j}\le B_{k,j+1},
\]
and its nonnegative integer entries are bounded by \(O(n)\), while \(A\) is arbitrary, the min-plus product can be computed in expected time
\[
\widetilde O\!\left(n^{(3+\omega)/2}\right)
=\widetilde O(n^{2.687}).
\]
The method recursively refines coarse approximations, uses polynomial matrix multiplication to identify residue-compatible candidates, and removes modular false positives with segment trees. It also applies to column-monotone matrices and to bounded-difference instances after suitable transformations [2204.04500].

The favorable monotonicity orientation is significant. If rows of \(A\) are non-decreasing and columns of \(B\) are non-increasing, arbitrary min-plus products can be encoded by adding \(2kM\) to \(A_{ik}\) and subtracting \(2kM\) from \(B_{kj}\). The added terms cancel in every summand while enforcing the opposite monotonicities. Thus opposite monotonicity alone does not make the problem easier [2309.01136].

## 3. Exact algorithms based on approximation, modular filtering, and witnesses

Many fast algorithms use approximation only as an intermediate device. The final product remains exact.

A typical scaling reduction computes
\[
A'=\left\lfloor A/2\right\rfloor,\qquad
B'=\left\lfloor B/2\right\rfloor
\]
and recursively forms \(C'=A'\star B'\). If \(C=A\star B\), then
\[
2C'_{ij}-2\le C_{ij}\le 2C'_{ij},
\]
so the exact value is one of
\[
2C'_{ij}-2,\qquad 2C'_{ij}-1,\qquad 2C'_{ij}.
\]
An equality or witness verifier tests the candidates. Recursing over the bit length of the entries gives exact multiplication once the verifier is sufficiently efficient [2610.20297].

Modular methods identify candidate witnesses. For a proposed output \(C_{ij}\), one counts indices satisfying
\[
A_{ik}+B_{kj}\equiv C_{ij}\pmod Q.
\]
Polynomial matrix multiplication over a ring such as
\[
\mathbb F[x]/(x^Q-1)
\]
computes these modular counts. A second count excludes matches whose high-order parts are inconsistent. Equality holds exactly when the first count exceeds the second. Monotonicity or block structure then permits the remaining false positives to be enumerated efficiently.

The bounded-difference algorithms use related normalization. After selecting a likely reference index, they form matrices such as
\[
A^r[i,k]=A[i,k]-A[i,r],\qquad
B^r[k,j]=B[k,j]-B[r,j].
\]
The normalization preserves minimizing indices and makes relevant values lie in a restricted range. Polynomial encodings or bounded-weight min-plus subroutines then process only the candidate region.

For approximate local low-rank structure, a block of \(B\) can be represented as
\[
B_{kj}\approx X(k)^{\mathsf T}Y(j),
\]
with additive error at most \(W\). For fixed \(i\), the expression
\[
A_{ik}+X(k)^{\mathsf T}Y(j)
\]
is a linear functional in a constant-dimensional geometric space. Finding its minimum becomes a halfspace emptiness or reporting problem. Sampling removes pairs with many possible witnesses, leaving a subcubic number of candidates for exact correction [1910.04911].

The 2026 thin-matrix approach applies the same approximation-and-verification philosophy without requiring monotonicity or bounded differences. Inner indices are grouped into blocks, and modular tests identify candidate blocks that may contain an exact witness. A thin matrix product theorem computes selected entries of rectangular products whose inner dimension is sufficiently small. The resulting sparse certificate enables deterministic exact multiplication for polynomially bounded integer entries in
\[
\widetilde O(N^{2.9963432})
\]
time, improving the preceding deterministic \(O(N^{2.9995})\) bound [2610.20297].

## 4. Monotonicity, subsequences, and convolution

Monotonicity can be exploited more finely than requiring an entire row or column to be monotone. Suppose every row of \(A\) can be decomposed into at most \(m_1\) position-disjoint monotone subsequences, and every column of \(B\) into at most \(m_2\) subsequences, with all subsequences using the same direction. Then the product can be computed in
\[
O(m_1m_2n^{2.569})
\]
time [2309.01136].

For each pair of subsequences, a Boolean product identifies whether they share an inner index. If both subsequences are non-decreasing, the minimum of
\[
A_{ik}+B_{kj}
\]
over their common indices occurs at the smallest common index. If both are non-increasing, it occurs at the largest common index. Minimum- or maximum-witness computations therefore recover the best candidate for each subsequence pair. The total cost is dominated by \(m_1m_2\) Boolean extreme-witness computations.

The orientation is again essential. Same-direction monotone subsequences support the matrix-product algorithm, whereas opposite monotonicities can encode unrestricted min-plus multiplication. For convolution, the favorable orientation reverses: if one sequence decomposes into non-decreasing subsequences and the other into non-increasing subsequences, min-plus convolution can be computed in
\[
\widetilde O(m_1m_2n^{1.5})
\]
time.

For two sequences,
\[
(A\diamond B)_k=\min_i\{A_i+B_{k-i}\},
\]
monotonicity permits recursive residue refinement and polynomial multiplication. The randomized monotone convolution algorithm achieves \(\widetilde O(n^{1.5})\) time, improving a preceding \(O(n^{1.859})\) bound [2204.04500]. A deterministic version with \(n^{1.5+o(1)}\) time uses the same modular filtering architecture as deterministic monotone matrix multiplication [2605.07150].

The deterministic monotone min-plus product algorithm handles rectangular matrices. If
\[
A\in\mathbb Z^{n^a\times n^b},\qquad
B\in\mathbb Z^{n^b\times n^c},
\]
with row-monotone entries in \([n^\mu]\), its running time is
\[
n^{a+c}+n^{b+c}
+n^{(a+b+\mu+\omega(a,b,c))/2+o(1)}.
\]
For square \([n]\)-bounded matrices this becomes
\[
n^{(\omega+3)/2+o(1)}=O(n^{2.686}).
\]
The result matches the previous randomized exponent while removing the random choice of a prime modulus [2605.07150].

## 5. Monge and core-sparse min-plus multiplication

Monge structure gives a different form of tractability. A matrix \(A\) is Monge if
\[
A[i,j]+A[i+1,j+1]\le A[i,j+1]+A[i+1,j].
\]
Equivalently, its density matrix
\[
A^\square[i,j]
=A[i,j+1]+A[i+1,j]-A[i,j]-A[i+1,j+1]
\]
is entrywise nonnegative.

Monge matrices arise from noncrossing shortest paths in planar graphs. Their min-plus product remains Monge, and the smallest minimizing witnesses are nondecreasing along rows and columns. Consequently, arbitrary \(n\times n\) Monge products can be computed in \(O(n^2)\) time using SMAWK-based methods.

A Monge matrix is **core-sparse** when its density matrix has few nonzero entries. Its core consists of triples
\[
(i,j,A^\square[i,j])
\]
for nonzero density entries. A condensed representation stores the top row, leftmost column, and core, using \(O(p+q+\delta(A))\) space for a \(p\times q\) matrix.

For Monge matrices \(A\), \(B\), and \(C=A\star B\), the core-preservation theorem states
\[
\delta(C)\le 2(\delta(A)+\delta(B)),
\]
and the stronger core-sum inequality is
\[
\Sigma(C)\le\min\{\Sigma(A),\Sigma(B)\}.
\]
Using condensed representations, core-based matrix oracles, compression, divide-and-conquer on the shared dimension, and a monotone staircase of witnesses, the product can be computed in
\[
O\!\left(
n_1+n_3+
(n_2+\delta(M_1)+\delta(M_2))
\log(2+\delta(M_1)+\delta(M_2))
\right)
\]
time. In the square case this is commonly written \(O((n+\delta)\log n)\), where \(\delta=\delta(A)+\delta(B)\) [2408.04613].

The same framework supports smallest-witness recovery in logarithmic time. Applications include simple unit-Monge products, longest increasing subsequence reconstruction, and edit distance with integer weights. Simple unit-Monge matrices model unweighted edit distance, longest common subsequence, and longest increasing subsequence; the core-sparse algorithm extends beyond this special class to arbitrary core-sparse Monge matrices.

## 6. Applications in networks, combinatorics, and algebra

The shortest-path interpretation makes min-plus products natural for graph algorithms. In a graph with nonnegative edge weights, a shortest-path distance matrix \(D\) satisfies
\[
D\star D=D,
\]
because introducing an intermediate vertex cannot improve an already optimal distance. The Kleene star
\[
A^\star=I\oplus A\oplus A^{\otimes2}\oplus\cdots
\]
represents all-pairs shortest-path distances when there is no negatively weighted cycle. A negative cycle prevents the intended finite interpretation because repeated traversal produces arbitrarily low path weights [1708.06552].

Min-plus low-rank approximation applies the operation to network data. For a distance matrix \(D\), an actual-waypoint approximation chooses vertices \(W\) and forms
\[
D_W\star D_W^{T}.
\]
A virtual-waypoint approximation instead optimizes
\[
D\approx A\star A^T,
\]
where the columns of \(A\) represent latent neighborhoods. More generally,
\[
M\approx A\star B
\]
is a two-stage latent network in which each output relation is the least-cost route through an intermediate latent state. The approximation error is measured with the ordinary Frobenius norm even though the factorization uses min-plus multiplication. In the dolphin social-network experiment, truncated SVD had lower error at intermediate ranks, while min-plus factors were more directly interpretable as neighborhoods or waypoints [1708.06552].

Min-plus multiplication also appears in formal algebra. For a permutation \(\alpha\), define the slipface function
\[
s_\alpha(a,b)=\#\{n\ge b:\alpha(n)<a\}.
\]
For finite permutations,
\[
s_{\alpha\star\beta}(a,b)
=
\min_\ell\bigl(s_\alpha(a,\ell)+s_\beta(\ell,b)\bigr),
\]
so the Demazure or \(0\)-Hecke product is represented by
\[
S_{\alpha\star\beta}=S_\alpha\star S_\beta.
\]
This tropical formulation extends the operation to almost-sign-preserving permutations of the integers. The resulting product is associative, monotone in both factors, and compatible with the relevant Bruhat order. The rank-function interpretation also connects min-plus composition with relative positions of flags and with gluing operations in Brill–Noether theory [2206.14227].

Algorithmic applications of structured min-plus products include language edit distance, RNA folding, scored parsing for bounded-difference grammars, optimum stack generation, batched range mode, tree edit distance, approximate APSP, jumbled indexing, and Knapsack. The deterministic monotone-product and convolution results remove randomness from several such downstream algorithms while preserving their stated asymptotic bounds [2204.04500; 2605.07150].

## 7. Recent developments and continuing limitations

Improvements in ordinary rectangular matrix multiplication affect min-plus algorithms whenever the latter reduce structured instances to ordinary products. A 2026 result proves
\[
\omega(1,k,1)\le
\begin{cases}
2,&0\le k\le \frac12,\\[1mm]
1+k+\dfrac{1}{4k},&k\ge\frac12,
\end{cases}
\]
for multiplying an \(n\times n^k\) matrix by an \(n^k\times n\) matrix. In particular,
\[
\omega(1,\tfrac12,1)=2.
\]
Substituting this rectangular curve into an existing deterministic min-plus/APSP framework yields a reported \(O(n^{2.4999})\) bound for directed unweighted APSP. The ordinary rectangular result itself is not a standalone min-plus theorem; the improvement is obtained by composing it with a separate min-plus reduction [2610.10494].

The same distinction applies to structured algorithms generally. A bound for ordinary matrix multiplication, a bound for monotone min-plus multiplication, and a bound for unrestricted min-plus multiplication are different statements. Ordinary products serve as computational subroutines, but the target min-plus output remains an exact minimum unless the problem explicitly concerns approximation.

The principal limitations are structural and arithmetic. Bounded-difference, monotone, approximate-local-rank, and Monge algorithms do not establish a general truly subcubic algorithm for arbitrary real or integer matrices. Several methods require integer entries of bounded magnitude so that residues, prime divisors, and polynomial encodings can be controlled. Constant local rank is essential in the approximate-rank theorem, and excessive approximation error can eliminate its subcubic saving. Core-sparse methods require Monge structure and a small density core.

The general problem therefore remains characterized by a tension between the expressive power of min-plus composition and the absence of a comparably general fast multiplication theory. Structured local variation, monotonicity, witness organization, Monge inequalities, and sparse certificates each expose different mechanisms through which the cubic search over intermediate indices can be reduced. The resulting algorithms cover substantial classes of graph, string, combinatorial, and algebraic problems while leaving unrestricted \((\min,+)\) multiplication and its full APSP consequences as central open algorithmic objectives.

Source: https://www.emergentmind.com/topics/min-matrix-multiplication