The reintroduction of the coinclp package revitalizes access to the COIN-OR Clp linear programming solver, enhancing R’s optimization tools.
Two new R packages have made their debut on CRAN: coinclp and ROI.plugin.coinclp. The first integrates the COIN-OR Clp linear programming solver, officially accepted on September 15, 2026. These packages restore vital functionality lost to R users in late 2021 and present an overview of their features, limitations, and use cases.
Background on Clp
COIN-OR Clp has been a cornerstone of the operations research community since its inception at IBM Research in 2000. This powerful simplex-based solver has maintained its reputation for efficiently handling linear programming tasks. Free to use under the Eclipse Public License, Clp’s legacy reflects significant advancements in open-source optimization.
A binding to Clp existed in R for over a decade, courtesy of Gabriel Gelius-Dietrich’s clpAPI. Initially tailored for the sybil metabolic modeling toolkit, clpAPI debuted on CRAN in 2011. Later, Benoit Thieurmel built the ROI.plugin.clp upon it in 2017, providing easy compatibility within the R Optimization Infrastructure. Unfortunately, as clpAPI became obsolete in 2021 due to failing CRAN checks, the subsequent plugin was also archived.
Key Features of coinclp
The coinclp package offers fresh bindings against the current Clp callable library, significantly enhancing usability for R users. The integration allows for three main approaches to problem solving:
- Single Call Execution: Users can input an objective function, constraint matrix, directions, and right-hand side values to receive a comprehensive solution, including shadow prices and reduced costs.
- Full Callable Library Access: This option allows for model building, result preservation, and adjustment of parameters, facilitating quick resampling from previously stored data.
- Backward Compatibility: All functions from the clpAPI are replicated under the coinclp package, making migration seamless for existing users.
The integration enhances the R experience, especially for users dependent on frequent model solutions with minor adjustments, as coinclp supports creating efficient warm starts from previous bases. This stands in contrast to traditional solver packages that often rebuild models, causing additional computational overhead.
ROI.plugin.coinclp
Accompanying the coinclp package is the ROI.plugin.coinclp, which allows the ROI framework to interact seamlessly with Clp. It adopts a naming convention that aligns with the new package while enhancing the solution output to include duals, reduced costs, and row activities.
To utilize ROI.plugin.coinclp, users simply load the package and can effortlessly switch solvers with the ROI framework by specifying solver = "coinclp".
Assessing Performance and Limitations
Visitors should not overlook Clp's evolving speed comparisons in the context of modern alternatives. While Clp remains reliable, it’s essential to recognize that competitors like HiGHS have surpassed it in many benchmarks. As of September 2026, HiGHS outperformed Clp in 54 out of 65 LP test problems on the LPopt benchmark, demonstrating a considerable speed advantage in most scenarios.
Still, Clp can be preferable in specific situations where its performance is unmatched; for example, some models result in faster resolutions with Clp based on problem structure. Thus, practitioners facing diverse problem types may benefit from conducting comparative analyses between solvers.
Further restrictions apply to Clp’s use; it is strictly for linear programming. Any projects involving integer variables require alternative options like HiGHS or packages such as Rglpk or lpSolve. Notably, the ROI.plugin refuses to process integer problems, ensuring clarity and preventing silent adjustments of variable types.
Installation Guidance
Installing coinclp on Windows is straightforward; users simply run install.packages("coinclp") to set everything up. However, for other operating systems, prerequisite installations include:
coinor-libclp-devfor Debian and Ubuntucoin-or-Clp-develfor Fedorabrew install clpon macOScoin-or-clpfrom conda-forge
Given the ROI.plugin coinclp is still in queue for CRAN’s approval, it can be installed directly from GitHub:
install.packages("coinclp")
remotes::install_github("SamLovick/ROI.plugin.coinclp")
Both packages are licensed under the Eclipse Public License, aligning with COIN-OR principles. Users transitioning from clpAPI should report any compatibility issues for prompt resolutions.
Discussion
Sign in to join the discussion.