---
title: "Computing in Operations Research Using Julia — Lubin 2015"
description: "How Julia combines readable optimization code with fast execution through JuMP, compiled derivatives, and sparse simplex benchmarks."
canonical: "https://research.elamur.ai/free/en/papers/lubin-2015-computing-operations-research-julia/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/lubin-2015-computing-operations-research-julia/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2015](https://md.research.elamur.ai/free/en/papers/2015/) / Computing in Operations Research Using Julia

# Computing in Operations Research Using Julia

Paper · 2015 · Miles Lubin and Iain Dunning

**Authors:** [Miles Lubin](https://md.research.elamur.ai/free/en/authors/miles-lubin/) and [Iain Dunning](https://md.research.elamur.ai/free/en/authors/iain-dunning/) · **Year:** 2015 · **Venue:** INFORMS journal on computing · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**320** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2105198154) · INFORMS journal on computing · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [DOI 10.1287/ijoc.2014.0623](https://doi.org/10.1287/ijoc.2014.0623)
- [arXiv 1312.1431](https://arxiv.org/abs/1312.1431)
- [OpenAlex](https://openalex.org/W2105198154)

## Deep dive: Computing in Operations Research Using Julia

How Julia combines readable optimization code with fast execution through JuMP, compiled derivatives, and sparse simplex benchmarks. · about 33 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

Writing optimization software frequently means choosing between code that is convenient to develop and code that runs quickly. A researcher may describe a problem clearly in a high-level language, then discover that preparing it for a solver takes too long. Alternatively, an algorithm may depend on sparse, irregular loops that cannot be handed off to a convenient numerical library. Miles Lubin and Iain Dunning examine whether Julia can reduce this tradeoff. Their concern is practical: can the same language support readable mathematical descriptions, efficient preparation of optimization problems, and the low-level operations needed inside optimization algorithms?

The paper investigates this question through complementary implementations. JuMP, their Julia package for algebraic optimization, translates mathematical expressions into sparse internal representations. It uses macros, which inspect and transform program syntax, to avoid constructing expressions through a succession of overloaded arithmetic operations. A separate nonlinear prototype builds expression trees, differentiates them symbolically, and compiles functions for evaluating constraint derivatives. To conclude, the authors test Julia’s ability to run explicit loops over sparse data at speeds close to C++ by implementing selected operations of the revised dual simplex method.

The reported results support Julia’s suitability for these particular tasks. In the linear optimization benchmarks, JuMP’s total preparation and file-output time stays within a factor of two of AMPL, while the authors describe a much larger advantage over Python-based alternatives. For nonlinear problems, the prototype reaches performance comparable to AMPL on preparing problems and evaluating their constraint Jacobians. On the largest nonlinear instances, Pyomo takes over 50x as long as Julia. In the simplex-operation benchmarks, Julia remains within a factor of 2 of C++ with explicit array-bounds checks. MATLAB and PyPy are reported within a factor of 4 to 18 of that reference, while ordinary Python is at least 70x slower than C++.

These findings concern particular parts of optimization software, instead of a complete comparison of optimization systems. The nonlinear implementation is a proof of concept, and the simplex study leaves out the specialized factorization and linear-system routines that account for much of a practical solver’s remaining work. The paper also describes JuMP as actively developing and advises against production use at that stage. Its central contribution is therefore both an implementation result and a design argument: access to program syntax, runtime specialization, and careful sparse data structures can let a high-level language perform work that otherwise tends to require a separate low-level implementation.

### Ideas worth borrowing

#### Transform expressions before they create temporary objects

The authors’ most reusable idea is to intercept a mathematical expression while it still exists as syntax. An expression assembled through overloaded multiplication and addition can generate many intermediate objects before reaching its final representation. JuMP instead examines the expression and emits code that builds the representation directly. This approach applies wherever a compact notation must become a structured computational object. The important condition is that the target structure is known well enough to generate construction code more efficiently than ordinary expression evaluation would produce it.

#### Make storage planning part of expression translation

A readable expression can also reveal how much memory its main components will require. JuMP extracts the indexing range of a sum, reserves space for the corresponding entries, and then fills that storage. The benefit comes from using information already present in the expression to reduce repeated allocation. This is useful beyond optimization whenever an input description specifies the size or shape of an output structure. The paper also makes the boundary clear: its implementation does not preallocate every additional term perfectly, so effective storage planning need not require a completely optimal allocator.

#### Separate symbolic structure from runtime values

The nonlinear prototype distinguishes the shape of an expression from the values attached to it during execution. A macro sees operations, names, and indexing expressions before the relevant numerical values are available. It generates code that later inserts constants and variable placeholders into an expression tree. This separation is useful when a program must preserve the meaning of an expression while allowing its data to change. It keeps structural analysis explicit and avoids treating the entire computation as a string that must be interpreted again at runtime.

#### Compile repeated mathematical structure once

The derivative implementation recognizes constraints with equivalent expression trees and performs symbolic differentiation once for each shared form. The variable identities may differ, but the computational pattern can remain the same. That distinction matters in discretized optimization problems, where a local relationship is repeated across an index range. More generally, a system can frequently save preparation work by identifying repeated structure before specializing it to individual values. The paper’s version is deliberately precise: equivalence requires symbolic identity together with a correspondence between the variables involved.

#### Benchmark the operations that dominate the application

The simplex experiments use inputs recorded during actual optimization runs. This matters because sparse computation depends on where non-zero values occur, not merely on array dimensions. A benchmark built from arbitrary dense arrays could miss the behavior the authors wanted to study. The broader lesson is to preserve the structural properties that make an application difficult: changing active subsets, irregular access, sparse vectors, and conditional updates. A language comparison becomes more informative when its workload resembles the code that an engineer would actually need to maintain.

#### Treat performance boundaries as part of the result

The paper distinguishes preparing an optimization problem from solving it, and selected simplex operations from a complete simplex implementation. It also identifies file conversion and compilation costs that enter particular timings. These distinctions are reusable research practices. They make it possible to understand what an improvement changes in a larger system and what remains untested. A fast component can be valuable without supporting an unrestricted claim about the entire application, and the authors’ strongest results are easiest to assess when those boundaries remain visible.

### How Mova uses it

For [Mova](https://md.research.elamur.ai/free/en/projects/mova/), a small transparent language system written in Rust, the paper offers implementation principles rather than a directly transferable optimization package. The connection is strongest where a readable description must become an explicit internal structure. JuMP demonstrates how to preserve a convenient notation while controlling the representation and allocation work underneath it. A comparable design for Mova could keep language-processing rules understandable while translating them into data structures suited to execution.

That is a possible application, rather than an established feature of Mova. The paper does not document Mova, and no specific integration follows from its experiments. In particular, the evidence does not establish that Mova uses JuMP, generates derivatives, or relies on Julia. The useful relationship is architectural: the authors show how a system can expose the structure of a computation before executing it, instead of relying on a long sequence of temporary runtime objects.

One concrete possibility concerns rule preparation. If Mova represents a rule as a structured expression, a preparation stage could inspect its operations, resolve its references, and construct the representation used during execution. The analogy to JuMP would be the movement from readable input to a deliberately chosen internal form. Whether such preparation improves Mova would depend on its actual workload, including how often rules are reused and how much time preparation currently consumes. The optimization timings cannot answer those questions.

Another possibility is to distinguish a rule’s recurring structure from the particular items to which it applies. The nonlinear prototype makes this distinction when it recognizes equivalent constraint expressions with different variable identities. For Mova, an analogous investigation could ask whether several rules or operations share a common computational shape. That could support shared preparation work, but it would require an explicit definition of equivalence appropriate to language processing. Symbolic equivalence between numerical expressions is not automatically the right criterion for linguistic rules.

The paper also suggests a way to investigate efficiency without sacrificing transparency. Its sparse-operation study records realistic inputs and measures recognizable computational components. Mova could similarly measure preparation, lookup, rule application, and result construction separately where those stages exist. Such measurements would reveal whether a proposed representation helps the operations that matter. This would be more informative than inferring performance from the implementation language alone.

The most direct borrowing is therefore a discipline: keep the representation inspectable, make preparation work explicit, reuse structure when its equivalence is justified, and test the resulting operations on representative inputs. Rust and Julia have different implementation arrangements, so the paper’s particular route through just-in-time compilation should remain distinct from these more general ideas. Its evidence supports investigating those ideas in Mova; it does not establish an existing implementation or a measured benefit there.

### The problem and its context

#### Optimization software has several kinds of work

Operations research uses computation both to describe decision problems and to execute the algorithms that solve them. The paper takes linear optimization as a central example. A linear optimization problem chooses variable values to improve a linear objective while respecting linear restrictions. The mathematical statement may be compact, but software must turn it into numerical data, communicate that data to a solver, and carry out the required calculations.

These activities place different demands on a programming language. Describing a problem benefits from concise notation, flexible data manipulation, and a convenient surrounding environment. Implementing an algorithm may require precise control over loops, memory access, and sparse storage. A language that performs one of these jobs well may be awkward for another.

The paper’s wider context is [code and programming languages](https://md.research.elamur.ai/free/en/topics/code-and-programming/), particularly the division between high-level numerical environments and languages traditionally used for high-performance computing. The authors describe Fortran, C, and C++ as established choices for fast numerical software. Their compilation and typing arrangements give compilers opportunities to produce efficient machine code. They also provide enough abstraction to make numerical programming more manageable than writing assembly directly.

Python, MATLAB, and R occupy a different position in the authors’ account. They make scientific work convenient through expressive syntax and broad collections of packages. Their practical success often depends on connecting high-level code to lower-level routines. A short call in a high-level language can trigger a substantial computation implemented elsewhere. This arrangement works well when an application fits the operations that the underlying libraries provide.

The difficulty appears when the computation does not fit those boundaries. A programmer may need to assemble a large optimization problem through many small operations, or implement an irregular sparse loop unavailable in an existing library. In those cases, the high-level layer itself can become expensive. Moving that work into another language may recover speed, but it also divides the implementation across separate environments.

#### Algebraic notation is useful, but building it has a cost

Algebraic modeling languages let programmers describe optimization problems in a form close to their mathematical statements. Variables, sums, objectives, and constraints become recognizable parts of the code. This is more convenient than manually assembling every coefficient and index in the representation expected by a solver.

The authors present AMPL as an important example of a specialized algebraic language. Its advantages include expressiveness and speed. The limitation, in their account, is that it does not supply the full capabilities of a modern general-purpose language. Preparing data, processing results, and integrating optimization into a larger application can therefore be less convenient than working inside a broader programming environment.

Embedded algebraic packages address that limitation by putting optimization notation inside a general-purpose language. The paper discusses Pyomo and PuLP in Python, and YALMIP in MATLAB. These packages allow optimization work to coexist with the rest of an application, but the authors identify a substantial preparation cost. Building the internal sparse representation can take enough time to matter, particularly when an application repeatedly reconstructs optimization problems.

The implementation mechanism helps explain the cost. Operator overloading allows an arithmetic expression to act on optimization variables rather than ordinary numbers. Multiplication can create a term object; addition can combine terms or expressions; later operations can create larger objects. This produces convenient notation, but a large expression may pass through many intermediate representations.

The issue is therefore not that mathematical notation is inherently slow. It is that a particular route from notation to numerical data performs work that the final representation does not require. A specialized language can inspect the whole expression and plan its storage before creating it. The authors ask whether an embedded language can gain similar control without losing its general-purpose setting.

#### Nonlinear expressions make access to syntax more important

Nonlinear optimization adds another layer of preparation. A solver may need function values and derivatives, and the optimization language must supply a representation from which these can be calculated. A sparse list of coefficients is no longer sufficient for a general nonlinear expression.

The paper distinguishes difficulty in preparing a problem from difficulty in solving it. An appropriate solver might exist, yet the algebraic interface could take too long to construct the representation and pass it onward. Alternatively, the problem itself might exceed the practical capabilities of available solution methods. Those are different bottlenecks and require different responses.

The nonlinear study focuses on the preparation bottleneck. It does not claim to make intrinsically difficult optimization problems easy. Instead, it examines whether Julia can support an expressive interface without adding excessive overhead before the solver’s work begins.

The authors connect this question to parser access. When the host language does not expose its expression representation conveniently, an embedded package may reconstruct structure through overloaded operations or parse a separate textual description. Julia offers another route: its syntax is available as structured data, allowing a package to transform expressions directly.

#### Sparse algorithms challenge the usual numerical shortcut

The simplex study addresses a related but distinct problem. High-level numerical code often performs well by handing large vector or matrix operations to optimized libraries. The authors argue that practical simplex implementations do not consist mainly of those convenient dense operations.

Sparse linear algebra is central. Many entries are zero, active subsets change, and performance depends on using those properties rather than processing every possible entry. Some required routines are specialized enough that standard libraries do not supply them. Accordingly, explicit loops remain important.

The paper positions Julia’s just-in-time compiler as a possible bridge across these difficulties. Rather than adding compilation to a language whose design obstructs it, Julia is described as having been designed around both expressiveness and efficient compilation. The authors’ contribution is to test that proposition on optimization software with realistic structural demands, extending beyond the basic language benchmarks previously reported by Julia’s developers.

### The method, step by step

The paper’s method is a sequence of implementation studies built around a common question: can Julia preserve convenient programming abstractions while producing efficient computational structures? The linear study translates algebraic notation into sparse rows. The nonlinear study translates expressions into trees and then into compiled derivative evaluators. The simplex study tests operations that need direct loops over sparse data.

From readable optimization expressions to measured execution The steps in order.

#### Start with syntax that can be inspected

A central language feature is homoiconicity: Julia can represent its own expressions using data structures available within the language. A macro receives such a representation and returns an expression to be compiled. This is a transformation of syntax, instead of a search-and-replace operation on text.

The authors illustrate the distinction with a macro that changes an arithmetic expression’s main operation. The incoming expression has a tree structure: the outer operation has subexpressions as its children. Changing the outer addition into subtraction leaves those subexpressions intact while changing how they are combined.

The numerical example is deliberately simple:

```
2x + y^x = 29
```

Here, x has the value 2 and y has the value 5. Adjacency in 2x indicates multiplication, and the caret denotes exponentiation. The expression therefore combines a product with a power. Its purpose is to make the relationship between visible notation and expression structure concrete.

After the macro replaces the outer operation, the expression becomes:

```
2x − y^x = −21
```

The symbols retain their previous meanings. The macro changes the operation joining the subexpressions, and the resulting expression is subsequently compiled and evaluated. The reported negative result shows that the transformation affects the executed computation, rather than merely producing a displayed representation.

This example also introduces scope. The transformed expression must still refer to the variables in the context where the macro was called. The authors use Julia’s escaping mechanism to preserve that relationship. Without the correct connection to the surrounding program, a structurally valid expression would not necessarily refer to the intended values.

A macro runs during compilation of the relevant expression. In a just-in-time environment, that compilation can happen during program execution, such as on an initial function call. The transformation itself is not repeated every time the compiled operation runs. This distinction becomes important when preparation work produces code that will later be evaluated repeatedly.

#### Express a linear optimization problem naturally

JuMP uses macros to support variable declarations, objectives, and constraints. The paper demonstrates the interface with a knapsack-style problem. Each decision variable is bounded, an objective combines profits with variable values, and a capacity restriction combines weights with those same variables.

The point of the example is the relationship between notation and representation. The programmer writes sums and constraints in a recognizable mathematical form. JuMP then takes responsibility for turning those statements into the sparse structures required for optimization.

The package introduces a sum notation through macros rather than requiring that notation to exist as an ordinary operation in the host language. This illustrates a broader benefit of syntax transformation: an embedded language can offer domain-specific forms while remaining inside a general-purpose language.

The original capacity inequality can be represented as:

```
Σⱼ₌₁ᴺ weight[j]x[j] ≤ capacity
```

N is the number of indexed decision variables. The index j selects a weight and its corresponding variable x[j]. The summation combines their products, and capacity is the upper limit on the resulting total. The expression is linear because each variable is multiplied by a numerical coefficient and the terms are added.

For the implementation explanation, the authors add a slack variable:

```
Σⱼ₌₁ᴺ weight[j]x[j] + s = capacity
```

The symbols retain their previous meanings, and s is the added slack variable. This makes the expression more varied than an isolated sum: the translator must handle both an indexed collection of terms and an additional variable outside that collection.

The internal target is a row representation. Each row contains an array of variable indices and another array holding the associated coefficients. Once the problem is fully described, those rows can be converted into a sparse column-oriented form if required.

This is an important separation of responsibilities. The notation can resemble mathematics, while the representation follows the needs of construction and later solver communication. The user does not have to write directly in terms of arrays of indices and coefficients.

#### Generate construction code instead of intermediate expressions

The constraint macro examines the sum and extracts its indexing information. It can determine the number of terms implied by the range and reserve storage for the corresponding variable references and coefficients. It then generates a loop that appends the terms to an affine-expression object.

An affine expression contains a linear combination together with any constant contribution. In the authors’ implementation, the expression object keeps variable and coefficient arrays. The generated code places the weighted decision variables into those arrays, adds the slack variable, incorporates the constant right-hand side, and creates a constraint with the appropriate equality relation.

The generated operations use multiple dispatch. Julia chooses the relevant method according to the argument types. Adding a numerical coefficient and a variable placeholder differs from processing numerical constants, even though both operations occur while constructing the same expression.

Type inference helps the compiler determine these distinctions efficiently. The programmer’s notation does not need to expose every internal type decision. Instead, the generated code calls operations whose implementations depend on the kinds of values encountered.

The authors are careful about the completeness of their storage optimization. The indexed sum receives an explicit reservation, but an additional individual variable such as the slack term does not necessarily receive perfectly planned space. Further allocation can therefore occur. The method still avoids the many small temporary objects associated with assembling the expression through overloaded arithmetic.

The contribution is thus more specific than a promise of allocation-free construction. It is a controlled route from syntax to the desired representation, with enough advance information to eliminate substantial unnecessary work.

#### Use scalable linear problems to test preparation

The linear benchmarks use optimization problems whose dimensions can be varied. The p-median problem places facilities so that customers are close to an available facility. Its objective is:

```
min Σᵢ₌₁ᴺ Σⱼ₌₁ᴸ |Cᵢ − j|xᵢⱼ
```

N is the number of customers, L is the number of candidate facility locations, and Cᵢ gives the location of customer i. The absolute-value term measures the distance used in the objective. The variable xᵢⱼ associates customer i with location j, and the double summation collects those contributions.

The first constraint family links assignments to facility decisions:

```
xᵢⱼ ≤ yⱼ,  i = 1,…,N,  j = 1,…,L
```

The variable yⱼ indicates the facility decision at candidate location j. The inequality prevents an assignment variable from exceeding the corresponding facility variable. It connects the customer-assignment part of the formulation to the facility-selection part.

Each customer must receive an assignment:

```
Σⱼ₌₁ᴸ xᵢⱼ = 1,  i = 1,…,N
```

For a given customer i, the summation runs over candidate locations. The equality specifies the required total assignment.

The facility decisions also satisfy:

```
Σⱼ₌₁ᴸ yⱼ = M
```

M is the required facility total. In the benchmark, the authors fix M=100 and N=100, generate customer locations randomly, and vary L. This creates increasingly large construction tasks while retaining the same general formulation.

The other linear-construction benchmark comes from a linear-quadratic control problem. Its constraints connect neighboring values across a discretized grid. A representative equation is:

```
(yᵢ₊₁,ⱼ − yᵢ,ⱼ)/Δt = (yᵢ,ⱼ₋₁ − 2yᵢ,ⱼ + yᵢ,ⱼ₊₁ + yᵢ₊₁,ⱼ₋₁ − 2yᵢ₊₁,ⱼ + yᵢ₊₁,ⱼ₊₁)/(2(Δx)²)
```

The indexed quantities y describe values on the grid. The symbols Δt and Δx are the discretization increments appearing in the formulation. The equation relates a difference between successive values of the first index to differences across neighboring values of the second index.

The boundary conditions include:

```
yᵢ,₂ − 4yᵢ,₁ + 3yᵢ,₀ = 0
```

The index i selects a grid position along the other dimension. This equation constrains values near one boundary through a fixed linear combination.

The other boundary introduces the control variable:

```
yᵢ,ₙ₋₂ − 4yᵢ,ₙ₋₁ + 3yᵢ,ₙ = (2Δx)(uᵢ − yᵢ,ₙ)
```

The variable uᵢ is the control associated with index i. The symbol n follows the boundary notation used in the formulation. The displayed formulation also uses N and M for grid ranges; the paper does not fully harmonize those index conventions.

The control and state restrictions are:

```
−1 ≤ uᵢ ≤ 1
```

Here uᵢ is bounded on both sides. These bounds contribute additional entries to the optimization description without introducing nonlinear arithmetic.

```
y₀,ⱼ = 0
```

The first grid slice is fixed at zero, with j ranging over the spatial positions specified by the formulation.

```
0 ≤ yᵢ,ⱼ ≤ 1
```

The remaining state variables receive lower and upper bounds. The paper also defines a grid-dependent quantity:

```
gⱼ = (1/2)(1 − (jΔx)²)
```

The symbol gⱼ is indexed by j, and Δx is the same grid increment. Because the benchmark omits the original quadratic objective, this definition does not support a claim about optimizing that objective.

The authors remove the objective because the compared packages do not all support quadratic objectives and because the relevant file-format conventions are insufficiently clear. The resulting experiment tests constraint preparation and output, instead of the full quadratic problem.

#### Represent nonlinear expressions as trees

For nonlinear optimization, the general formulation is:

```
minₓ f(x), subject to gᵢ(x) ≤ 0, i = 1,…,m
```

The vector x contains the decision variables. The function f is the objective, each gᵢ defines a constraint, and m is the number of constraints. The functions are specified through closed-form expressions.

A nonlinear expression cannot generally be reduced to one array of variable indices and one array of constant coefficients. Its representation must preserve operations such as multiplication, powers, and trigonometric functions. The prototype therefore builds algebraic expression trees.

At macro-expansion time, names and indexing operations are still symbolic. Their actual values may depend on the runtime context. The macro generates code that reconstructs the expression tree while inserting the relevant numerical values and variable placeholders during execution.

This arrangement preserves the relationship between the expression and the surrounding Julia program. It also avoids a runtime evaluation call that interprets an expression afresh. The authors report that the tree-building macro occupies roughly 20 lines, including support for indexed sums.

That compactness is an implementation observation, not a direct measure of usability. The paper acknowledges that writing the macro requires substantial understanding of Julia’s metaprogramming facilities. Its comparison is with the work needed to obtain similar behavior in a lower-level setting, where implementing a parser would become part of the task.

#### Differentiate structure, then compile evaluation

The derivative quantity tested is the constraint Jacobian:

```
J(x) = [∇g₁(x); ∇g₂(x); …; ∇gₘ(x)]
```

J(x) is the matrix of constraint derivatives at x. The gradient ∇gᵢ(x) is treated as a row containing the derivatives of constraint gᵢ with respect to the decision variables. The semicolons indicate stacking those rows.

The authors apply the chain rule symbolically to the expression trees. This determines both the derivative expressions and the sparse Jacobian structure. They then generate a function that evaluates the derivatives numerically and let Julia compile it.

Repeated constraint forms reduce the preparation work. Expressions count as equivalent when they have the same symbolic form and their variables can be matched correspondingly. Symbolic differentiation is performed once for such a form rather than independently for every occurrence.

The Jacobian implementation occupies approximately 250 lines, including the chain-rule machinery. The paper contrasts this route with the automatic-differentiation approach commonly used in algebraic optimization software. It does not claim that symbolic differentiation is universally preferable; it demonstrates that this comparatively simple implementation can be efficient when combined with compilation.

#### Test repeated nonlinear relationships

The first nonlinear problem, clnlbeam, includes:

```
xᵢ₊₁ − xᵢ − (sin(tᵢ₊₁) + sin(tᵢ))/(2n) = 0
```

The index i runs from 1 through n. The variables x and t belong to indexed vectors, and n controls the discretization size. The equation combines neighboring x values with a nonlinear function of neighboring t values.

Another constraint family is:

```
tᵢ₊₁ − tᵢ − uᵢ₊₁/(2n) − uᵢ/(2n) = 0
```

The vector u supplies another set of decision variables. This family has a repeated local structure like the previous one, but the displayed expression is linear.

The bounded variables satisfy:

```
−1 ≤ tᵢ ≤ 1
```

The index i ranges over the vector entries specified in the problem, including the additional endpoint.

```
−0.05 ≤ xᵢ ≤ 0.05
```

The x variables have their own bounds. The authors test n at 5,000, 50,000, and 500,000. The objective is omitted because the experiment concerns construction and constraint derivatives.

The other nonlinear problem, cont5_1, uses a grid of y variables and a vector u. Its main constraint is displayed as:

```
n(yᵢ₊₁,ⱼ₊₁ − yᵢ,ⱼ₊₁) − a(yᵢ,ⱼ − 2yᵢ,ⱼ + yᵢ,ⱼ₊₁ + yᵢ₊₁,ⱼ − 2yᵢ₊₁,ⱼ₊₁ + yᵢ₊₁,ⱼ₊₂) = 0
```

The symbols i and j index the grid, n controls its size, and a is a coefficient defined below. The equation is reproduced with the indexed terms used in the paper’s mathematical statement. It should not be silently replaced by a presumed discretization formula.

Its boundary conditions include:

```
yᵢ₊₁,₃ − 4yᵢ₊₁,₂ + 3yᵢ₊₁,₁ = 0
```

This constrains neighboring values at a boundary. The other boundary contains the nonlinear term:

```
c(yᵢ₊₁,ₙ₋₁ − 4yᵢ₊₁,ₙ + 3yᵢ₊₁,ₙ₊₁) + yᵢ₊₁,ₙ₊₁ − uᵢ + yᵢ₊₁,ₙ₊₁((yᵢ₊₁,ₙ₊₁)²)³ᐟ² = 0
```

The coefficient c scales the boundary combination, and uᵢ is the corresponding control variable. The fractional power and multiplication make this boundary relationship nonlinear.

The coefficients are:

```
a = 8n²/π²
```

The symbol π is the constant appearing in the formulation, and n is the grid-size parameter.

```
c = 2n/π
```

The symbols retain those meanings. The tested values of n are 200, 400, and 1,000. The contrast between repeated linear structure and localized nonlinear structure becomes important when interpreting the performance of the competing packages.

#### Exercise the sparse operations inside simplex

The simplex study tests a matrix-transpose product, a ratio test, and a conditional vector update. These operations have mathematical descriptions, but practical implementations must also handle sparse storage, selected entries, and numerical tolerances.

For the matrix operation:

```
Aᵀx = Σᵢ:ₓᵢ≠₀ aᵢxᵢ
```

A is a matrix, Aᵀ is its transpose, and x is the input vector. The vector aᵢ contains the entries corresponding to row i of A, arranged for the sum. Only indices with a non-zero xᵢ contribute.

This expression explains why vector sparsity matters. A column-based implementation can calculate dot products, while a row-based implementation can combine only rows whose corresponding vector entries are non-zero. The latter can avoid substantial work when x itself is sparse.

The selected matrix columns also change during simplex. The dense-vector routine uses a flag vector to identify the relevant columns. Its output retains the full column-index layout, which can simplify subsequent operations. The sparse-vector routine omits a per-entry flag check where that check would undermine the benefit of traversing the sparse data.

The mathematical ratio test is:

```
minᵢ:αᵢ>₀ dᵢ/αᵢ
```

The vectors d and α contain the values used to determine a step restriction. Only positive αᵢ values enter the displayed minimum. A direct implementation of this expression is not enough for numerical robustness.

The authors use a stabilized two-pass procedure. Its purpose is to avoid selecting a problematic small αᵢ while permitting limited infeasibility controlled by a tolerance ε_D. Their implementation accounts for lower and upper bounds, although the simplified algorithm description does not show all that logic.

The update operation is:

```
y ← αx + y
```

Here x and y are vectors and α is a scalar multiplier. Each updated component is also checked against an interval. A value below a negative tolerance, for instance, can indicate a feasibility problem requiring corrective action.

The interval check makes the operation more than a standard library vector update. It combines arithmetic and conditional logic in a way naturally expressed by an explicit loop. That is precisely the kind of computation the language comparison is meant to test.

### Experiments and results

#### Linear preparation includes output costs

The linear experiments measure elapsed time from executing a problem-description script to producing an LP or MPS output file, where the format is available. This endpoint is a deliberate compromise. Different algebraic systems construct their final internal representations at different stages, making an isolated in-memory construction measurement difficult to compare fairly.

The resulting metric includes more than expression assembly. It can contain format conversion and file writing, along with the work needed to produce the required representation. The authors ran these experiments on Linux using an Intel Xeon E5-2650 processor.

For p-median, the authors fix M=100 facilities and N=100 customers while varying the candidate-location count L. Customer locations are generated randomly. This creates a controlled family in which the algebraic structure remains recognizable as the preparation workload grows.

JuMP’s reported total time is within a factor of two of AMPL. It also compares favorably with Gurobi’s C++ interface, sometimes running faster, and the paper characterizes the Python-based algebraic packages as an order of magnitude slower. Those are claims about the tested preparation-and-output task, not about how quickly the resulting optimization problems are solved.

The output format helps explain part of the variation. JuMP’s row-oriented construction representation can be written in LP form without a transposition. A format that requires a different arrangement introduces additional work. The authors report that constructing the p-median representation accounts for 20% to 50% of total time in JuMP and AMPL, showing why the remaining output-related work cannot be ignored.

The linear-quadratic control benchmark gives a similar overall ordering. However, its objective has been set to zero, so this result concerns preparing the retained constraints and producing files. It does not demonstrate end-to-end handling of the original quadratic objective across all packages.

The numerical cells of the linear result tables are not available in the paper’s rendered account. As a consequence, the reported prose comparisons support the relative conclusions above, but not a reconstruction of exact elapsed times for individual sizes. An assessment should preserve that distinction rather than turn broad statements into invented timing data.

#### Nonlinear preparation includes compilation

The nonlinear tests compare Julia’s prototype with AMPL, YALMIP, and Pyomo. They use clnlbeam and cont5_1 from Hans Mittelmann’s AMPL-NLP collection. As in the linear-construction experiments, the machine runs Linux with an Intel Xeon E5-2650 processor.

The workload is explicitly limited to preparing the constraint representation and evaluating its Jacobian. The authors have not built a complete nonlinear algebraic system. Objectives and some right-hand-side details are therefore omitted or simplified because they are not the objects being measured.

The tested clnlbeam settings use n equal to 5,000, 50,000, and 500,000. For cont5_1, n takes the values 200, 400, and 1,000. These are scale parameters for the formulations, rather than measurements of predictive quality or optimization success.

Julia’s preparation phase includes compiling the generated Jacobian function. That accounting matters: compilation is part of the route to fast evaluation, and the authors do not remove it from the measured preparation cost. The phase also includes determining the Jacobian’s structure.

AMPL must write an intermediate nl file before the derivative evaluation arrangement used in the experiment. That file-related work enters its preparation time. The authors identify this requirement as one reason Julia can match or sometimes outperform AMPL. AMPL’s preprocessing is disabled, which further specifies the comparison.

The reported derivative-evaluation performance is comparable to AMPL’s low-level amplsolver facility. This supports the claim that generated and compiled symbolic derivatives can be practical in Julia. It does not establish that symbolic differentiation dominates alternative differentiation techniques across arbitrary nonlinear functions.

YALMIP behaves differently on the problem families. It performs well on cont5_1, whose structure is mostly linear, but cannot process the largest clnlbeam case within an hour. Across these cases, Pyomo behaves more consistently, but the authors report that, for the largest instances, it runs more than 50 times slower than Julia.

Pyomo runs under ordinary Python in this experiment. The paper says that it does not support accelerators such as PyPy in the tested arrangement. It also uses AMPL for Jacobian evaluation, so its preparation and derivative pathway differs from a wholly independent implementation of both stages.

#### Simplex timings use recorded solver inputs

The simplex-operation benchmark uses inputs collected during actual dual-simplex runs. The authors modify an implementation to record the data needed by the selected operations, sampling iterations uniformly across the run. For every problem, a minimum of 200 iterations is recorded.

The chosen problems are greenbea, stocfor3, ken-13, and fome12. The first group comes from NETLIB, while fome12 comes from Mittelmann’s benchmark collection. Their role is to expose the routines to differing problem sizes and sparse structures, rather than merely repeat the same synthetic access pattern.

The tested implementations use Julia, C++, MATLAB, and Python. Python is also executed under PyPy. A separate C++ version includes explicit bounds checks so that the overhead of checking array indices can be assessed.

The authors do not use NumPy for the Python implementation. Their reason is specific to the task: the routines still require manually written loops, so introducing array operations would not remove the central source of overhead. C++ is compiled with -O2, and no special runtime settings are used.

These experiments run on a different machine from the preparation studies: a Linux laptop with an Intel i5-3320M processor. Absolute times should therefore not be compared across those parts of the paper as if they came from the same computing environment.

The headline comparison places Julia within a factor of 2 of bounds-checked C++. MATLAB and PyPy fall within a reported factor range of 4 to 18. The chart below displays the upper ends of those reported bounds; it does not present individual measured runtimes or claim that every operation attains the displayed value.

Simplex operations across standard LP problems, reported runtime-factor upper bounds Julia has a tighter reported runtime bound than the MATLAB and PyPy group.

**The numbers**

| System or setting | reported upper bound on runtime factor relative to bounds-checked C++ |
| --- | --- |
| MATLAB and PyPy, reported range upper end | 18 |
| Julia, reported upper bound (this paper) | 2 |

Ordinary Python is described separately as at least 70x slower than C++. That is a lower bound on slowdown, so it should not be combined with the upper-bound chart as though the entries were equivalent measurements.

The result table aggregates performance through geometric means of per-iteration average execution times over 4 LP problems. The recorded timing is the fastest of three repetitions. This aggregation summarizes the benchmark, while the per-instance figure lets the authors examine variability that an aggregate alone could hide.

Julia’s behavior is reported as relatively consistent across the instances. MATLAB and PyPy vary more. Sparse-vector routines reduce execution time on all but the smaller greenbea problem, while PyPy gains less effectively from those routines.

The authors connect these findings to earlier Julia benchmarks on unrelated basic tasks. The important contribution is independent application-level evidence: operations with realistic sparse patterns and explicit loops show a similar broad relationship to compiled low-level code. The evidence remains tied to the tested routines and inputs.

### What the ablations show

The paper does not present a modern ablation study in which successive components of a single system are removed; it offers controlled implementation comparisons and structural analyses instead.

#### Bounds checking changes the reference point

The C++ variants distinguish implementations with and without explicit array-index validity checks. That comparison matters because high-level languages commonly perform such checks, and their overhead can otherwise be mixed into an undifferentiated language comparison.

Julia’s principal simplex result is stated against bounds-checked C++. This makes the reference more informative for assessing a language that preserves checked indexing. It does not remove every difference between the implementations, but it isolates an important source of extra work more carefully than a comparison with unchecked C++ alone would.

The analysis supports a bounded claim: Julia can approach a compiled implementation that performs comparable checking. It does not establish identical generated instructions, identical memory behavior, or equal performance once every possible implementation choice is controlled.

#### Sparse vectors change the useful algorithm

The dense-vector and sparse-vector routines test more than a change of container. They exploit different ways of calculating the matrix-transpose product. A dense vector favors examining selected columns, while a sparse vector allows the implementation to combine only the rows associated with non-zero entries.

The sparse route improves execution time on the tested problems except the smaller greenbea case. That exception is useful evidence. Exploiting sparsity introduces its own organization and traversal costs, so fewer arithmetic operations do not guarantee an advantage for every input.

The relative behavior of PyPy also changes on the sparse routines. This shows why a broad claim about just-in-time compilation is insufficient on its own. The resulting performance still depends on the particular language implementation, operation structure, and data access pattern.

#### Nonlinear structure affects competing packages differently

The contrast between clnlbeam and cont5_1 is an application-level analysis instead of a component removal. The former repeatedly introduces trigonometric expressions, while the latter is mostly linear apart from its nonlinear boundary relationship.

YALMIP’s stronger behavior on cont5_1 and difficulty with the largest clnlbeam instance indicate that package performance depends on expression structure, not merely an overall problem-size label. A benchmark family with only mostly linear expressions would give a narrower picture of nonlinear preparation.

The authors do not separately time every contributor to Julia’s result. Expression-tree construction, equivalence detection, symbolic differentiation, and compilation form a combined pathway. The experiment therefore supports the effectiveness of that pathway without assigning an isolated speed contribution to each ingredient.

#### Representation and output format are entangled

The LP-versus-MPS discussion exposes another controlled difference. JuMP naturally builds rows, and LP output can use that arrangement without the same reorganization required elsewhere. Part of a preparation benchmark can therefore reflect the fit between internal representation and requested output.

This does not invalidate the measured task: producing a usable problem file is genuine work. It does limit the causal interpretation. A faster total cannot be attributed entirely to expression translation when conversion and file output also differ.

Similarly, AMPL’s intermediate nonlinear file helps explain part of Julia’s preparation advantage. The paper identifies the mechanism but does not provide a complete decomposition that separates parser work, structural analysis, file traffic, and compilation for every system. The strongest interpretation concerns the complete tested workflow.

### Limitations

#### Limits the authors state

The nonlinear implementation is explicitly a proof of concept. It constructs constraint representations and evaluates Jacobians, but it is not presented as a finished nonlinear algebraic language. Its successful timings therefore cannot establish completeness of functionality, suitability for every solver interface, or production readiness.

The JuMP implementation is also described at an early development stage. The authors provide it with documentation and note interfaces to Gurobi and to Cbc and Clp from COIN-OR, while recommending against its use in production at that stage. Availability across supported operating systems should not be confused with evidence that all deployment requirements have been addressed.

The simplex implementation is partial. The tested operations account for between 20% and 50% of simplex execution time according to the prior work cited by the authors. Much of the remaining time concerns specialized factorization and linear-system solution routines, which they leave unimplemented because of their complexity.

Consequently, the paper does not provide a complete Julia simplex solver whose total running time can be compared with mature alternatives. Good performance on matrix products, ratio tests, and conditional updates is important evidence, but it does not settle the performance of the missing numerical core.

The authors also acknowledge imperfections in the linear construction strategy. Their generated code reserves space for indexed sums, but not every additional individual variable receives equivalent preallocation. JuMP avoids many temporary objects without claiming an optimal construction procedure in every case.

#### Limits visible in the experimental design

The preparation benchmarks measure composite workflows. Linear timings end with file output, and nonlinear preparation can include writing and reading intermediate files. Those boundaries are practical, but they combine costs that different systems incur differently.

Accordingly, the results do not support attributing every observed advantage to Julia’s compiler or its macro system. Internal representation, output conventions, package implementation, and required file exchanges also matter. The paper offers plausible explanations for several differences, rather than a complete causal accounting.

The linear-quadratic benchmark omits its original objective. That decision improves comparability across packages with differing capabilities and file-format support, but narrows the task. The results cannot establish equivalent handling of the complete original quadratic optimization problem.

The nonlinear tests also simplify objectives and right-hand-side details. They test the machinery relevant to constraint construction and Jacobian evaluation. They do not measure how derivative quality or numerical behavior affects a solver’s path toward an optimum.

The tested nonlinear families have recurring structure. That is valuable for realistic discretized problems and particularly compatible with recognizing equivalent expression trees. It leaves open how the same preparation strategy behaves on collections dominated by distinct expression forms with little reusable structure.

The simplex study uses realistic recorded data, but only from the selected standard problems. It covers differing sparse patterns without exhausting the range of possible optimization workloads. The smaller instance’s different response to sparse-vector routines is a reminder that input structure can change the outcome.

The reported timing aggregation also has limits. Geometric means summarize relative performance across the selected problems, while the fastest repetition emphasizes an observed best time. Those choices do not establish long-run timing variability, responsiveness under competing system load, or the distribution of performance in a different deployment.

Hardware differs between the preparation studies and the simplex study. The former use a server processor, while the latter use a laptop processor. Each comparison is meaningful within its own experiment, but absolute timings from those settings would not form a unified cross-task performance ranking.

#### Claims the evidence does not support

The paper does not show that Julia is always as fast as C++ or that high-level code automatically becomes efficient. The implementations still depend on deliberate representation choices, allocation control, sparse traversal, and methods appropriate to the operation.

It also does not demonstrate that macros are inherently superior to every overloaded interface. The argument concerns avoiding unnecessary intermediate construction in the implementations and workloads examined. Other expression structures or implementation strategies would require their own evidence.

Similarly, the nonlinear study does not settle a general contest between symbolic and automatic differentiation. It demonstrates that symbolic derivatives, shared expression structure, and runtime compilation can work well together in the prototype. Broader derivative coverage, numerical properties, and preparation costs are outside the demonstrated comparison.

Finally, the paper’s performance results are not measurements of better optimization decisions. Faster preparation and faster internal operations can reduce computational overhead, but the experiments do not report improved objective values, greater solution accuracy, or a new optimization algorithm. The contribution concerns how optimization software can be implemented efficiently.

### What came after

A specific later study building on this paper is not established by the available research record here. It would therefore be unwarranted to attach later results, adoption claims, or a broader development history to these experiments.

The forward-looking contribution is nonetheless clear. The paper presents an algebraic package that uses syntax transformation to construct sparse optimization representations, a nonlinear prototype that combines symbolic structure with compiled evaluation, and realistic evidence that explicit sparse loops can run efficiently in Julia. These are concrete starting points for subsequent work, even though the paper does not establish that later history.

Its most consequential question also remains well defined: how much of the separation between expressive mathematical software and efficient numerical implementation is unavoidable, and how much follows from the language mechanisms used to connect them? The authors answer for several important operations. They show that the boundary can be moved by exposing expressions as data, planning construction around the target representation, and compiling the numerical work that those representations make possible.

## Cite

Cite as Miles Lubin and Iain Dunning. 2015. Computing in Operations Research Using Julia. INFORMS journal on computing.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1287/ijoc.2014.0623](https://doi.org/10.1287/ijoc.2014.0623) · [arXiv 1312.1431](https://arxiv.org/abs/1312.1431)

```bibtex
@article{lubin2015computing,
  title = {{Computing in Operations Research Using Julia}},
  author = {Miles Lubin and Iain Dunning},
  journal = {INFORMS journal on computing},
  year = {2015},
  doi = {10.1287/ijoc.2014.0623},
  eprint = {1312.1431},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1287/ijoc.2014.0623}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
