---
title: 'Localized Cost Functions: Theory & Applications'
url: https://www.emergentmind.com/topics/localized-cost-functions
type: topic
---

# Localized Cost Functions: Theory & Applications

Searching arXiv for the cited papers to ground the article in current records.
Localized cost functions are objective constructions in which cost evaluation, optimization, or consistency enforcement is restricted to a subset of variables, coordinates, orbitals, or samples rather than being expressed only as a single globally coupled term. In the literature considered here, the notion appears in at least four technically distinct forms: distributed convex optimization with local domains, global cost functions in cost function networks under local transformations, selectively localized spread functionals for Wannier orbitals, and sample-wise local regression objectives coupled by graph regularization [1305.1885] [1502.02414] [1407.5124] [1603.06743]. The common theme is not a single formalism but a recurring design principle: exploit structure that is intrinsically local while still solving a global optimization or inference problem.

## 1. Conceptual scope and formal uses

In distributed optimization, locality is defined by a family of index sets \(S_p \subseteq \{1,\dots,n\}\), one per node \(p\), so that each local function \(f_p\) depends only on \(x_{S_p}\). The resulting problem is
\[
\min_x \sum_{p=1}^P f_p(x_{S_p}),
\]
with \(x \in \mathbb{R}^n\), and is explicitly described as a “localized” or “partial-variable” optimization problem [1305.1885].

In cost function networks, the relevant object is a global cost function: a mapping assigning an integer cost to every assignment of an unbounded set of variables. Locality enters through scope-restricted cost functions \(W_S\), unary costs, and Equivalence Preserving Transformations (EPTs), which shift cost between a scope \(S_1\) and a sub-scope \(S_2 \subset S_1\) without changing the cost of any full assignment [1502.02414].

