coinclp Brings COIN-OR Clp Back to R with Sparse Models and Warm Starts
For R users who repeatedly solve a linear program as its inputs change, the return of COIN-OR Clp offers a useful capability: keep the model, reuse its previous basis and solve again. The new coinclp package brings that solver back to CRAN, while a companion package connects it to the R Optimization Infrastructure (ROI). The practical case for Clp is less about winning every speed test and more about workflows that benefit from warm starts, existing Clp code or a Windows installation that already includes the solver.
A gap in R solver support
Clp is an open-source linear programming solver maintained by COIN-OR, an operations research software project that began at IBM Research in 2000. Its methods include simplex and barrier algorithms. The project is mature, free under the Eclipse Public License, and particularly useful when a model can be adjusted and solved again from a saved basis.
R had access to Clp through Gabriel Gelius-Dietrich’s clpAPI, developed at Heinrich Heine University Düsseldorf for the sybil metabolic-modelling toolkit. It had been on CRAN since 2011. In 2017, Benoit Thieurmel added ROI.plugin.clp, making Clp available through ROI’s common solver interface.
That arrangement ended when clpAPI’s CRAN checks began failing and the package was archived on 30 November 2021. The ROI plugin depended on clpAPI, so it was archived about six weeks later. Sam Lovick, who had used clpAPI in his own models since 2018, found the gap when a fresh R installation could no longer load an old script. On Windows, the absence was especially frustrating: Rtools has included the Clp library since version 4.3, but R lacked the binding needed to call it.
Three ways into Clp
Lovick wrote coinclp from scratch against Clp’s current callable library. The package uses registered entry points and external pointers that clean up after themselves, and builds with R 4.5 and 4.6. Its simplest interface takes an objective, constraint matrix, direction and right-hand side, then returns the solution alongside the objective value, dual values and reduced costs.
library(coinclp) A <- rbind(material = c(120, 210), labour = c(110, 30), capacity = c( 1, 1)) fit <- clp_solve(c(143, 60), A, "<=", c(15000, 4000, 75), max = TRUE) fit$objval # 6315.625 fit$solution # 21.875 53.125 fit$duals # 0.0000 1.0375 28.8750
That input matrix can be a dense matrix, a sparse Matrix object, a slam triplet matrix, or separate i, j and v triplets. Sparse inputs remain sparse as coinclp passes them to Clp; the package sends the nonzero entries without first expanding them into a dense grid. For large, sparsely populated models, that can determine whether the problem fits in memory.
The second interface exposes the callable library for users who need to build a model, retain it, adjust coefficients or bounds, and solve again. That matters for parametric studies and column-generation loops, where rebuilding a model each time can discard the basis information that makes simplex re-solves efficient. The package vignette reports a tightened re-solve that takes zero iterations when it starts from a saved basis.
The third path is aimed at existing code. coinclp reproduces the names and arguments of the functions exported by clpAPI, including initProbCLP(), loadProblemCLP() and solveInitialCLP(). The compatibility layer is a separate implementation rather than reused clpAPI code; for many scripts, the migration may therefore amount to changing the package loaded by the script.
ROI support and solver output
The companion package, ROI.plugin.coinclp, registers Clp with ROI under the solver name "coinclp". It returns duals, reduced costs and row activities with the primal solution. The package had not yet cleared CRAN review at the time of the announcement, so installation was through GitHub.
library(ROI) library(ROI.plugin.coinclp) res <- ROI_solve(op, solver = "coinclp") solution(res, "dual")
For teams already using ROI, the shared interface makes comparing solvers straightforward: select the solver by name and inspect the results through the same framework. That can make coinclp easier to evaluate in an existing R workflow, especially when a model needs repeated solves or when users are restoring scripts built around the former clpAPI interface.
Where Clp fits on performance
Clp is not the fastest open-source LP solver across the board. Lovick compares it with HiGHS, developed by Julian Hall’s group at the University of Edinburgh and now the default LP solver in SciPy and MATLAB. On Hans Mittelmann’s LPopt benchmark, as of September 2026, HiGHS solved 54 of 65 test problems within the time limit; Clp solved 40. HiGHS was about twice as fast on the scaled geometric mean. Commercial solver COPT solved all 65 and was roughly 27 times faster than Clp on the same measure.
Those aggregate results don’t predict every individual model. Clp took 36 seconds on Linf_520c, compared with 872 seconds for HiGHS, and solved datt256 while HiGHS timed out. On other instances, HiGHS had the advantage, sometimes by a wide margin. For a single large LP that needs one solve, Lovick suggests trying the R packages highs or ROI.plugin.highs first; with ROI, comparing them requires changing the solver argument.
There’s also a firm boundary around Clp’s role: it solves linear programs, not mixed-integer problems. Users with integer variables need a solver that supports them, such as HiGHS, Rglpk, lpSolve or COIN-OR’s Rsymphony. ROI.plugin.coinclp rejects integer problems rather than silently relaxing them, and clp_solve() has no integer-variable support.
That leaves a clear use case: repeated LP solves where the previous basis can help, software that already uses Clp’s API, or Windows systems where Clp is available through Rtools. The benchmark makes performance a question to answer on the target model, rather than an assumption to make from the solver’s name.
Installation and project resources
On Windows, installing coinclp with install.packages("coinclp") is sufficient when Rtools is installed; CRAN binaries typically follow within a few days. On other platforms, Clp must first be installed as a system library. The package announcement lists coinor-libclp-dev for Debian and Ubuntu, coin-or-Clp-devel for Fedora, brew install clp for macOS, and coin-or-clp from conda-forge.
install.packages("coinclp")
remotes::install_github("SamLovick/ROI.plugin.coinclp")The source, issues and vignette are available at github.com/SamLovick/coinclp, with the ROI plugin at github.com/SamLovick/ROI.plugin.coinclp. Both packages use the Eclipse Public License, matching COIN-OR. For R teams evaluating the return of Clp, the most useful next step is to compare it on their own workload, particularly where model reuse and warm starts matter.