# CLP

## Introduction

CLP is a high-performance open source linear programming solver, which implements primal simplex method, dual simplex method and interior point method. It supports reading and writing LP and MPS standard format model files, reading and solving NL format model files, and also provides C and C++ and other high-level language programming interfaces.

The main developer of CLP is John J. Forrest, whose development language is C++ and is released as open source under the Eclipse Public License 2.0. Currently, Clp is mainly maintained by John J. Forrest, Julian Hall and others.

## Parameters

### Termination condition

Parameter | Description |
---|---|

dualT(olerance) | For an optimal solution no dual infeasibility may exceed this value |

primalT(olerance) | For a feasible solution no primal infeasibility, i.e., constraint violation, may exceed this value |

sec(onds) | Maximum seconds |

maxIt(erations) | Maximum number of iterations before stopping |

### Print log

Parameter | Description |
---|---|

log(Level) | Level of detail in Solver output |

### Algorithm

Parameter | Description |
---|---|

presolve | Whether to presolve problem |

cross(over) | Whether to get a basic solution with the simplex algorithm after the barrier algorithm finished |

primalS(implex) | Do primal simplex algorithm |

dualS(implex) | Do dual simplex algorithm |

either(Simplex) | Do dual or primal simplex algorithm |

barr(ier) | Solve using primal dual predictor corrector algorithm |

### Input and output results

Parameter | Description |
---|---|

basisI(n) | Import basis from bas file |

basisO(ut) | Export basis as bas file |

solu(tion) | Prints solution to file |

For details, see: https://github.com/coin-or/Clp (opens new window)

## Examples of Usage

### Solve LP/MPS files

Assuming that the test example is test.mps, the Clp command line is used to solve the problem, the time limit is 60 seconds, the algorithm is the primal/dual simplex method, the output base solution file is test.bas, and the output result file is test.sol, then the calling command is :

```
clp test.mps sec=60 basisO test.bas solu test.sol either
```

### Solve NL files

Assuming that the test example is test.nl, the time limit is 60 seconds, and the log is enabled, then the calling command is:

```
cbc test.nl -AMPL "log=1 sec=60"
```