In electronic-structure theory, localization refers to the spread functional of Wannier functions. The standard Marzari–Vanderbilt spread \(\Omega_{MV}\) is replaced by a selectively localized functional \(\Omega_{SL}\) that minimizes spread only for a chosen subset \(J' < J\) of “objective Wannier functions,” while the remaining functions are left as spectators [1407.5124].

In high-dimensional regression, the “localized Lasso” assigns a distinct coefficient vector \(w_i \in \mathbb{R}^d\) to each sample \(i\). Its objective combines per-sample squared loss, sample-wise network regularization, and sample-wise exclusive group sparsity:
\[
\min_W \sum_{i=1}^n (y_i-w_i^\top x_i)^2
+\lambda_1 \sum_{i<j} r_{ij}\|w_i-w_j\|_2
+\lambda_2 \sum_{i=1}^n \|w_i\|_1^2.
\]
Here locality is sample-indexed rather than coordinate-indexed [1603.06743].

A plausible implication is that “localized cost function” is best understood as a family resemblance term. Across these domains, locality may refer to restricted scope, restricted transformation, restricted orbital subset, or restricted sample-specific parametrization.

## 2. Partial-variable objectives in distributed optimization

The distributed optimization formulation of "Distributed Optimization With Local Domains: Applications in MPC and Network Flows" begins with a connected communication graph \(\mathcal{G}=(\mathcal{V},\mathcal{E})\), \(|\mathcal{V}|=P\), and local functions \(f_p:\mathbb{R}^{|S_p|}\to\mathbb{R}\cup\{+\infty\}\) that are closed, proper, convex, and known only to node \(p\) [1305.1885]. The assumption \(\bigcap_p S_p=\varnothing\) excludes the case in which every node depends on the same coordinate. Because each \(f_p\) depends only on some components of \(x\), each node is interested only in some components of the optimizer \(x^\star\), not the entire vector.

For each coordinate \(\ell\), the paper defines
\[
\mathcal{V}_\ell=\{p\in\mathcal{V}:\ell\in S_p\},
\]
and the induced subgraph \(\mathcal{G}_\ell=(\mathcal{V}_\ell,\mathcal{E}_\ell)\). A coordinate is called connected if \(\mathcal{G}_\ell\) is connected and non-connected otherwise. This coordinate-wise notion of locality governs both storage and communication: node \(p\) stores its private function \(f_p\), its index set \(S_p\), and estimates \(x_\ell^{(p)}\) for \(\ell\in S_p\); at each iteration it sends neighbor \(j\) only those components for which \(\ell \in S_p \cap S_j\). The paper’s communication model is therefore not based on broadcasting the full decision vector, but on exchanging only shared coordinates.

The connected-variable case is rewritten by introducing local copies \(x_\ell^{(p)}\) and enforcing equality along edges of each \(\mathcal{G}_\ell\):
\[
\min_{\{x_\ell^{(p)}\}} \sum_p f_p(x_{S_p}^{(p)})
\quad
\text{subject to }
x_\ell^{(i)}=x_\ell^{(j)},
\ \forall (i,j)\in\mathcal{E}_\ell,\ \ell=1,\dots,n.
\]
A proper coloring of \(\mathcal{G}\) partitions the nodes into color classes \(\mathcal{C}_1,\dots,\mathcal{C}_C\), after which the reformulation becomes suitable for Extended ADMM. With condensed dual variables \(\gamma_\ell^{(p),k}\), each color class updates in parallel, computes
\[
v_\ell^{(p),k}
\leftarrow
\gamma_\ell^{(p),k}
-\rho \sum_{j\in \mathcal{N}_p\cap \mathcal{V}_\ell,\ \mathrm{color}(j)<c} x_\ell^{(j),k+1}
-\rho \sum_{j\in \mathcal{N}_p\cap \mathcal{V}_\ell,\ \mathrm{color}(j)>c} x_\ell^{(j),k},
\]
solves
\[
x_{S_p}^{(p),k+1}
=
\arg\min_{z\in\mathbb{R}^{|S_p|}}
f_p(z)
+\sum_{\ell\in S_p}
\left[
(v_\ell^{(p),k})^\top z_\ell
+\frac{\rho}{2}D_{p,\ell}\|z_\ell\|^2
\right],
\]
and then exchanges the updated coordinate copies with neighbors. After all colors update, the dual step is
\[
\gamma_\ell^{(p),k+1}
\leftarrow
\gamma_\ell^{(p),k}
+\rho \sum_{j\in \mathcal{N}_p\cap \mathcal{V}_\ell}
\bigl(x_\ell^{(p),k+1}-x_\ell^{(j),k+1}\bigr).
\]

For non-connected variables, the method introduces Steiner paths by solving a centralized minimum-Steiner-tree problem with terminals \(\mathcal{V}_\ell\), producing an augmented induced subgraph \(\mathcal{G}_\ell'\). The same color-ADMM scheme is then applied on enlarged local domains \(S_p' = S_p \cup \{\ell \mid p \text{ is Steiner for } \ell\}\). For Steiner nodes, the corresponding coordinate update reduces to a simple quadratic and has closed form because \(f_p\) does not depend on that coordinate.

The convergence theorem states that, under the standing convexity assumptions and assuming either \(C=2\) or strong convexity of each group-cost \(\sum_{p\in \mathcal{C}_c} f_p\), the Extended ADMM scheme converges to a primal–dual solution. Communication complexity is described in terms of locality: per iteration each node \(p\) sends \(|S_p|\) real numbers to each neighbor in \(\mathcal{N}_p\), only for shared coordinates, so one ADMM iteration costs \(\sum_p |S_p|\) scalar transmissions. In the reported experiments, the algorithm required fewer communications to converge than prior distributed methods.

## 3. Local transformations and tractability in cost function networks

The theory developed in "Tractability and Decompositions of Global Cost Functions" places locality at the level of cost scope and cost movement rather than distributed communication [1502.02414]. A Cost Function Network is \((X,W,\top)\), where \(X=\{x_1,\dots,x_n\}\) is a set of discrete variables with domains \(D(x_i)\), and \(W\) contains a zero-arity constant \(W_\emptyset\), unary costs \(W_i(x_i)\), and higher-arity cost functions \(W_S:D^S\to[0,\dots,\top]\). The cost of a full assignment \(\ell\in D^X\) is
\[
\mathrm{cost}(\ell)=\bigoplus_{W_S\in W} W_S(\ell[S]),
\]
with \(([0,\dots,\top],\oplus,\le)\) defined by \(a\oplus b=\min(\top,a+b)\).

Locality is operationalized through EPTs. An \(r\)-EPT shifts cost between a larger scope \(S_1\) and a sub-scope \(S_2\subset S_1\) with \(|S_2|=r\), while preserving the cost of every complete assignment. In the Project operation, for a tuple \(\ell\in D^{S_2}\) and shift amount \(\alpha\) satisfying
\[
-W_{S_2}(\ell) \le \alpha \le
\min_{\ell' \in D^{S_1}:\,\ell'[S_2]=\ell} W_{S_1}(\ell'),
\]
one updates
\[
W_{S_2}(\ell)\leftarrow W_{S_2}(\ell)\oplus \alpha,
\]
and
\[
W_{S_1}(\ell')\leftarrow W_{S_1}(\ell')\ominus \alpha
\]
for every \(\ell'\) extending \(\ell\), where \(a\ominus b = a-b\) if \(a\neq \top\), else \(\top\).

The central question is tractable projection-safety. A global cost function \(F\) is tractable if minimizing \(F\) can be done in polynomial time, and it is tractable \(r\)-projection-safe if it remains tractable after any sequence of \(r\)-EPTs. The paper gives a sharp dependence on \(r\). Any tractable global cost function is \(0\)-projection-safe. If \(F\) is tractable and returns only finite costs, then for any \(r\ge 2\), \(F\) is not \(r\)-projection-safe unless \(P=NP\). The case \(r=1\) is explicitly identified as borderline: some tractable global cost functions remain tractable after unary EPTs, others do not.

The positive side of the \(r=1\) boundary is represented by flow-based global cost functions such as soft AllDifferent variable-based and soft GCC, which remain flow-based after unary EPTs and therefore are tractable \(1\)-projection-safe. The negative side is illustrated by a cost function \(W_{2SAT}\) encoding Max-2-SAT: minimizing \(F\) is polynomial, but \(1\)-extensions can encode Weighted-SAT with weight limit \(k\), which is NP-complete. Local cost movement is therefore not innocuous; its tractability depends decisively on the arity of the scope onto which cost is projected.

Two structural mechanisms preserve tractability. The first is polynomial DAG-filterability. A safe DAG-filter represents a cost function \(W_S\) as a directed acyclic graph whose internal nodes aggregate sub-costs through associative–commutative functions and whose leaves are unary costs. If the graph is polynomial in \(|S|+|D|\) and projections and extensions distribute safely through the DAG, then minimization can be done by bottom-up dynamic programming and tractability is preserved under unary EPTs. The paper provides examples based on soft grammar cost, soft Among cost, soft Regular cost, and \(W_{\mathrm{Max}}(S,f)\), with explicit polynomial complexities.

The second mechanism is decomposition into a Berge-acyclic bounded-arity network. A \(p\)-network-decomposition of \(W_S\) is a polynomial-size CFN over \(X\cup E\) with cost functions of arity at most \(p\) such that
\[
W_S(\ell)=
\min_{\ell' \in D^{X\cup E}:\,\ell'[X]=\ell}
\bigoplus_{W_T\in F} W_T(\ell'[T]).
\]
Under this form, soft local consistencies such as Terminal Directional Arc Consistency (T-DAC*) and Virtual Arc Consistency (VAC) can emulate dynamic programming. The paper proves that, with a suitable variable order, T-DAC* on \(W_S\) yields the same updated unary cost on the last variable as T-DAC* on the full decomposition, and that VAC yields the same lower bound \(W_\emptyset\) on either representation.

A plausible implication is that locality in cost function networks is ambivalent: it can be the source of tractability when confined to unary projections or safe decompositions, but it can also destroy tractability when cost is pushed onto larger scopes.

## 4. Selective localization of spread functionals in Wannier theory

In "Selectively Localized Wannier Functions," localization is not attached to variable subsets in an optimization network, but to the spatial spread of a chosen orbital subspace [1407.5124]. The standard Marzari–Vanderbilt spread functional for \(J\) Wannier functions \(|R\,n\rangle\) is
\[
\Omega_{MV}\equiv \sum_{n=1}^J \left[\langle r^2\rangle_n-\bar r_n^2\right],
\]
with \(\bar r_n = \langle 0n|r|0n\rangle\) and \(\langle r^2\rangle_n=\langle 0n|r^2|0n\rangle\). On a discrete \(k\)-mesh,
\[
\Omega_{MV}=\Omega_{IOD}+\Omega_D,
\]
where
\[
\Omega_{IOD}
=
\frac1N \sum_{n=1}^J \sum_{k,b} w_b\bigl[1-|M_{nn}^{k,b}|^2\bigr],
\]
\[
\Omega_D
=
\frac1N \sum_{n=1}^J \sum_{k,b} w_b
\bigl[\Im\ln M_{nn}^{k,b}+b\cdot \bar r_n\bigr]^2,
\]
and \(M_{mn}^{k,b}=\langle u_{m,k}|u_{n,k+b}\rangle\).

The selectively localized functional restricts the outer summation to a subset \(J'<J\) of “objective Wannier functions”:
\[
\Omega_{SL}
=
\sum_{n=1}^{J'} \left[\langle r^2\rangle_n-\bar r_n^2\right]
=
\Omega_{IOD}^{(J')}+\Omega_D^{(J')}.
\]
Only the objective orbitals are optimized for maximal localization; the remaining \(J-J'\) orbitals are unconstrained spectators. This is a localized cost function in the sense that the spread penalty acts on a designated subfamily of orbitals rather than on the full basis.

The framework then introduces localized constraints. To fix centers \(\bar r_n\) at prescribed positions \(r_{0n}\), the cost is augmented as
\[
\Omega_c=\Omega_{SL}+\lambda_c \sum_{n=1}^{J'} (\bar r_n-r_{0n})^2.
\]
For one-dimensional point-group symmetry about \(x_0\), a further term is added:
\[
\Omega_s
=
\Omega_c
+\lambda_s \sum_{n=1}^{J_s}\int |(1-\sigma_{x_0})w_n(x)|^2\,dx
+\lambda_s \sum_{n=J_s+1}^{J'}\int |(1+\sigma_{x_0})w_n(x)|^2\,dx.
\]
Here \(\sigma_{x_0}\) is reflection about \(x_0\), and the first \(J_s\) objective Wannier functions are chosen to be even while the rest are odd.

Optimization proceeds through infinitesimal unitary rotations \(U^k\to (1+dW^k)U^k\) with \(dW^{k\dagger}=-dW^k\). Writing
\[
d\Omega = \sum_{k,m,n} G_{mn}^k\, dW_{nm}^k,
\]
the gradient \(G^k=\partial \Omega/\partial W^k\) is used in the update
\[
U^k \leftarrow \exp(\epsilon G^k)U^k,
\]
with \(\epsilon=\alpha/(4w)\) in practice, \(w=\sum_b w_b\). The implementation embeds this step in a nonlinear conjugate-gradient line-search scheme and declares convergence when \(\|G\|_{\max}\) falls below a chosen tolerance, for example \(10^{-8}\).

The reported material examples show how selective localization changes the balance between target and spectator orbitals. In GaAs with \(4\) bands and \(J'=1\), MLWF spreads are all approximately \(2.1977\,\text{\AA}^2\); under SLWF the objective spread decreases to \(1.4283\,\text{\AA}^2\) while the remaining three spreads increase to approximately \(3.033\,\text{\AA}^2\); under SLWF+C centered at As the objective spread is approximately \(1.4764\,\text{\AA}^2\). The center ratio \(\beta\) shifts from \(0.618\) for MLWF to \(0.706\) for SLWF and to \(1.0\) for SLWF+C. In SrMnO\(_3\), the reported reductions are small: MLWF \(d\)-spreads are \(e_g\approx 0.5056\) and \(t_{2g}\approx 0.5486\,\text{\AA}^2\), while SLWF gives \(e_g\approx 0.5006\) and \(t_{2g}\approx 0.5467\,\text{\AA}^2\). In Co, the method materially alters the \(d\)-subspace: MLWF \(d\)-spreads are \(e_g\approx 0.5144\) and \(t_{2g}\approx 0.8505\,\text{\AA}^2\), while SLWF gives \(e_g\approx 0.5051\) and \(t_{2g}\approx 0.5615\,\text{\AA}^2\). The paper states that SLWF preserves clean \(t_{2g}\) symmetry and reduces unwanted \(s\) hybridization.

These results show a domain-specific meaning of localization: not decomposition of a sum over local functions, but selective concentration of the cost functional on orbitals of interest, together with optional center and symmetry constraints.

## 5. Sample-wise localized objectives in high-dimensional regression

The localized Lasso introduces one linear model per sample rather than one model per dataset [1603.06743]. For samples \(i=1,\dots,n\), features \(x_i\in\mathbb{R}^d\), responses \(y_i\in\mathbb{R}\), coefficient vectors \(w_i\in\mathbb{R}^d\), and a symmetric nonnegative similarity matrix \(R=[r_{ij}]\) with \(r_{ii}=0\), the objective is
\[
\min_{W=\{w_i\}_{i=1}^n}
\sum_{i=1}^n (y_i-w_i^\top x_i)^2
+\lambda_1\sum_{i<j} r_{ij}\|w_i-w_j\|_2
+\lambda_2\sum_{i=1}^n \|w_i\|_1^2.
\]

Each term has a distinct localized interpretation. The squared loss fits each local linear model to its own sample. The network regularizer \(\lambda_1\sum_{i<j} r_{ij}\|w_i-w_j\|_2\) borrows strength across neighboring samples and induces a soft clustering of local models. The exclusive group-sparsity penalty \(\lambda_2\sum_i \|w_i\|_1^2\), also described as \(\ell_{1,2}\), promotes sparsity within each \(w_i\) while encouraging diversity of supports across samples and avoiding the trivial all-zeros solution.

The objective is convex. The squared loss is convex and smooth, and both \(\|w_i-w_j\|_2\) and \(\|w_i\|_1^2\) are convex though non-smooth. The paper states that the cost function is convex and thus has a globally optimal solution; the solution is unique under strict convexity in the loss term, for example if the \(x_i\) are linearly independent.

Optimization is carried out by an iterative least-squares scheme rather than a generic ADMM. Stacking the coefficients into \(w=\operatorname{vec}(W)\in\mathbb{R}^{nd}\), the method forms at iteration \(t\) two weighting matrices, \(G^{(t)}\) from the network regularizer and \(E^{(t)}\) from the exclusive group-sparsity term, and solves
\[
w^{(t+1)}
=
\bigl(X^\top X+\lambda_1 G^{(t)}+\lambda_2 E^{(t)}\bigr)^{-1}X^\top y,
\]
where \(X\in\mathbb{R}^{n\times (nd)}\) is a suitable block-diagonal design matrix built from the \(x_i\). The paper describes the procedure as simple, efficient, parameter-free, monotonically convergent, and guaranteed to converge to a globally optimal solution. With the Woodbury identity, the cost of the linear solve is \(O(d^3+d\,n^2)\) rather than \((nd)^3\). Forming \(G^{(t)}\) and \(E^{(t)}\) costs \(O(n^2 d)\), so the total per-iteration cost is \(O(d^3+d\,n^2)\), and the total cost is \(O(T(d^3+d\,n^2))\), where \(T\) is the number of iterations to convergence.

The empirical results reported in the paper are explicitly tied to both prediction and interpretability. On synthetic high-dimensional regression with \(30\) samples, \(10\) true features, and \(3\) clusters of \(10\) samples each, Localized Lasso recovers the three true support patterns almost perfectly, while Network Lasso without \(\ell_{1,2}\) is dense and Network Lasso+\(\ell_1\) either fails or shrinks entire models to zero under heavy regularization. The method converges in approximately \(5\) iterations, and runtime scales linearly in \(d\). In personalized medicine using toxicogenomics data with \(53\)-drug activity prediction based on \(1\,100+\) gene expressions, the reported RMSE is approximately \(0.76\), compared with \(1.01\) for Network Lasso, \(0.93\) for Lasso, \(1.25\) for FORMULA, and \(0.84\) for a kernel method; the average number of selected genes is approximately \(60\), compared with approximately \(1060\) for Network Lasso, \(720\) for FORMULA, and \(105\) for Elastic Net. The paper also reports higher Adjusted Rand Index on synthetic convex clustering and real-world clustering benchmarks such as COIL20 and NCII lymphoma gene data.

In this setting, localization is explicitly sample-specific. The model does not merely impose local penalties on a global parameter vector; it instantiates a collection of local sparse models connected by graph regularization.

## 6. Common patterns, distinctions, and recurring misconceptions

Across these four literatures, localized cost functions share a common structural objective: exploit partial dependence while preserving a meaningful notion of global solution. In distributed optimization, the global minimizer is reconstructed from coordinate copies constrained to agree on induced subgraphs [1305.1885]. In cost function networks, local transformations preserve the value of full assignments while potentially changing tractability [1502.02414]. In Wannier theory, a subset of orbitals is designated for localization while the optimization still proceeds over the gauge degrees of freedom of the full subspace [1407.5124]. In localized Lasso, every sample receives its own coefficient vector, but these vectors are tied by a network regularizer and solved jointly in one convex objective [1603.06743].

One recurring misconception is to treat “localized” as synonymous with “approximate” or “heuristic.” The sources do not support that identification. The distributed ADMM method has formal convergence under stated assumptions. The Localized Lasso objective is convex and has a globally optimal solution. In the cost-function-network setting, locality may preserve tractability exactly for \(r=0\) and for some \(r=1\) classes, while for \(r\ge 2\) it can render a previously tractable class non-projection-safe unless \(P=NP\). In the Wannier setting, selective localization is still implemented by an explicit gradient-based variational procedure.

A second misconception is that localization always decreases computational burden without trade-offs. The evidence is more specific. In distributed optimization, communication is reduced because each node exchanges only shared coordinates, and the reported benchmarks show fewer communication rounds than several alternatives. In Wannier optimization, concentrating the spread objective on a subset of orbitals can decrease the spread of those orbitals while increasing the spreads of spectator orbitals, as the GaAs example makes explicit. In cost function networks, local transformations can either preserve or destroy tractability depending on the projection arity. In localized Lasso, interpretability arises from sparse local models, but the optimization still requires repeated solution of a regularized least-squares system.

A plausible implication is that the principal scientific value of localized cost functions lies less in a single canonical definition than in a methodological pattern: identify the part of the model where locality is structurally meaningful, localize the objective or transformation there, and then recover global coherence through consensus constraints, decomposition theorems, variational gauge updates, or coupled convex regularization.

Source: https://www.emergentmind.com/topics/localized-cost-functions