• Stars
    star
    321
  • Rank 130,752 (Top 3 %)
  • Language
    C++
  • License
    Other
  • Created over 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

COIN-OR Linear Programming Solver

Clp

A COIN-OR Project

Projects such as this one are maintained by a small group of volunteers under the auspices of the non-profit COIN-OR Foundation and we need your help! Please consider sponsoring our activities or volunteering to help!

Latest Release

This file is auto-generated from config.yml using the generate_readme script. To make changes, please edit config.yml or the generation scripts here and here.

Clp (Coin-or linear programming) is an open-source linear programming solver. It is primarily meant to be used as a callable library, but a basic, stand-alone executable version is also available. It is designed to find solutions of mathematical optimization problems of the form

minimize c'x such that lhs ≤ Ax ≤ rhs and lb ≤ x ≤ ub

CLP includes primal and dual Simplex solvers. Both dual and primal algorithms can use matrix storage methods provided by the user (0-1 and network matrices are already supported in addition to the default sparse matrix). The dual algorithm has Dantzig and Steepest edge row pivot choices; new ones may be provided by the user. The same is true for the column pivot choice of the primal algorithm. The primal can also use a non linear cost which should work for piecewise linear convex functions. CLP also includes a barrier method for solving LPs.

Clp is written in C++ and is released as open source under the Eclipse Public License 2.0.

It is distributed under the auspices of the COIN-OR Foundation.

The Clp development site is https://github.com/coin-or/Clp.

CITE

Code: DOI

CURRENT BUILD STATUS

Windows Builds

Linux and MacOS Builds

DOWNLOAD

What follows is a quick start guide for obtaining or building Clp on common platforms. More detailed information is available here.

Docker image

There is a Docker image that provides Clp, as well as other projects in the COIN-OR Optimization Suite here

Binaries

