### 6 releases

✓ Uses Rust 2018 edition

new 0.1.5 | Oct 8, 2019 |
---|---|

0.1.4 | Oct 2, 2019 |

0.1.3 | Sep 13, 2019 |

#**59** in Science

**62** downloads per month

**MIT**license

32KB

687 lines

# slp

SolHOP Linear Programming Solver.

Currently, the simplex method is implemented. Soon ILP and MIP will be supported.

This projetct is still in development. The APIs can change a lot before the first stable release v1.0.0.

## Install and Run

### Install

`cargo`` install slp`

### Help

`$`` slp`` --`help
`slp`` 0.1.4`
`SolHOP`` Linear Programming Solver`
`USAGE:`
`slp`` ``[`FLAGS`]` `<`file`>`
`FLAGS:`
`-h,`` --`help Prints help information
`-p,`` --`parallel Enable data parallelism
`-V,`` --`version Prints version information
`ARGS:`
`<`file`>` Input `file`

### Usage

`slp`` input.txt`

where

contains the LP instance to be solved.`input .txt`

If no file is provided then input is taken from

.`stdin`

To enable data parallelism use

flag.`-`p

`slp`` input.txt`` -`p

## Input format

The input is provided throught

.`stdin`

An example of LP instance is

`max 2x1 + 3x2
subject to 2x1 + x2 <= 18
6x1 + 5x2 <= 60
2x1 + 5x2 <= 40
x1 >= 0
x2 >= 0
`

The corresponding input format is

`3 2 # 3 is number of constraints and 2 is number of variables
2 3 # coefficients of objective function to be maximized: 2x1 + 3x2
2 1 18 # Constraint 1: 2x1 + x2 <= 18
6 5 60 # Constraint 2: 6x1 + 5x2 <= 60
2 5 40 # Constraint 3: 2x1 + 5x2 <= 40
# x1 >= 0 and x2 >= 0 are always assumed
`

## Output format

The output of the

solver is sent to `slp`

and it can be one of the following:`stdout`

`INFEASIBLE
`

or

`UNBOUNDED
`

or

`OPTIMAL 28
SOLUTION 5 6
`

representing the objective value to be

and the solution as `28`

.`x1 = 5, x2 = 6`

## License

#### Dependencies

~3.5MB

~67K SLoC