For newer releases, binaries will be made available as assets attached to releases in Github here. Older binaries are archived as part of Clp here.

  • Linux (see https://repology.org/project/coin-or-clp/versions for a complete listing):

    • arch:
      $ sudo pacman -S  coin-or-clp
      
    • Debian/Ubuntu:
      $ sudo apt-get install  coinor-clp coinor-libclp-dev
      
    • Fedora/Redhat/CentOS:
      $ sudo yum install  coin-or-Clp coin-or-Clp-devel
      
    • freebsd:
      $ sudo pkg install math/clp
      
    • linuxbrew:
      $ brew install clp
      
  • Windows: The easiest way to get Clp on Windows is to download an archive as described above.

  • Mac OS X: The easiest way to get Clp on Mac OS X is through Homebrew.

    $ brew tap coin-or-tools/coinor
    $ brew install coin-or-tools/coinor/clp
    
  • conda (cross-platform, no Windows for now):

    $ conda install coin-or-clp
    

Due to license incompatibilities, pre-compiled binaries lack some functionality. If binaries are not available for your platform for the latest version and you would like to request them to be built and posted, feel free to let us know on the mailing list.

Source

Source code can be obtained either by

  • Downloading a snapshot of the source code for the latest release version of Clp from the releases page,
  • Cloning this repository from Github, or
  • Using the coinbrew script to get the project and all dependencies (recommended, see below).

Dependencies

Clp has a number of dependencies, which are detailed in config.yml. Dependencies on other COIN-OR projects are automatically downloaded when obtaining the source with coinbrew. For some of the remaining third-party dependencies, automatic download scripts and build wrappers are provided (and will also be automatically run for required and recommended dependencies), while other libraries that are aeasy to obtain must be installed using an appropriate package manager (or may come with your OS by default).

BUILDING from source

These quick start instructions assume you are in a bash shell.

Using coinbrew

To download and build Clp from source, execute the following on the command line.

wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
chmod u+x coinbrew
./coinbrew fetch Clp@master
./coinbrew build Clp

For more detailed instructions on coinbrew, see https://coin-or.github.io/coinbrew. The coinbrew script will fetch the additional projects specified in the Dependencies section of config.yml.

Without coinbrew (Expert users)

  • Download the source code, e.g., by cloning the git repo https://github.com/coin-or/Clp
  • Download and install the source code for the dependencies listed in config.yml
  • Build the code as follows (make sure to set PKG_CONFIG_PTH to install directory for dependencies).
./configure -C
make
make test
make install

With Microsoft Visual Studio

For Microsoft Visual C++ users, there are project files for version 10 available in the MSVisualStudio directory. First, obtain the source code using either a Windows git client or download a snapshot. In MSVC++ Version 10, open the solution file (this should be converted to whatever version of MSVC+ you are using) and build the Clp project. The code should build out of the box with default settings.

It is also possible to build Clp with the Visual Studio compiler from the command line using the procedure for Unix-like environments, using the Msys2 shell or CYGWIN. This is the recommended and best-supported way of building Clp in Windows from source. To do so, make sure the cl compiler is in your path and add --enable-msvc to build command of coinbrew.

Quick start

Running clp gives you some hints. It can do a unit test (clp -unitTest) and solve netlib problems (-netlib or -netlibp using primal). It can also solve problems and set tolerances etc. Just do

clp 

and then try ? or setting various stuff.

clp filename                #read file, do presolve and dual algorithm
clp filename -primalsimplex #use primal instead

On Linux, clp can do file completion and line editing if it can find the history, readline, and termcap packages when building.

If you want to stress the code, you can set various stuff, e.g., dantzig pricing and then go into netlib testing. It is not guaranteed that it will solve all netlib instances if you get too creative. For instance using presolve makes netlib solve faster - but pilot87 prefers a large infeasibility weight. So

clp -presolve on -dualbound 1.0e10 -netlib

works well.

There are examples in examples. To create an executable, build with coinbrew as above and then do

cd build/Cbc/master/examples
make DRIVER=minimum #build the driver minimum.cpp

or whichever driver you want. A list is in Makefile. Three useful samples are:

  • minimum.cpp This is the simplest possible program to read an mps file.

  • defaults.cpp. This does not do much more, but it does it in much more complicated way by specifically setting defaults so it does give more useful information. It also prints a solution in a format similar to that of MPSX.

  • presolve.cpp This is a good driver for larger problems.

Other ones can get complicated so start simple and work your way up.

Doxygen Documentation

If you have Doxygen available, you can build a HTML documentation by typing

make doxygen-docs

in the build directory. If Clp was built via coinbrew, then the build directory will be ./build/Clp/master by default. The doxygen documentation main file is found at <build-dir>/doxydoc/html/index.html.

If you don't have doxygen installed locally, you can use also find the documentation here.

Project Links

Help:

Documentation:

Interfaces:

More Repositories

1

pulp

A python Linear Programming API
Python
2,058
star
2

Ipopt

COIN-OR Interior Point Optimizer IPOPT
C++
1,082
star
3

Cbc

COIN-OR Branch-and-Cut solver
C++
620
star
4

python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Python
520
star
5

CppAD

A C++ Algorithmic Differentiation Package: Home Page
C++
375
star
6

qpOASES

Open-source C++ implementation of the recently proposed online active set strategy
C++
261
star
7

rbfopt

RBFOpt library for black-box optimization
Python
181
star
8

CyLP

A Python interface to CLP, CBC, and CGL to solve LPs and MIPs.
JetBrains MPS
175
star
9

Gravity

Mathematical Modeling for Optimization and Machine Learning
C++
149
star
10

SHOT

A solver for mixed-integer nonlinear optimization problems
C++
118
star
11

COIN-OR-OptimizationSuite

A harness for building the bundled suite of interoperable optimization tools available in the COIN-OR repository.
Shell
105
star
12

Bonmin

Basic Open-source Nonlinear Mixed INteger programming
C++
103
star
13

ADOL-C

A Package for Automatic Differentiation of Algorithms Written in C/C++
C++
94
star
14

Cbc.old

This is a mirror of the subversion repository on COIN-OR
C++
88
star
15

minotaur

Minotaur Toolkit for Mixed-Integer Nonlinear Optimization
C++
68
star
16

GrUMPy

A Python library for visualizing algorithms for solving mathematical optimization problems.
Shell
60
star
17

SYMPHONY

SYMPHONY is an open-source solver, callable library, and development framework for mixed-integer linear programs (MILPs) written in C with a number of unique features
C
59
star
18

Couenne

Convex Over and Under Envelopes for Nonlinear Estimation
C++
55
star
19

jorlib

Java Operations Research Library
Java
54
star
20

Csdp

This is the working repository for the CSDP project. CSDP is a solver for semidefinite programming problems. It is a COIN-OR project.
C
52
star
21

MibS

A solver for mixed integer bilevel programs
JetBrains MPS
50
star
22

Osi

Open Solver Interface
C++
48
star
23

CoinUtils

COIN-OR Utilities
C++
44
star
24

Rehearse

Algebraic modeling library in C++ for linear optimization solvers
M4
42
star
25

prtpy

Number partitioning in Python
Python
42
star
26

Clp.old

This a mirror of the subversion repository on COIN-OR.
C++
36
star
27

GiMPy

A graph library containing pure Python implementations of a variety of graph algorithms
Python
33
star
28

coinbrew

COIN-OR build and installation script
Shell
26
star
29

metslib

An Open Source Tabu Search Metaheuristic framework in C++
C++
25
star
30

Bcp

Branch-Cut-Price Framework
C++
24
star
31

Cgl

Cut Generator Library
C++
21
star
32

VRPH

VRPH is an open source library of heuristics for the capacitated Vehicle Routing Problem (VRP).
C++
19
star
33

SYMPHONY.old

This a mirror of the subversion repository on COIN-OR.
C
16
star
34

Dip

DIP is a decomposition-based solver framework for mixed integer linear programs.
C++
15
star
35

Osi.old

This a mirror of the subversion repository on COIN-OR.
C++
11
star
36

Sonnet

A wrapper for COIN-OR mixed integer linear programming via OSI to Microsoft .NET
C#
10
star
37

Dip.old

This a mirror of the subversion repository on COIN-OR.
C++
10
star
38

CoinMP

C-API library for CLP, CBC, and CGL
Shell
9
star
39

Cmpl

<Coliop|Coin> Mathematical Programming Language
C++
9
star
40

CHiPPS-ALPS

This is the Abstract Library for Parallel Search (ALPS), the abstract base layer of the COIN-OR High Performance Parallel Search framework.
C++
8
star
41

FlopCpp

An open source algebraic modelling language implemented as a C++ class library
Shell
8
star
42

oBB

Overlapping Branch and Bound Algorithm
C++
8
star
43

GAMSlinks

Links between GAMS (General Algebraic Modeling System) and solvers
C++
8
star
44

DisCO

Discrete Conic Optimization Solver
C++
7
star
45

filterSD

a library for nonlinear optimization written in Fortran
Fortran
7
star
46

CoinUtils.old

This a mirror of the subversion repository on COIN-OR.
C++
7
star
47

Paver

Python scripts to do comparisons on solver performance
Python
7
star
48

Vol

A C++ implementation of the volume algorithm for linear programming
Shell
7
star
49

Couenne.old

This a mirror of the subversion repository on COIN-OR. For bugtracking and wiki, see website.
C++
7
star
50

CHiPPS-BLIS

This is the BiCePS Linear Integer Solver (BLIS), a parallel solver for mixed integer linear programs that is implemented on top of the BiCePS layer of the CHiPPS framework.
C++
6
star
51

jMarkov

Java framework for Markov-chain (MC) modelling
Java
5
star
52

yaposib

Python binding to coin-osi
C++
5
star
53

Cgl.old

This a mirror of the subversion repository on COIN-OR.
C++
4
star
54

metslib-examples

Examples for METSLib
C++
4
star
55

ROSE

Reformulation-Optimization Software Engine
C++
3
star
56

Smi

An API for stochastic programming problems.
Shell
3
star
57

DyLP

Dynamic Simplex solver
C
2
star
58

CoinMP.old

Mirror of the CoinMP project from https://projects.coin-or.org/svn/CoinMP
Shell
2
star
59

coin-or.github.io

COIN-OR General Documentation
HTML
2
star
60

Osi2

Open Solver Interface Version 2
C++
1
star
61

MOCHA

Algorithms and heuristics to solve multicriteria matroid optimization problems
M4
1
star
62

Cgc

Cgc is a collection of network representations to facilitate the development and implementation of network algorithms.
C++
1
star
63

OS

Optimization Services
C++
1
star
64

PFunc

Generic task-parallel library for C/C++
C++
1
star
65

NLPAPI

NLPAPI is a set of subroutines and data structures for defining nonlinear programming problems. It includes an interface to call LANCELOT to solve the problem (you need to get your own copy of LANCELOT), and an interface to IPOPT.
C
1
star